C++
developers, architects
2-9 days
lecture
workshop

C++ did not have a sound and widely adopted build system and dependency manager for many years. What we had was considered messy, complex, and limited. The situation has changed with the introduction of Modern CMake and Conan package manager. Both of the tools are free and open-sourced.

CMake is the de-facto standard for C++. It is widely supported by nearly all IDEs and, together with the Ninja generator, delivers probably the fastest build times for large C++ projects. A "Modern CMake" is a subset of old CMake features with the addition of so-called "targets". It equips our projects with easy-to-create, maintain, and build systems.

Conan is a dependency and package manager specifically designed and optimized for accelerating the development and Continuous Integration of C and C++ projects. It can build from a source and perform full binary management. Thanks to that, it can create and reuse any number of different binaries for different configurations and versions of a package, using the same process on all platforms. As it is decentralized, running your server to host your packages and binaries privately without sharing them is easy. Those features make Conan an excellent solution for enterprise needs.

We will use the gitpod.io service for the workshop exercises. CMake, C++ compilers, and other tools will be preinstalled on the Docker image, so there is no need to prepare any special environment for the training.

The training is recommended to all C++ developers and architects. It should be considered mandatory for those who develop or distribute C++ library projects.

Note: This subject is much broader and more detailed than one might initially imagine. We have over 1200 slides of materials and 35+ hands-on workshop tasks to address the agenda. Delivering the entire training scope in just one week is impossible. We strongly recommend cutting it into smaller pieces and taking those in a more extended time (e.g., two 4-day trainings within one or two months).

TRAINING HIGHLIGHTS

  • Understanding of the issues with legacy CMake approach and dependency management
  • Emphasis on Modern CMake, libraries encapsulation, and transitivity
  • Realizing how Conan can improve dependencies handling and package management in your organization

TRAINING AGENDA

The following plan is an initial proposal for the training material. The final agenda is always created based on the individual pre-training analysis of the client's requirements and constraints.

  1. Modern Project Structure
    1. How To Handle Dependencies?
    2. Robust Project Structure
    3. In-source Vs Out-of-source builds
  2. Modern CMake (4-5 days)
    1. Command Line, Generators, and Build Types
    2. A Minimal Project
    3. Targets, Aliases, Encapsulation, And Transitivity
    4. Properties
    5. Subdirectories
    6. Generator Expressions
    7. Testing Support
    8. Installing And Finding Dependencies
    9. Custom Tasks
    10. Version Number and Configured Header Files
    11. Variables
    12. Flow control
    13. Scope
    14. Functions, Macros, And Argument Handling
    15. Math, Strings, and Lists
    16. Modules
    17. Toolchains And Cross-Compiling
    18. Presets
    19. Project Installation
    20. Debugging And Diagnostics
    21. External Content
  3. Advanced CMake (1-2 days)
    1. Policies
    2. Custom Build Types
    3. Checking Existence and Support
    4. Invoking Arbitrary Code
    5. Forwarding Command Arguments
    6. Custom Tasks (Configure Stage)
    7. Specifying Version Details
    8. Libraries
    9. Finding Things
    10. Find Modules
    11. External Content
    12. Packaging
    13. Build Performance
    14. Working With Files
  4. Conan (2 days)
    1. Conan Environment
    2. Basic Command Line Usage
    3. Building and Installing Dependencies
    4. Versioning and Lock Files
    5. Deployers and Generators
    6. Profiles, Settings, Options, Configuration Parameters
    7. Sharing Conan Configuration
    8. Build and Host Environments (cross-compilation)
    9. Conan Recipes
    10. Using Conan to Configure, Build, and Test Your Project
    11. Different Ways to Package a Project
    12. ABI Compatibility
    13. Conan Graph and Transitivity of Package Traits
    14. Editable Mode
C++
developers, architects
2-9 days
lecture
workshop

Trainer

Mateusz Pusz
FOUNDER / C++ TRAINER
Active Voting WG21 Member and Contributor to the C++ Standard