[CMake] Deleting a variable

James Bigler bigler at cs.utah.edu
Mon Dec 4 16:11:07 EST 2006


I have some optional code that runs and creates some variables

IF(MY_VAR)
   SET(MY_OTHER_VAR 2)
ENDIF(MY_VAR)

If I turn off MY_VAR, I want MY_OTHER_VAR to do away like this:

IF(MY_VAR)
   SET(MY_OTHER_VAR 2)
ELSE(MY_VAR)
   DELETE(MY_OTHER_VAR)
ENDIF(MY_VAR)

Can this be done?

Thanks,
James



More information about the CMake mailing list