Cmakepresets.json Example Jun 2026
Use $env... to check environment variables – perfect for CI/CD.
Defines the generator, binary directory, and cache variables (the cmake -S . -B build step).
"environment": "CCACHE_DIR": "$sourceDir/.ccache" cmakepresets.json example
,
], "testPresets": [
,
For CI/CD pipelines (e.g., GitHub Actions, GitLab CI), CMakePresets.json is invaluable. The pipeline script becomes simplified and declarative: Use $env
cmake --build --preset dev-linux-gcc