I'm creating a project (let's call it myProject) that includes macros and CMakefiles defined in another project (let's call it otherProject). Of course, myProject depends on libraries created and compiled in otherProject.
otherProject has an option to set compilation of the libraries in dynamic or static using the standard option command:
option(USE_STATIC_LIBRARIES "Build static libraries?" OFF )
In myProject, I want to force this option to ON all the time and remove it from the GUI so that users will not be able to change it; WITHOUT having to modify the original CMakefile. What I have done so far is force the value to ON by using the following:
set( USE_STATIC_LIBRARIES ON FORCE )
include( otherProjectCmakefile)
This works as intended, forcing the value to ON, but the option still appears in the GUI (user action however is ignored and internally, the value is always ON).
My question is, how can I remove the option from the GUI completely, not display it at all. I want to avoid any possible confusion.
You can start reading from
cmake --help-command SET
and you will probably be interested in this option for SET
INTERNAL = No GUI entry (used for persistent variables).