“What sets CMake above its competitors: its extensive list of features.”

Bryce Adelstein Lelbach, the chair of the Standard C++ Library Evolution group.

There are a multitude of other features that are part of CMake. These are just a few of them.

Single source builds on multiple platforms

CMake allows developers to describe how to build simple and very complicated software systems with a single set of input files. This can be used to build the software on multiple platforms, from Android to iOS to High-Performance Computing systems.

Accurate dependencies and minimal rebuilds

CMake has accurate dependencies and allows for minimal rebuilds of only the code that has changed. It also supports Fortran and C++ modules.

Out-of-source builds

CMake allows for out-of-source builds and gives the ability to have multiple build trees per source tree.

Target-centric approach

Modern CMake allows the build to be specified as a set of targets (executables, libraries, custom commands). Each target defines what other targets it depends on directly. CMake then performs the build in the correct order and includes transitive link targets.

System introspection with a cache that allows the build environment to be captured

Each CMake build tree contains a cache file that contains variables that are set as part of that build. This includes everything found by system introspection, paths to installed software, and flags used for the build. Cmake contains several GUIs to allow the editing of this cache file.

Multiple target-build systems

CMake supports multiple target build systems, including Visual Studio, Xcode, ninja, make, and VSCode. It allows a project to use its most important resource, the developer, to their full potential. As CMake supports many popular IDE systems for C++ as well as command-line build tools, developers are able to choose the build tool that they are most productive with.

Cross-platform packaging system

CMake contains the CPack system, which allows the creation of cross-platform installers for Linux, Windows, and Mac.

Full cross-platform installation system

CMake contains a full cross-platform install system. With the same set of commands, a software package can be installed on Linux, Windows, and Mac.

Cross-platform testing system

CMake includes a full cross-platform testing system. The tests can be specified in the CMake source code of a project and run after the build is done. CTest is then used to run the tests. The results can be sent to CDash, and they can be run in parallel.

Custom commands

In addition to building the standard libraries and executables, CMake allows for arbitrary commands to be run at build time. This allows for the cross-platform integration of code-generating tools.

Configure header files

CMake allows for a project to configure header files for a build.

Export/import of targets

CMake can export and import targets from a build to allow the software to be reused.

Debugger Integration

CMake implements the Debug Adapter Protocol to interactively debug projects’ CMake code using third-party tools.

A CMake Built for You

Kitware can work with you to develop a CMake software build system that is tailored to your requirements.