I'd like to add a variable that the user must set after clicking "Configure" in cmake-gui. Is there a way to do this?
Options and variables are defined on the CMake command line like this: $ cmake -DVARIABLE=value path/to/source You can set a variable after the initial `CMake` invocation to change its value. You can also undefine a variable: $ cmake -UVARIABLE path/to/source Variables are stored in the `CMake` cache.
CMAKE_CONFIGURATION_TYPES. Specifies the available build types (configurations) on multi-config generators (e.g. Visual Studio, Xcode , or Ninja Multi-Config ). Typical values include Debug , Release , RelWithDebInfo and MinSizeRel , but custom build types can also be defined.
There are two different ways to configure with cmake ; one is to run cmake in a fresh directory passing some options on the command line, and the other is to run ccmake and use its editor to change options. For both, assume you are in a directory called debug and the IMP source is in a directory at ../imp .
cmake the corresponding version file is located next to it and named either <config-file>-version. cmake or <config-file>Version. cmake . If no such version file is available then the configuration file is assumed to not be compatible with any requested version.
Using the set command, specify CACHE parameters, e.g.
set(NAME_INCLUDE "default value" CACHE FILEPATH "description") set(NAME_LIB "default value" CACHE FILEPATH "description")
In the GUI CMake will group all variables with the same prefix.
See the CMake documentation for set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With