[CMake] Hiding a variable from the GUI

Fernando Cacciola fernando.cacciola at gmail.com
Mon Mar 31 14:13:18 EDT 2008


Hi,

One of my users reported that the filenames of several header files appeared 
in the advanced section when using CMakeSetup/ccmake. Eventually I tracked 
down the problem to some macro using find_file.
It turns out that the variable where find_file (and family) reports the 
result is automatically cached whether I like or not. My code was using 
"mark_as_advanced" but that was not enough as my users just didn't want the 
variable in the GUI at all.

Eventually I came up with the following trivial macro "mark_as_internal" 
which I used to hide away these unwanted variables:

macro ( mark_as_internal _var )
  set ( ${_var} ${${_var}} CACHE INTERNAL "hide this!" FORCE )
endmacro( mark_as_internal _var )

but I wonder:

Is there a better way?

Shouldn't ALL the commands that create/define variables (like find_*) accept 
a NO_CACHE option? or at the very least an INTERNAL option?

TIA


-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com
http://groups.google.com/group/cppba






More information about the CMake mailing list