Defining stage-specific presets
Stage-specific presets are simply presets that configure individual CMake stages: configure, build, test, package, and install. They allow for a granular and structured approach to defining build configurations. Here’s an overview of the common features shared across all preset stages, followed by an introduction to defining presets for individual stages.
Common features across presets
There are three features that are used to configure presets regardless of the CMake stage. Namely, these are unique name fields, optional fields, and associations with configuration presets. The following sections will cover each, respectively.
Unique name fields
Every preset must have a unique name field within its stage. Given that CMakeUserPresets.json (if it exists) implicitly includes CMakePresets.json (if it exists), both files share the namespace, preventing duplicate names across them. For example, you can’t have two package-stage...