Incorrect options for CLion at Build time when using CMakePresets
已回答
When using CLion on coding CMake project, I use CMakePreset to configure project.
I set some command in CMakePresets, such as
“buildPresets”:[
{
"name": "build-debug",
"configurePreset": "debug",
"configuration": "Debug",
"jobs": 3,
"verbose": true
}]
in this json code, i set cmake to use 3 thread to build my project.
but when I using CLion to Building the project, the build info show that it still using 6thread to build. such as this.
====================[ Build | demo | debug ]==========================
/usr/bin/cmake --build /home/sumover/CLionProjects/demo/build-debug --target demo -- -j 6
is this an error, or there are some way to configure it. thanks :)
请先登录再写评论。
I am facing the exact same issue. We are using Conan to generate CMakePresets.json which I am importing into CLion. As the CMake profiles deduced from CMake presets are read-only I cannot manually specify the number of jobs via “Build options”. However, Conan is able to set the jobs in the generated CMakePresets.json, but CLion does not respect this setting.
Hi sumover and Hirschbeck!
Sorry for the silence on our part.
If there is no
--preset “NameOfBuildPreset”in the build command executed in CLion, it means that you use a CMake profile that doesn't take into account your build preset.CLion creates a CMake profile for each configure preset and each build preset. Please go to Settings | Build, Execution, Deployment | CMake, enable the profile that uses your build preset (it will be called
NameOfConfigurePreset - NameOfBuildPresetand will have--preset "NameOfBuildPreset"in the Build options field), and use this profile to build your project.