Differences between revisions 3 and 6 (spanning 3 versions)
Revision 3 as of 2023-01-08 20:49:50
Size: 993
Comment:
Revision 6 as of 2025-12-19 21:40:36
Size: 1285
Comment: Pruning dead links
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

'''`cmake(1)`''' is a build system generator. It is used alongside/over build systems including [[Make|make(1)]].
Line 11: Line 13:
Most operating systems offer a `cmake` package. All [[Linux]] and [[BSD]] distributions offer a `cmake` package.
Line 43: Line 45:
----



== See also ==

[[https://cmake.org/cmake/help/latest/|CMake reference documentation]]

[[https://man.archlinux.org/man/cmake.1|cmake(1)]]

CMake

cmake(1) is a build system generator. It is used alongside/over build systems including make(1).


Installation

All Linux and BSD distributions offer a cmake package.


Usage

Using a CMakeLists File

The CMakeLists.txt file defines targets to be built.

First, create a build folder to run cmake(1) within. A large number of cache, header, and build files will be created. Generally the build folder is used for this.

Second, try:

cmake ..

If there are multiple targets, there may be additional arguments required.

Finally, run the generated build pipeline. For Linux this will typically be a Make.

Options

It is common to see the -DCMAKE_BUILD_TYPE=Release option in use. This can have unintended consequences on the compilation step. Operating systems such as Arch Linux prescribe specific C and C+ build flags that will be overridden by this option.


See also

CMake reference documentation

cmake(1)


CategoryRicottone

CMake (last edited 2025-12-19 21:40:36 by DominicRicottone)