CMake Reference
This page documents the project-specific CMake configuration from
CMakeLists.txt and CMakePresets.json.
Recommended: workflow-first builds
Use workflow presets as the default entry point. They run the expected configure/build/test sequence and reduce manual flag drift.
# Release builds
cmake --workflow --preset build-release-default
cmake --workflow --preset build-release-omp
# Test, Python interface, and docs
cmake --workflow --preset build-and-test-release
cmake --workflow --preset build-and-test-debug
cmake --workflow --preset build-python-interface
cmake --workflow --preset build-docs
# Benchmarks (builds and runs KDTree_time)
cmake --workflow --preset build-and-test-benchmarks
Project Options
Option |
Default |
Description |
|---|---|---|
|
|
Build the |
|
|
Build the core C++ library target |
|
|
Build the nanobind module |
|
|
Enable install rules for the Python interface/package. |
|
|
Build unit tests (target |
|
|
Force fetching GoogleTest even if a local install exists. |
|
|
Build Sphinx/Doxygen documentation. |
|
|
Build benchmark executable |
|
|
Build example executables for showing usage. |
|
|
Enable include-what-you-use integration during compilation. |
|
|
Backend for Thrust host/device path: |
|
|
Active logging level: |
BUILD_KD_TREE_LIBRARY is a dependent option and is forced ON when
the executable or tests are enabled.
BUILD_KD_TREE_TIME_MEASUREMENT is OFF in test-release/test-debug,
so the default test workflows don’t compile the benchmark executable on every
push. It’s built and exercised separately via release-debug-symbols /
build-and-test-benchmarks.
Standard CMake Variables
Variable |
Description |
|---|---|
|
Used for single-config generators (for example Ninja).
Presets set |
Presets Overview
Configure presets (from CMakePresets.json):
Preset |
Inherits |
Main purpose |
|---|---|---|
|
|
Standard release build (CPP backend). |
|
|
Debug build, |
|
|
Release build with OpenMP backend. |
|
|
Test build in Release with |
|
|
Test build in Debug with |
|
|
Python interface (CPP backend), CLI off. |
|
|
Python interface with OpenMP backend. |
|
|
Docs-only configure preset. |
|
|
|
Build presets:
release,debug,release-omptest-release,test-debugpython-cpp,python-ompdocs-build(build target:Sphinx)release-debug-symbols
Test presets:
test-releasetest-debugtest-release-debug-symbols
Workflow presets:
build-release-defaultbuild-release-ompbuild-and-test-releasebuild-and-test-debugbuild-and-test-benchmarksbuild-python-interfacebuild-docs
Typical Commands
Preferred: run workflows directly:
# cmake --workflow --preset <preset-name>
cmake --workflow --preset build-release-default
cmake --workflow --preset build-release-omp
cmake --workflow --preset build-and-test-release
cmake --workflow --preset build-and-test-debug
cmake --workflow --preset build-and-test-benchmarks
cmake --workflow --preset build-python-interface
cmake --workflow --preset build-docs
Alternative: manual configure/build (only when custom flags are needed):
cmake -S . -B build/custom -DCMAKE_BUILD_TYPE=Release -DKD_TREE_PARALLELIZATION=OMP -DKD_TREE_LOGGING_LEVEL=INFO -DBUILD_KD_TREE_EXECUTABLE=ON -DBUILD_KD_TREE_TESTS=OFF
cmake --build build/custom