Preset reference#
CCCL ships its CMake configurations as presets in CMakePresets.json, using CMake’s
preset format. The file
defines 40+ presets covering each library, multiple C++ standards, special build
modes, and benchmarking.
Preset structure#
Each preset belongs to one of three sections:
configurePresetsset the configuration: enabled libraries, build type, CUDA architectures, C++ standard, and per-library options. Every configure preset inherits from the hiddenbasepreset, which selects the Ninja generator, Release mode,all-major-ccclarchitectures, and disables all libraries by default. A named preset enables the libraries and options it needs.buildPresetsreference a configure preset by name. Some pin an explicit target list; most build everything the configuration enables.testPresetsreference a configure preset and add CTest filters. Filters select a subset of tests by name regex. CUB launcher-mode presets and Thrust GPU/CPU splits are examples of this pattern.
A configure preset, its build preset, and its test preset share a name. Run all
three with the same <name>.
Listing available presets#
cmake --list-presets prints all configure presets:
cmake --list-presets
List build and test presets separately:
cmake --list-presets=build
cmake --build --list-presets
ctest --list-presets
Using a preset#
Configure, then build with the matching preset name:
cmake --preset cub-cpp17
cmake --build --preset cub-cpp17
Run the test preset of the same name with ctest:
ctest --preset cub-cpp17
Build output lands under build/<infix>/<presetName>/, where the infix comes from
the CCCL_BUILD_INFIX environment variable used for devcontainer isolation.
Distinct presets use distinct build directories and do not collide.