Sergey
Sergey

Reputation: 8238

CMake --config since version 3.20

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?

Upvotes: 4

Views: 7160

Answers (3)

MoonRaiser
MoonRaiser

Reputation: 153

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

Upvotes: 4

Matias N Goldberg
Matias N Goldberg

Reputation: 469

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

Upvotes: 2

Eng_Farghly
Eng_Farghly

Reputation: 2997

Based on github Issue you should use

cmake --build .

Upvotes: 0

Related Questions