what's cmake
- CMakeLists.txt
cmake PATH
orccmake PATH
generateMakefile
- make
example for one file
In the fold Demo1
makeup CMakeLists.txt
1 | # Version |
complie project
cmake .
example for multi-files
1 | ./Demo2 |
1 | # VERSION |
1 | aux_source_directory(<dir> <variable>) |
1 | ./Demo3 |
1 | cmake_minimum_required (VERSION 2.8) |
complile options
1 | cmake_minimum_required (VERSION 2.8) |
install and test
add_test
support gbd
1 | set(CMAKE_BUILD_TYPE "Debug") |
evironment check
CheckFunctionExists
version
1 | set (Demo_VERSION_MAJOR 1) |
install package
1 | include (InstallRequiredSystemLibraries) |
move to cmake
- autotools
- am2cmake
- qmake
- qmake converter
- visual studio