All the build hierarchy of my project is based on ExternalProject
with --config
option. A few days ago I updated to CMake 3.20, and now --config
is gone:
$ cmake --config
CMake Error: Unknown argument --config
CMake Error: Run 'cmake --help' for all supported options.
While the documentation still advises to use it, and the Release notes is also silent about the option.
What should I use instead of --config
?
You should use for configure:
cmake -S . -D CMAKE_BUILD_TYPE=Release
CMAKE_BUILD_TYPE
will be ignored at configure
And for build:
cmake --build . --config Release
Based on https://stackoverflow.com/a/64719718 I don't understand why docs ignored this movement
OK I had the same problem on macOS with the XCode generator.
Turns out all I was missing was the --build
command.
i.e. instead of:
cmake . --config Debug
I have to type:
cmake --build . --config Debug
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