By default, CMakeTools picks a generator of his choosing.
In my system, by default, CMake Tools is picking Ninja
to be the generator, instead of the desired Unix Makefiles
(stored in CMakeCache.txt as CMAKE_GENERATOR:INTERNAL=Ninja
)
Supposedly you can force CMakeTools' hand when picking the generator by using the cmake.generator
setting in settings.json
When doing by hand cmake -B build
in my system, CMakeCache.txt contains CMAKE_GENERATOR:INTERNAL=Unix Makefiles
Thus I set my current settings.json in $workspace/.vscode to
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.generator": "Unix Makefiles",
}
but when configuring, it still picks Ninja.
What am I doing wrong?
There seems to be a caching issue somewhere. After restarting VSCode it worked as expected
If you alter the "cmake.generator" entry, delete build folder, and rerun CMake's configuration step
[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++-7 -H/home/dario/temp/CMakeToolsTest -B/home/dario/temp/CMakeToolsTest/build -G "Unix Makefiles"
the value after the -G flag does not change accordingly
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