presets: composition on command line
Suppose a project wants to use CMakePresets.json to consolidate the build instructions for a team that works on various plaforms and with varying degrees of familiarity with build commands.
The number of configurations which must be defined quickly spirals out of control without the ability to pass more than one preset at the command line.
For example, the project may need to be configured for Windows, Darwin, or Linux. This requires 3 presets.
They also want development and release builds. This requires 3 * 2 = 6 presets.
For troubleshooting purposes it may be necessary to have sanitized (asan, ubsan, etc) and unsanitized builds for each configuration. This requires 2 * 6 = 12 presets.
This scales painfully as other needs are discovered.
Suggestion: allow presets to be specified as a comma separated list.
--preset foo,bar
Would be interpreted as if --preset 011b95313f08930978594fc6ebad4106b8701a1d7732c07d0e4eb077f18716d0
was passed and as if CMakePresets.json contained:
{
"name": "011b95313f08930978594fc6ebad4106b8701a1d7732c07d0e4eb077f18716d0",
"inherits": [ "foo", "bar" ]
}
011b95313f08930978594fc6ebad4106b8701a1d7732c07d0e4eb077f18716d0 is the sha256 of the string "foo,bar" but any suitable transformation from the list to a unique identifier could be used instead.