Skip to content

Presets

David K edited this page Jan 12, 2024 · 2 revisions

CMake presets are a way to simplify the configuration process.

To configure a project with a preset run:

cmake --preset [NAME OF PRESET]

All flags that can be passed to regular cmake command, such as -B, -S and -D, can be passed to cmake --preset

4 presets are provided:

  • default
    • The default preset uses the Ninja generator, enables ccache and compile commands.
  • ninja
    • Like the default preset, but with no caching or compile commands.
  • make
    • Like ninja, but using the Unix Makefiles generator.
  • ci
    • Provides a convenient way to configure the project for CI

All presets use build as the build directory by default.

Clone this wiki locally