Ceci est une ancienne révision du document !
Introduction to CMake
CMake is an extensible, open-source system that manages the build process in an operating system and in a compiler-independent manner.
Using CMake with executables
Lets assume we have a simple application with a single main.c file.
We create a CMakeLists.txt file in the root of our project:
cmake_minimum_required(VERSION 2.8) project(app_project) add_executable(myapp main.c) install(TARGETS myapp DESTINATION bin)
Thats all we need to be able to build our application.
cmake_minimum_requiredbuild requires version 2.8 or greater of cmakeprojectdefines unique project nameadd_executabledefines our binary with all linked source filesinstalltells cmake to install our binary into thebindirectory of the install directory