`cmake --preset` without specifying preset could pick sane default
This is feature request.
I would like to use
--preset without actually specifying preset
$ cmake --preset ~/src/borg/ui/tui
- Because I believe (read: guess) that usually there exists a preset that covers ~90% of invocations.
- This slightly saves typing and memorizing preset name.
- This obviously hints new user that this preset is more important than others.
- Arguably such preset should be already covered by default values of all options (doesn't apply to my project, I don't know / want to guess about others). BUT specifying a default preset in
CMakeUserPresets.jsonwith long list of non-default parameters is still usefull.
- may be surprizing if after fetching changes from repo default preset changes (especially when selecting first preset as default)
How to choose a preset - idea 1:
- if it is specified on command line, obviously use it
cmake --preset=for_release .... Otherwise:
- if .json files have preset called
defaultuse it. Otherwise:
- pick first preset in
CMakePresets.json(in this order) If they are empty this is an error.
Above list with fallbacks seems good to me, but sticking with one (first seen vs named default) of the approaches would be good as well.
Different idea is to add key/value to json
"default_preset": "ninja-multi",. This lends itself well to overriding in