cmake
may take a lot of command parameters, for example
cmake -GNinja -DAAA=BBB ...
Any convenient way for Windows?
For example, save the parameters in a file like "cmake_cfg.debug", and call
camke --config_file=cmake_cfg.debug
cmake
may take a lot of command parameters, for example
cmake -GNinja -DAAA=BBB ...
Any convenient way for Windows?
For example, save the parameters in a file like "cmake_cfg.debug", and call
camke --config_file=cmake_cfg.debug
If you're using bash-like a shell, you could do something like:
$ cmake $(xargs < /path/to/file) ..
In your case, the file would look like (the individual values need to be separated by whitespace chars):
-GNinja -DAAA=BBB
-DOtherParam=Value
This will probably not work for the generator choice, but for all the cache entries you could create a cmake file using the set()
commands to set cache entries and use the -C
option to tell cmake
to use this file to prepopulate the cache:
prepopulate_cache.cmake
set(AAA "BBB" CACHE STRING "documentation string of AAA")
...
cmake -G Ninja -C prepopulate_cache.cmake <source_dir>