79688487

Date: 2025-07-03 08:10:54
Score: 2
Natty:
Report link

Stuck with the same problem in a Visual Studio project with CMakePresets.json when I cook it using the example from MSDN: https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs

I set "CMAKE_BUILD_TYPE": "Release" in json, but Visual Studio still generates debug builds in this preset (there is no way to additionally set build types inside a preset in GUI):

enter image description here

The reason is still the same: CMAKE_CONFIGURATION_TYPES with several default values ​​and "Debug" as the first option to be used.

So the solution might be to set only one corresponding CMAKE_CONFIGURATION_TYPES value inside CMakePresets.json:

      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_CONFIGURATION_TYPES": "Release"
      }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): Stuck with the same problem
  • Low reputation (0.5):
Posted by: 1ndahous3