CMake Tutorial
●
1 – Introduction to CMake
●
2 – Using CMake for the ILC Software
●
3 – ILCInstall with CMake
Jan Engels
DESY
20th September 2007
Jan Engels - Introduction to CMake 2
What is CMake
●
CMake:
–
Generates native build environments
●
UNIX/Linux -> Makefiles
●
Windows -> VS Projects/Workspaces
●
Apple -> Xcode
–
Open-Source :)
–
Cross-Platform
Jan Engels - Introduction to CMake 3
CMake Features
●
CMake has a lot of nice features:
–
Manage complex, large build environments (KDE4)
–
Very Flexible & Extensible
●
Support for Macros
●
Modules for finding/configuring software (bunch of modules already available)
●
Extend CMake for new platforms and languages
●
Create custom targets/commands
●
Run external programs
–
Very simple, intuitive syntax
–
Support for regular expressions (*nix style)
–
Support for “In-Source” and “Out-of-Source” builds
–
Cross Compiling
–
Integrated Testing & Packaging (Ctest, CPack)
Jan Engels - Introduction to CMake 4
Build-System Generator
CMake
Native Build System
Native Build Tools
Executables / Libraries
CMakeLists.txt
Jan Engels - Introduction to CMake 5
CMake 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)
- 1
- 2
前往页