set
: Set a CMAKE variable to a given value.set(<variable> <value>
[[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
Within CMake sets <variable> to the value <value>. <value> is expanded before <variable> is set to it. If CACHE is present, then the <variable> is put in the cache. <type> and <docstring> are then required. <type> is used by the CMake GUI to choose a widget with which the user sets a value. The value for <type> may be one of
FILEPATH = File chooser dialog.
PATH = Directory chooser dialog.
STRING = Arbitrary string.
BOOL = Boolean ON/OFF checkbox.
INTERNAL = No GUI entry (used for persistent variables).
If <type> is INTERNAL, then the <value> is always written into the cache, replacing any values existing in the cache. If it is not a cache variable, then this always writes into the current makefile. The FORCE option will overwrite the cache value removing any changes by the user.
If PARENT_SCOPE is present, the variable will be set in the scope above the current scope. Each new directory or function creates a new scope. This command will set the value of a variable into the parent directory or calling function (whichever is applicable to the case at hand).
If <value> is not specified then the variable is removed instead of set. See also: the unset() command.
set(<variable> <value1> ... <valueN>)
In this case <variable> is set to a semicolon separated list of values.
<variable> can be an environment variable such as:
set( ENV{PATH} /home/martink )
in which case the environment variable will be set.