Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,298
    • Issues 3,298
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21417

Closed
Open
Created Nov 10, 2020 by Mateusz Lewicki@mateusz.lewicki

`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

Why?

  • 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.

Why not?

  • 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.json with 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 default use it. Otherwise:
  • pick first preset in CMakeUserPresets.json or 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 CMakeUserPresets.json

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None