Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CMake Recipes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
training
CMake Recipes
Commits
62f773db
Commit
62f773db
authored
2 years ago
by
Sebastian Eibl
Browse files
Options
Downloads
Patches
Plain Diff
added description of presets
parent
3d5546a0
No related branches found
No related tags found
1 merge request
!5
add example for cmake presets
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
10_presets/README.md
+8
-8
8 additions, 8 deletions
10_presets/README.md
with
8 additions
and
8 deletions
10_presets/README.md
+
8
−
8
View file @
62f773db
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment