Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake --config since version 3.20

Tags:

cmake

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?

like image 255
Sergey Avatar asked Sep 14 '25 09:09

Sergey


2 Answers

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

like image 93
MoonRaiser Avatar answered Sep 16 '25 23:09

MoonRaiser


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

like image 35
Matias N Goldberg Avatar answered Sep 16 '25 23:09

Matias N Goldberg