CMake "No such preset" / invalid CMakePresets.json in CI
CMake could not use the requested preset: the name does not exist in CMakePresets.json, or the file declares a preset schema version newer than the CMake on the runner supports.
What this error means
cmake --preset fails with "No such preset in CMakePresets.json: ci" or "Unrecognized \"version\" field", so configuration never starts.
cmake
CMake Error: No such preset in /home/runner/work/app/app:
ci-release
CMake Error: Could not read presets from /home/runner/work/app/app: Unrecognized
"version" fieldCommon causes
The preset name does not match the file
The --preset value has a typo or refers to a preset not defined in CMakePresets.json.
The preset schema version exceeds the runner CMake
CMakePresets.json declares a version newer than the installed CMake supports, so it cannot be read.
How to fix it
Use an existing preset name
- List available presets with
cmake --list-presets. - Pass a name that exists in CMakePresets.json.
- Keep CI and local preset names identical.
Terminal
cmake --list-presets
cmake --preset ci-releaseMatch the CMake version to the preset schema
Install a CMake new enough for the preset "version" field, or lower the field to a supported schema.
.github/workflows/ci.yml
- uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.28.3'How to prevent it
- Verify preset names with
cmake --list-presetsin CI. - Pin a CMake new enough for the CMakePresets.json schema version.
- Keep one preset file used by both local and CI builds.
Related guides
CMake "version X or higher is required" (cmake_minimum_required) in CIFix CMake "CMake X or higher is required. You are running Y" in CI - the runner CMake is older than the proje…
CMake "Could not find toolchain file" in CIFix CMake "Could not find toolchain file" in CI - the path passed to CMAKE_TOOLCHAIN_FILE does not exist on t…
CMake empty or wrong CMAKE_BUILD_TYPE in CIFix an empty or misspelled CMAKE_BUILD_TYPE in CI - single-config generators build unoptimized or with unexpe…