On 09/21/2015 09:37 AM, thoni56 wrote:
   Quoted variables like "" will no longer be dereferenced when the policy is

You apparently have a variable whose name is the empty string.

With the old (pre CMP0054) behavior this will break comparisons with empty strings take e.g.

        set("" foobar)
        set(MYVAR foobar)

        if(MYVAR STREQUAL "")
                message("unexpectedly true")
        endif()

Where the if() comparison with old behavior will unexpectedly (for most authors of such conditions) evaluate true.

With CMP0054's new behavior the same condition will evaluate false.

Since most cmake provided modules have to work with both the old and new behavior a common work around is e.g.

        if("x${MYVAR}" STREQUAL "x")

This workaround however only works if by convention there are no variables starting with a lower case x in their name.

I think by that same reasoning you should avoid defining variables whose name is the empty string.

Nils
--

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