Most users start with configurePresets and buildPresets . Below is a real‑world CMakePresets.json for a C++ project supporting Linux (GCC/Clang), Windows (MSVC), and macOS.
You can inherit from a hidden base, then from another preset, and finally override specific variables. Condition on build type "condition": "type": "equals", "lhs": "$envCI", "rhs": "true" cmakepresets.json example
"buildPresets": [ "name": "dev-linux-gcc", "inherits": "default", "configurePreset": "dev-linux-gcc" ] When you run cmake --build --preset dev-linux-gcc , CMake automatically uses the binary directory from the corresponding configure preset. List available presets cmake --list-presets Output: Most users start with configurePresets and buildPresets