Defining workflow presets
Workflow presets are the ultimate automation solution for our project. They allow us to automatically execute multiple stage-specific presets in the predetermined order. That way, we can practically perform an end-to-end build in a single step.
To discover available workflows for a project, we can execute the following command:
cmake --workflow --list-presets
To select and apply a preset, use the following command:
cmake –workflow --preset <preset-name>
Additionally, with the --fresh
flag, we can wipe the build tree and clear the cache.
Defining workflow presets is quite simple; we need to define a name and we can optionally provide displayName
and description
, just like for stage-specific presets. After that, we must enumerate all the stage-specific presets the workflow should execute. This is done by providing a steps
array containing objects with type
and name
properties, as illustrated here:
ch16/01-presets/CMakePresets...