Fraser Hutchison wrote:
> Hi there,
> 
> CMake 3.1 (both release candidates) now generate a CMP0054 warning when
> configuring the following CMakeLists.txt in a clean build folder with MSVC
> as the generator:
> 
> cmake_minimum_required(VERSION 2.8)
> enable_language(ASM_MASM)
> 
> The warning is:
> 
> CMake Warning (dev) at E:/Program Files (x86)/CMake
> 3/share/cmake-3.1/Modules/CMakeFindBinUtils.cmake:33 (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.
> 
> I can see the file in question has been updated (presumably since RC2) to
> not quote the left-hand variables:
> http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeFindBinUtils.
> cmake;h=50cb9721272f98bc2ffe73e95ae57c3156251188;hb=HEAD but even with these
> updates, the quoted "MSVC" args generate the warning.
> 
> I've attached a trivial patch removing all remaining instances of quoted
> "MSVC"s.

Nope, this is wrong. What you now do is to compare it to the variable MSVC, 
which is true or false (or undefined). This wants to be compared to the string 
MSVC, so this probably needs to be changed to

if ("x${foo}" STREQUAL "xMSVC")

Greetings,

Eike
-- 

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 

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-developers

Reply via email to