Share buildPresets with multiple configurePresets
I'm using CMakePresets.json with Visual Studio's File > Open > Folder... workflow with multi-config generators. I'd like to be able to easily share a single build preset with multiple configure presets so I can set 'Debug' and 'Release' build configs and have them show in Visual Studio's Build Presets dropdown menu much like you get when you generate a Visual Studio project with CMake and open that in Visual Studio directly.
Seems that this could be achieved if the configure preset specified by configurePreset
makes the build preset available to any preset that inherited that configure preset. For example, let's say I have a default
configure preset that's inherited by all my configure presets. I could give them all a Debug
and Release
build preset option with this:
"buildPresets": [
{
"name": "Debug",
"configurePreset": "default",
"configuration": "Debug"
},
{
"name": "Release",
"configurePreset": "default",
"configuration": "Release"
}
]
As far as I understand from the documentation and some experimentation, I would have to make one build preset per build config per configure preset to achieve the same functionality today and they'd all have to have different names like Debug-x86
, Debug-x64
, etc...