Cmake

From ScientificComputing
Jump to: navigation, search

Category

Development, Buildsystem

Description

CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.

Available versions

Legacy versions Supported versions New versions
2.8.12, 3.3.1, 3.5.2 3.11.4, 3.9.2

Environment modules

Version Module load command Additional modules loaded automatically
2.8.12 module load gcc/4.8.2 cmake/2.8.12
3.3.1 module load gcc/4.8.2 cmake/3.3.1
3.5.2 module load gcc/4.8.2 cmake/3.5.2
3.11.4 module load new gcc/4.8.2 cmake/3.11.4
3.9.2 module load new gcc/4.8.2 cmake/3.9.2

Interactive session

You can run CMake either in an interactive or batch mode. For running in interactive mode, you first need to create a build directory and afterwards you can start the CMake graphical user interface (GUI) with the ccmake command.
[leonhard@euler01 koenigsberg_bridge_code]$ module load new gcc/4.8.2 cmake/3.5.2
[leonhard@euler01 koenigsberg_bridge_code]$ mkdir build
[leonhard@euler01 koenigsberg_bridge_code]$ cd build
[leonhard@euler01 build]$ ccmake ..

In the CMake GUI, you can perform several commands with keyboard short cuts

Key Description
c configure installation
t toggle advanced mode (shows all available variables)
g generate source code for compilation
After successfully running the CMake GUI, you can compile the code with the command make

License information

OSI-approved BSD 3-clause License

Links

https://cmake.org/

https://github.com/Kitware/CMake
https://en.wikipedia.org/wiki/CMake