CMake is a cross-platform, open-source build system generator that produces native build files for multiple toolchains and operating systems.
CMake solves the problem of managing complex build configurations across diverse platforms and compilers. Rather than writing platform-specific makefiles or build scripts, developers write CMakeLists.txt files using CMake's declarative language. CMake then generates the appropriate native build system files—makefiles, Visual Studio projects, Xcode workspaces, or Ninja files—for the target platform. This approach eliminates the need to maintain separate build logic for Windows, macOS, Linux, and other supported systems.
CMake suits projects of any scale that need to build on multiple platforms or with multiple compilers. It is particularly valuable for C and C++ projects, though it supports other languages. Teams should adopt it when they need a single, maintainable build description that works across Windows, macOS, Linux, FreeBSD, OpenBSD, Solaris, AIX, and other UNIX-like systems. The tool is especially useful for libraries and frameworks that must be portable, and for projects where developers work on different operating systems.
The project is maintained and supported by Kitware and developed in collaboration with a community of contributors. The codebase is written in C and can be built either with an existing CMake installation or bootstrapped from source using a provided script. The project includes a comprehensive test suite that can be run with ctest, and documentation can be built with Sphinx when configured appropriately. CMake runs on all major operating systems and can be built from source on UNIX-like systems with a C++11 compiler and make, or on Windows with MSVC or MinGW under MSYS2.