[CMake] unset() command

Philip Lowman philip at yhbt.com
Wed Aug 20 10:33:57 EDT 2008


So I submitted a patch to add a new unset() command to CMake.  The command
will unset normal or cache variables (causing them to become undefined).
The command also supports unsetting environment variables, in case anyone
has to do that.

The primary use case that drove me to implement this was this:

find_library(FOO_LIBRARY foo)
if(MSVC OR SEARCH_FOO_DEBUG)
    find_library(FOO_LIBRARY_DEBUG food)
else()
    unset(FOO_LIBRARY_DEBUG)
    set(FOO_LIBRARY_DEBUG ${FOO_LIBRARY})
endif()

http://public.kitware.com/Bug/view.php?id=7507

Comments?

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080820/9dc99d10/attachment.htm>


More information about the CMake mailing list