CMake Training for embedded software

This CMake training is specially targeted to embedded software developers who want to learn how to efficiently write CMake scripts for cross-compiled projects.

The training starts by covering the basics of CMake, and will evolve towards good practices and modern concepts to make projects more modular and maintainable.
The second day revolves around more automation of the project, from managing dependencies, to locating and setting the toolchain automatically. The training also covers several ways to package libraries.

This CMake training mixes theory and application with a set of tutorials and hands-on exercises.

cmake training logo

Objectives

  1. Configure simple and complex projects with CMake
  2. Understand the basics of CMake (variables, cache, flow, etc.)
  3. Learn about the target centric modern approach
  4. Manage source and pre-built dependencies
  5. Create a toolchain file/preset file to cross-compile your applications/libraries
  6. Create SuperBuilds that download, configure, build and install project dependencies

Prerequisites

C/C++ : Basic knowledge

Day 1

  • Getting Started with CMake
    • CMake history
    • The advantages of CMake
    • CMake major features and pipeline configuration
  • Setup projects with CMake
    • CMake syntax: variables, cache usage, and workflow management
    • Starting a CMake project
    • Pass flags and definitions to the compiler
    • Extend CMake functionalities with functions, macros and helper files
    • Optimize builds with build configurations
    • Optimize library management
  • 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
    • Prepare packaging and target export by setting install rules
  • IDE Integration
    • Learn how to drive CMake from your IDE
    • Practical example with VSCode

Day 2

    • System introspection
      • Understand what are FindModules and how to use them
      • Write FindModules to import pre-built libraries and non CMake-compatible projects
      • Understand how FindModules seek files in the host machine
      • Use try_compile and try_run features to get platform specific information from the host machine
    • Use CMake to run arbitrary commands at specific times of the configuration or build process
      • Learn the difference between commands ran during configuration or during build
    • CMake Presets
      • Setup the environment of CMake to configure, build, test and package your project
      • Automatically set environment variables or predefined CMake variables
    • Conan package manager
      • Learn how to download pre-built dependencies from Conan
      • Drive CMake from Conan
      • Download your toolchain from Conan
    • Cross-compilation
      • Principles of cross-compilation
      • Write a toolchain file to cross-compile your application
      • Specificities of a cross-compiled CMake project
    • Packaging
      • Export and Import your CMake project (Config Modules)
      • Use Conan to create a package of your library
    • Extra chapters – Covered if time permits it and depending on participants’ interests
      • Speed up your compilations by integrating ccache
      • Packaging with CPack
        • Introduction to the packaging tool: CPack (provided with CMake)
        • Quickly and efficiently package applications/libraries on multiple platforms: Windows, Mac, Linux (Debian installers and Yum)
      • External Projects – Download, Patch, Configure, Build, Test and Install your dependencies automatically
      • CMake Policies
    • Conclusion
      • Tips to maintain good code quality and debug your CMake scripts

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
Time zone: Paris (CET / GMT+1h)
Schedule: 9am to 5pm
Location: Online
Price: 1 500€

Company Training

All our training can be offered on site with a custom agenda. Contact us for more information.

What a company training brings:
– Dedicated time for an efficient training, which allows teams to communicate on their compilation related problems.
– Exchange with an expert
– Every participant hears the same speech.
– You keep the training material.

About the instructor

Paul is an R&D engineer in the Software Solutions team. He has developed a great number of skills, ranging from web development (e.g. Girder, VTK, Cherrypy, Django, React and Vue.js), to C++ development with CMake.

His CMake experience, educational background, communicative skills and exhilarating eagerness to share his knowledge made him a natural CMake teacher.

On top of being a developer and a trainer, Paul also system administers KEU as well as sets up and maintains Continuous Integration/Development environments on multiple platforms and operating systems.

As part of his engineering degree at INSA Lyon, Paul spent a semester at University College Dublin, where he worked on biomedical signals and images processing. He also followed courses about research on cloud computing.

Prior to joining Kitware in 2019, Paul worked as a C++/Python developer for a start-up where he developed proofs-of-concepts for Connected Objects.