CMake Note

CMake Note

Basic Concepts

CmakeLists.txt

Input text files that contain the project parameters and
describe the flow control of the build process in simple CMake language.

CMake Modules

Special cmake file written for the purpose of finding a certain piece of software and to set it’s libraries, include files and definitions into appropriate variables so that they can be used in the build process of another project. (e.g. FindJava.cmake, FindZLIB.cmake, FindQt4.cmake)

When CMake finds a SUBDIR command it stops processing the current file immediately and goes down the tree branch

Using CMake

Create a build directory

1
2
mkdir build 
cd build

Configure

1
cmake [options] <source_tree>

Build

1
make

Install

1
make install
Contents
  1. 1. CMake Note
    1. 1.1. Basic Concepts
      1. 1.1.1. CmakeLists.txt
      2. 1.1.2. CMake Modules
    2. 1.2. Using CMake
      1. 1.2.1. Create a build directory
      2. 1.2.2. Configure
      3. 1.2.3. Build
      4. 1.2.4. Install