Să aplici modern CMake (bazat pe targets) pentru a configura, construi, testa și package proiecte C++ curat și repetabil.
Vei înțelege generatorii (Ninja, Makefiles), toolchain‑urile și policies; vei scrie find_package
corecte și vei exporta targets reutilizabile.
Vei gestiona dependențe externe cu FetchContent
și ExternalProject
și vei integra testarea cu CTest/CDash.
Dobândești experiență practică prin laboratoare hands‑on (~70%) care reflectă proiecte reale.
Cum te ajută CMake: portabilitate între platforme/compilatoare, build‑uri reproductibile, grafuri clare de dependențe și packaging ușor în CI/CD cu CPack.
Cui i se adresează: conceput pentru persoane cu experiență în C++ sau C care vor să adopte practici moderne CMake în echipe de producție.
La final vei structura proiecte cu încredere, vei depana/troubleshoot‑ui CMake și vei aborda subiecte avansate (CUDA, MPI, cross‑compiling).
Curriculum
Welcome and setup
- Asigurarea setup‑ului de dezvoltare pentru C++ și CMake
- Basic CMake installation and setup
CMake introduction
- Prezentare de ansamblu și rolul CMake în sistemele moderne de build
- CMake’s major features and benefits
- Understanding the CMake workflow
- Source configuration
- Build system generation
- Build execution
CMake workflow
- CMake configuration workflow
- Writing your first CMakeLists.txt
- Configuring and generating a build system
- Running CMake from the command line and IDEs
- Understanding CMake generators (Makefiles, Ninja, etc.)
Building libraries and executables
- Defining and managing targets in CMake
- add_executable and add_library
- Linking libraries and dependencies
- target_link_libraries
- Variables in CMake: regular vs. cache variables
- Managing build configurations with CMake variables
- Overview of modern CMake’s target‑centric approach
- Best practices for building and organizing projects
- Compiler and compiler options specification
- Language standard specifications
- Detect and work with environment variables
- Detect and work with various CPU architectures
More CMake syntax
- CMake syntax and supported commands
- Control flow in CMake scripts (if, foreach, while)
- Using generator expressions ($<...>) for conditional logic
- Target properties and advanced target management
- Installing targets and creating installation rules
- Sfaturi și trucuri practice, hands‑on
Importing and exporting targets
- Creating exportable targets with install(EXPORT)
- Using find_package() and writing Config files
- Importing third‑party targets and managing dependencies
- Best practices for reusable and portable CMake configurations
External Project and FetchContent
- Introducere în managementul proiectelor externe în CMake
- Using ExternalProject_Add for building external dependencies
- Overview of FetchContent for simplifying dependency management
- Exemple practice și cazuri de utilizare
CMake’s policy system
- Understanding the CMake policy system
- Handling policy warnings and errors
- Adopting best practices for policy management
- Noteworthy changes from recent CMake releases
Debugging and profiling CMake scripts
- Debugging cu message() și cmake --trace
- Profiling al build‑urilor CMake pentru optimizarea performanței
- Înțelegerea și rezolvarea problemelor CMake frecvente
Companion tools and testing framework
- Writing and running tests with CTest
- Integrating test coverage and dynamic analysis tools
- Introduction to CDash for continuous integration and testing
- Overview of the packaging tool: CPack
- Exerciții practice cu CTest și CPack
Advanced topics in CMake
- CMake support for MPI (Message Passing Interface)
- Setting up and managing MPI projects
- CUDA support in CMake
- Building CUDA applications with CMake
- Cross compilation with CMake
- Setting up toolchains and cross‑compiling projects
- Fortran support in CMake
- Configuring and building Fortran projects
Structura zilei de curs
- Partea 1: 09:00–10:30
- Pauză cafea: 10:30–10:45
- Partea 2: 10:45–12:15
- Pauză de prânz: 12:15–13:15
- Partea 3: 13:15–15:15
- Pauză cafea: 15:15–15:30
- Partea 4: 15:30–17:30