Skip to content

Add Support for CMake Presets Version 11#4846

Open
hanniavalera wants to merge 3 commits intomainfrom
dev/hanniavalera/bumpVersion
Open

Add Support for CMake Presets Version 11#4846
hanniavalera wants to merge 3 commits intomainfrom
dev/hanniavalera/bumpVersion

Conversation

@hanniavalera
Copy link
Copy Markdown
Contributor

Summary

Adds support for CMake Presets version 11, introduced in CMake 4.3. The only schema change from v10 is that execution.jobs in test presets can now be an empty string, equivalent to passing --parallel with no value (letting CTest auto-detect the job count).

Changes

Schema & validation

  • New CMakePresets-v11-schema.json - copy of the v10 schema with testPresets.execution.jobs widened to accept either an integer or an empty string (anyOf [integer, string with maxLength: 0]).
  • presetsParser.ts - bumped maxSupportedVersion from 10 → 11; added explicit v10 routing so the v11+ fallthrough uses the new schema.
  • package.json - updated jsonValidation entries for CMakePresets.json and CMakeUserPresets.json to reference the v11 schema.

Runtime behavior

  • preset.ts - testArgs(): when execution.jobs is an empty string, pushes only --parallel (no value). When it's a number, behavior is unchanged (--parallel <N>).

Tests

  • validation.test.ts - added two new test cases:
    • v10: validates that graphviz (added in v10) is accepted on v10 and rejected on v9.
    • v11: validates that an empty-string execution.jobs is accepted on v11 and rejected on v10.

Docs

  • cmake-presets.md - updated supported version range to "version 2 through 11".
  • CHANGELOG.md - added entry under Features.

Testing

  • yarn run compile - clean build, no errors.
  • npx tsc -p test.tsconfig.json --noEmit - test project type-checks cleanly.
  • New validation tests cover both the accept and reject paths for v10 and v11 schema changes.

Hannia Valera added 3 commits March 27, 2026 10:12
- Increased max supported version from 10 to 11 in presetsParser.
- Added schema handling for version 11 in presetsParser.
- Introduced integration tests for version 10 and version 11 CMake presets.
- Validated support for `$comment` and `graphviz` in version 10.
- Confirmed rejection of `graphviz` in version 9.
- Validated support for `jobs` field as an empty string in version 11.
- Confirmed rejection of empty string `jobs` in version 10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant