cmake-presets
supports inheritance. That is nice, providing that the parent preset is visible, but not work otherwise. Taking for example with preset1.json
:
{
"version": 5,
"configurePresets": [
{
"name": "base_preset"
}
}
preset2.json
:
{
"version": 5,
"configurePresets": [
{
"name": "child_preset",
"inherits": [
"base_preset"
]
}
}
and CMakePresets.json
:
{
"version": 5,
"include": [
"preset1.json",
"preset2.json"
]
}
The inherited preset does not work because base_preset
is unreachable. Is it a bug or intended behavior?
Seems it's intended behavior.
You assume that the inclusion order in CMakePresets.json would also cover the declaration and inheritance order of presets, but instead each file needs to include it's inherited presets.
In your case
preset2.json
needs to includepreset1.json
to havebase_preset
visible.Quoting Kyle Edwards (Jun '23) on "CMakePresets: Include Behavior":