[CMake] how to remove a variable??

Sergio Andrés sergio at unizar.es
Wed Dec 15 07:31:42 EST 2004


Hi all,

a simple question... How could I remove a variable from the CACHE??

I want to include VTK depending on an OPTION. If this OPTION is OFF, I 
would like to remove VTK_DIR varible from de CACHE (or at least from the 
CMakeSetup GUI).

I tried the following, but when the option is ON the VTK_DIR is INTERNAL 
and it is not shown.
----------------------------------
OPTION(SMOLIB_VTK "Use VTK classes" OFF)

IF (SMOLIB_VTK) 
    FIND_PACKAGE(VTK)
    IF (USE_VTK_FILE)
        INCLUDE(${USE_VTK_FILE})
    ENDIF (USE_VTK_FILE)
ELSE (SMOLIB_VTK)
    SET (VTK_DIR ${VTK_DIR} CACHE INTERNAL "" FORCE)
ENDIF (SMOLIB_VTK)
----------------------------------

Can anyone help me??
Thanks in advance.

Best,
Sergio


More information about the CMake mailing list