Questions tagged [cmake-presets]

CMake presets are a configuration mechanism for composing and using common presets for CMake configurations. Presets can be written for common configuration, build, test, and packaging configurations. Preset configurations of each type can be composed via inheritence and used from the commandline.

The official documentation for CMake Presets can be found here.

20 questions
0
votes
0 answers

Build failed after change architecture from x64 to x86_64 using cmake preset on windows

I'm building a project using cmake preset in vs2019. My CMakePresets.json as follows: { "name": "windows-x86_64-release", "displayName": "Windows x86_64 Release", "description": "Target Windows with the Visual Studio development…
naichuans
  • 31
  • 7
0
votes
1 answer

How can I make colcon work with a plain preset-based CMake project with multiple presets in parallel?

Prologue I have a preset-based plain CMake project so that I can build and test it with cmake --preset $PRESET && cmake --build --preset $PRESET && ctest --preset $PRESET. Note that it nicely interacts with Microsoft's CMake Tools extension for…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
0 answers

VSCode: Refer to CMakePresets.json-defined (configure/build) environment variable in tasks.json and/or launch.json

As the title says, with Visual Studio Code and CMake extension, in a C++ project that is configured via CMakePresets.json (define configure, build, test environments and compilers/toolchains), how can one refer to a environment variable defined in…
0
votes
1 answer

Confusion between CMake preset fields and cache variables

There is pretty new but cool feature in CMake: presets I am confused with some of the possible values of preset: toolchainFile and installDir. This values could be set using simple cache variables, using cacheVariables entries (strictly…
Mariusz Jaskółka
  • 4,137
  • 2
  • 21
  • 47
-1
votes
1 answer

CMake FetchContent and CMakePresets conflict

I am working on a C++ project using CMake, and I manage third-party dependencies via FetchContent. I ran into an issue when trying to deduplicate the sub-builds generated by FetchContent for different build configurations. Below is a minimal working…
yah_nosh
  • 155
  • 1
  • 8
1
2