CMake Training
This CMake training covers in depth how CMake works and how to efficiently write CMake scripts for small to larger projects. The second part of the training covers advanced usage of CMake, and notably packaging with CPack, continuous integration with CDash and download, configure and build automatically project dependencies with ExternalProject.
This CMake training mixes theory and application with a set of tutorials and exercises.
Objectives
- Configure simple and complex projects with CMake
- Understand the basics of CMake (variables, cache, flow, etc.)
- Learn about the target centric modern approach
- Export and Import your CMake projects
- Automate your build using CMake features
- Create SuperBuilds that download, configure, build and install project dependencies
- Test and package libraries/applications with CTest and CPack
Prerequisites
C/C++ : Basic knowledge of the language and compilation process
Day 1
- Getting Started with CMake
- CMake history
- The advantages of CMake
- CMake major features and pipeline configuration
- CMake workflow
- IDE Integration
- Setup projects with CMake
- Starting a CMake project
- Pass flags and definitions to the compiler
- CMake variables and high-level commands
- Extend CMake functionalities with functions, macros and helper files
- Optimize builds with build configurations
- Use cache variables to configure the build
- CMake Modern Best Practices
- How to convert legacy CMake to modern CMake
- Best practices with the target-based approach
- Fine tuning of target properties propagation via dependencies
- Use presets to setup the environment of CMake by automatically setting environment variables or predefined CMake variables
Day 2
- Install and export
- Presentation of file sets to make headers and include directories management easier
- Prepare packaging and target export by setting install rules
- Export the targets of the project with aConfigModule
- Import the exported targets with find_package
- Build automation
- Use pre-defined variables to change how and where files are generated
- Run arbitrary commands at specific times of the configuration or build process
- Use CMake as a scripting engine to run cross-platform scripts
- System introspection and dependency finding
- Use try_compile and try_run features to get platform specific information on the target machine
- Use dedicated helper functions to facilitate the use of try_compile and try_run
- Understand what are FindModules and how to use them
- Write FindModules to import non CMake-compatible projects
- Understand how FindModules seek files in the host machine
- Writing unit tests with CTest
- Presentation of the tool handling unit tests: CTest
- Integration of CTest with other testing framework
- Packaging with CPack
- Introduction to the packaging tool: CPack (provided with CMake)
- Quickly and efficiently package applications on multiple platforms: Windows, Mac, Linux (Debian installers and Yum)
- Quick presentation of CDash: a web based testing dashboard
- Dealing with shared libraries
- Mixing library types
- Symbol visibility handling in MVSC
- Cross-compilation
- Introduction to cross-compilation with CMake
- Write toolchain-files to cross-compile for many different targets: microcontrollers, smartphones, different operating systems…
- Extra chapters – Covered if time permits it and depending on participants’ interests
- Speed up your compilations by integrating ccache
- CMake policies
- External Projects – Download, Patch, Configure, Build, Test and Install your dependencies automatically
- Presentation of the Conan package manager
- Create build configuration specific settings with generator expressions
- Conclusion
- Tips to maintain good code quality and debug your CMake scripts
- Quick look on CMake’s latest features
This training course will be taught in English. Course notes are also in English.
Participants are asked to bring a laptop computer for this training session.
The instructor will communicate all the specifications required to each participants before the training session.
Lunch is included.
Kitware SAS is registered as a training center in France
Practical Information
Duration: 2 days
Next training Date: March 30 & 31, 2026
Time zone: Paris (CET / GMT+1h)
Schedule: 9am to 5pm
Location: Online
Price: 1 560€
Company Training
All our training can be offered on site with a custom agenda. Contact us for more information.
About the instructor

After obtaining his high school diploma, Alexy worked on personal projects for over two years.
As a passionate and dedicated programmer, Alexy managed to develop strong skills in C++.