Differences between revisions 1 and 2
Revision 1 as of 2022-05-25 15:57:15
Size: 992
Comment:
Revision 2 as of 2022-08-22 12:14:26
Size: 991
Comment:
Deletions are marked like this. Additions are marked like this.
Line 41: Line 41:
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 [[Linux/ArchLinuxPackaging|Arch]] prescribe specific [[C/BuildFlags|C]] and [[[C++/BuildFlags|C+ build flags]] that will be overridden by this option. 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 [[Linux/ArchLinuxPackaging|Arch]] prescribe specific [[C/BuildFlags|C]] and [[C++/BuildFlags|C+ build flags]] that will be overridden by this option.

CMake


Installation

Most operating systems 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 prescribe specific C and C+ build flags that will be overridden by this option.


CategoryRicottone

CMake (last edited 2023-04-04 15:10:18 by DominicRicottone)