Skip to content
Snippets Groups Projects
Commit 62f773db authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added description of presets

parent 3d5546a0
No related branches found
No related tags found
1 merge request!5add example for cmake presets
......@@ -11,12 +11,12 @@ Presets are based on two main files.
Presets have a name and specify flags for the configure, build, test, install, etc stage.
To invoke a preset configuration during the configure stage use e.g.
`
cmake --preset <ConfigurePreset> -S <SourceDirectory> -B <BuildDirectory>
`
`cmake --preset <ConfigurePreset> -S <SourceDirectory> -B <BuildDirectory>`
or during the build stage use
`
cmake --preset <BuildPreset> --build <BuildDirectory>
`
How this minimal example is used in a CMake workflow is shown in [.gitlab-ci.yml](../.gitlab-ci.yml)
Many further details can be found in the CMake documentation for presets [](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html)
\ No newline at end of file
`cmake --preset <BuildPreset> --build <BuildDirectory>`.
## Example
This recipe contains two configure presets as an example. The development preset can be selected like this,
`cmake --preset dev -S <SourceDirectory> -B <BuildDirectory>`. It uses `g++` as a compiler and enables compiler warnings.
If you build you will see a warning printed. In contrast, the `production` preset does not enable compiler warnings,
but optimization flags. A build with this configuration does not show warnings.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment