0

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
followait
  • 83
  • 9

2 Answers2

1

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
UltraInstinct
  • 43,308
  • 12
  • 81
  • 104
0

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>
fabian
  • 80,457
  • 12
  • 86
  • 114