Hi all.  I'm testing an upgrade to CMake 3.1.0 (from 2.8.12.2) and
seeing a weird warning, but ONLY on Windows; it works fine on GNU/Linux
and OSX:

  -- The C compiler identification is MSVC 16.0.40219.1
  -- Check for working C compiler using: Visual Studio 10 2010 Win64
  -- Check for working C compiler using: Visual Studio 10 2010 Win64 -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- The CXX compiler identification is MSVC 16.0.40219.1
  CMake Warning (dev) at 
obj/REPOS/nuo3rdparty/common/cmake/share/cmake-3.1/Modules/CMakeDetermineCXXCompiler.cmake:106
 (if):
    Policy CMP0054 is not set: Only interpret if() arguments as variables or
    keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
    details.  Use the cmake_policy command to set the policy and suppress this
    warning.

    Quoted variables like "MSVC" will no longer be dereferenced when the policy
    is set to NEW.  Since the policy is not set the OLD behavior will be used.
  Call Stack (most recent call first):
    CMakeLists.txt:26 (enable_language)
  This warning is for project developers.  Use -Wno-dev to suppress it.

  -- Check for working CXX compiler using: Visual Studio 10 2010 Win64
  -- Check for working CXX compiler using: Visual Studio 10 2010 Win64 -- works

If I apply the attached patch it seems to fix the problem...?


diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 893c454..ea3a910 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -103,12 +103,12 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
   CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
 
   # Set old compiler and platform id variables.
-  if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+  if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
     set(CMAKE_COMPILER_IS_GNUCXX 1)
   endif()
-  if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
+  if(CMAKE_CXX_PLATFORM_ID MATCHES "MinGW")
     set(CMAKE_COMPILER_IS_MINGW 1)
-  elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
+  elseif(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin")
     set(CMAKE_COMPILER_IS_CYGWIN 1)
   endif()
 endif()
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to