Generated by GPT-5-mini| CMake | |
|---|---|
| Name | CMake |
| Developer | Kitware |
| Released | 2000 |
| Programming language | C++ |
| Operating system | Cross-platform |
| License | BSD-style |
CMake CMake is a cross-platform, open-source build-system generator widely used for managing the build process of software projects. It coordinates compilation, linking, testing, and packaging by producing native build files for tools such as GNU Compiler Collection, Microsoft Visual Studio, Xcode and Ninja. CMake is maintained by Kitware and employed by major projects and organizations for portable build automation.
CMake orchestrates build configuration by reading declarative scripts and generating platform-specific build artifacts for systems like Linux, Windows, macOS, and embedded targets. It interacts with toolchains and compilers such as GCC, Clang, MSVC and build drivers like Make (software), Ninja (build system), and GNU Autotools-based environments. CMake integrates with continuous integration platforms including Jenkins, Travis CI, GitHub Actions and GitLab CI/CD to enable reproducible builds and testing across diverse infrastructures.
CMake originated at Kitware in the late 1990s to support projects such as Insight Segmentation and Registration Toolkit and Visualization Toolkit. Early adopters included scientific and engineering projects in academia and industry, later expanding to commercial products developed by companies such as Google, Apple Inc. and Microsoft. Over successive releases the project introduced features like target-based commands, the Modern CMake idiom, and the File-based API inspired by integrations with IDEs like CLion and Visual Studio Code. Governance and contributions have involved contributors from organizations such as Los Alamos National Laboratory, Sandia National Laboratories, and corporate entities attending conferences such as C++Now and CppCon.
CMake provides commands and modules to declare build targets, set properties, and manage dependencies; core components include the CMake language parser, generator backends, toolchain files, and package discovery modules. Key features encompass target-oriented APIs, imported targets, generator expressions, and config-mode and module-mode package discovery used by projects like Boost (software), Qt (software), and LLVM. Packaging and testing integrate with CPack and CTest respectively, while scripting capabilities allow procedural logic similar to systems used in projects like Apache HTTP Server and Mozilla Firefox.
Typical workflows involve writing CMakeLists.txt at project roots, invoking cmake to configure a build directory, and using generated build files with native build tools such as Make (software), Ninja (build system), MSBuild or IDEs like Eclipse and Xcode. Developers often adopt out-of-source builds, use toolchain files for cross-compilation to targets supported by vendors like ARM Holdings and NVIDIA, and rely on CMake’s find_package to locate dependencies such as OpenSSL, zlib, Eigen (software), and Boost (software). Continuous integration frequently automates configure, build, test, and packaging steps through agents provided by CircleCI, Azure DevOps and TeamCity.
CMake supports many programming languages including C (programming language), C++, Fortran (programming language), Objective-C, and CUDA for heterogeneous computing on GPUs from vendors like NVIDIA. Cross-platform support enables targets on server platforms from Red Hat Enterprise Linux to desktop distributions like Ubuntu and workstation environments such as Microsoft Windows 10 and macOS Big Sur. Toolchain customization and platform modules assist in targeting embedded ecosystems from vendors like STMicroelectronics and Texas Instruments.
CMake integrates with IDEs and editor ecosystems including Visual Studio, CLion, Visual Studio Code and Xcode via project file generation or language-server protocols used by clangd and Microsoft Language Server Protocol. It interoperates with package managers and dependency systems such as Conan (software), vcpkg, Homebrew, and apt (software)-based packaging workflows. Build acceleration and analysis tools—examples include ccache, distcc, and Google Cloud Build—are commonly combined with CMake-driven pipelines.
Critics note the domain-specific language can be idiosyncratic compared with declarative systems used by projects like Bazel and Buck (build system), and debugging complex scripts can be challenging for contributors from communities around Autotools or SCons. Historically, backward compatibility and inconsistent module quality prompted migration pains for projects including KDE and OpenCV, and platform-specific generator behaviors can complicate reproducibility across environments such as Windows Server and mixed UNIX fleets. Performance of large builds and incremental configuration remains a point of comparison with build systems used by Google and other hyperscale organizations.
Category:Build automation tools