How kitware/cmake works
CMake is a cross-platform build-system generator. The principal workflow is that a project author supplies CMake language files and configuration options; CMake configures project state, then emits build files for a selected native build tool. The repository also contains CTest’s test and reporting functionality, CPack’s package generators, and GUI front ends. Paths and capabilities are supported by the supplied tree and README; sampled headers are partial, so internal call wiring beyond the primary workflow is intentionally limited.
Main entry points: cmCommands.h CMake language · cmGlobalGenerator.h Build generators · cmcmd.h CMake CLI · cmCTest.h CTest runner
Components 19
Configure project
- CMake CLI
Source/cmcmd.h - CMake language
Source/cmCommands.h - Project state
Source/cmState.h - Configure cache
Source/cmCacheManager.h - Dependency discovery
Source/cmFindPackageCommand.h - Target model
Source/cmTarget.h
Build generation
- Build generators
Source/cmGlobalGenerator.h - Ninja generator
Source/cmGlobalNinjaGenerator.h - Make generators
Source/cmGlobalUnixMakefileGenerator3.h - IDE generators
Source/cmGlobalVisualStudioGenerator.h
Test and package
- CTest runner
Source/cmCTest.h - Test execution
Source/CTest/cmCTestTestHandler.h - Coverage reporting
Source/CTest/cmCTestCoverageHandler.h - CPack packaging
Source/CPack/cmCPackGenerator.h - Package formats
Source/CPack/cmCPackRPMGenerator.h
User interfaces
- Qt configure GUI
Source/QtDialog/QCMake.h - Terminal configure UI
Source/CursesDialog/cmCursesMainForm.h
Other components
- Project author
- Native build tool
Connections 21
- Project author → CMake CLI: provides project
- CMake CLI → CMake language: evaluates scripts
- CMake CLI → Configure cache: loads options
- CMake language → Project state: updates state
- CMake language → Dependency discovery: invokes discovery
- CMake language → Target model: defines targets
- Project state → Build generators: supplies project state
- Configure cache → Project state: persists options
- Build generators → Ninja generator: selects generator
- Build generators → Make generators: selects generator
- Build generators → IDE generators: selects generator
- Ninja generator → Native build tool: writes build files
- Make generators → Native build tool: writes build files
- IDE generators → Native build tool: writes project files
- Project author → CTest runner: runs tests
- CTest runner → Test execution: dispatches tests
- CTest runner → Coverage reporting: dispatches coverage
- Project author → CPack packaging: requests package
- CPack packaging → Package formats: generates package
- Project author → Qt configure GUI: configures project
- Project author → Terminal configure UI: configures project