Repository navigation
Conversation
- `CMakeBuild` and `CMakeInstall` now always put the binary directory directly after `--build` or `--install`
- Before, it followed the order of the setter calls, so `EnableVerbose().SetOutputDirectory("out")` produced `cmake --build --verbose out`, which CMake rejects
- Remove the `default` values from `CMake.json`. The generator ignores this field, so `CMakeGenerate()` never passed `-G`, `-A`, `-S` or `-B` by itself, and the values only made the spec misleading - Fix help texts that described the wrong option, such as `CMakeGenerateSettings.OutputDirectory` and `CMakeInstallSettings.Configuration` - Escape the angle brackets in the help of `Define`, which caused CS1570 warnings in the generated XML docs - Add a spec that empty generate settings pass no arguments
- Add `Ninja Multi-Config`, `Unix Makefiles`, `NMake Makefiles` and `MinGW Makefiles` to `CMakeGenerator`
- Add `Preset` (`--preset`) and `PresetsFile` (`--presets-file`, CMake 4.4 or later) to `CMakeGenerateSettings` and `CMakeBuildSettings` - Values set on the settings are still passed, so CMake applies them over the values from the preset - The help of `CMakeBuildSettings.OutputDirectory` says not to combine it with `Preset`
- Add the `CMakeWorkflow` task for `cmake --workflow`, with `Preset`, `PresetsFile` (CMake 4.4 or later) and `Fresh` - It uses `--preset <name>`, which CMake supports since 3.25, instead of the shorter form that needs CMake 3.31
- Add `CTestTasks.CTest` for the `ctest` executable, covering the options for running tests: presets, test directory, configuration, parallel runs, output, filters, repeats, timeouts and JUnit reports - `Configuration` uses `CMakeConfiguration` from the CMake wrapper - Dashboard, script and `--build-and-test` modes are not included
- Add CMake and CTest to the table of supported tools in the CLI tools docs. CMake was missing since its wrapper was added
Illustar0
force-pushed
the
feat/cmake-presets-ctest
branch
from
November 16, 2026 07:50
17b1c31 to
e7d8159
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #725
Add preset and workflow support to the CMake wrapper, and add a CTest wrapper. Builds that use
CMakePresets.jsonno longer need to callcmakeandctestwith raw argument strings.Also, this PR doesn't introduce any breaking changes. I found that the tool generator actually ignores the
defaultfield in tool specs, so the CMake wrapper has never passed-G "Visual Studio 16 2019" -A x64 -S . -B ./outor any of the other defaults. EmptyCMakeGenerateSettingsproduce no arguments at all. Removing these defaults therefore changes nothing.What changed
CMakeGenerateandCMakeBuildgetPreset(--preset) andPresetsFile(--presets-file, CMake 4.4 or later).CMakeWorkflowtask forcmake --workflow --preset <name>.CTesttool wrapper (CTestTasks.CTest) for running tests: presets, test directory, configuration, parallel runs, output, filters, repeats, timeouts and JUnit reports. Dashboard, script and--build-and-testmodes are not included.CMakeBuildandCMakeInstallnow always pass the binary directory right after--buildor--install. Before,EnableVerbose().SetOutputDirectory("out")producedcmake --build --verbose out, which CMake rejects.CMakeGeneratorgetsNinja Multi-Config,Unix Makefiles,NMake MakefilesandMinGW Makefiles.CMake.jsonno longer hasdefaultvalues, and wrong help texts are fixed. CMake and CTest are now listed in the CLI tools docs.Example