Instructor’s guide

Learning outcomes

  • Write a CMake build system for C, C++, and Fortran projects producing libraries and/or executables.

  • Run tests for your code with CTest.

  • Ensure your build system will work on different platforms.

  • Detect and use external dependencies in your project.

  • Safely and effectively build mixed-language projects (Python+C/C++, Python+Fortran, Fortran+C/C++)

Third iteration

We decided to:

  • Move the Detecting your environment episode under the “Additional topics” header. We had to skip due to lack of time in the previous iteration.

Day 1 - Thursday 1 September 2022

9:00 - 9:10

Welcome and introduction to the training course

9:10 - 9:40

From sources to executables

9:40 - 9:45

Break

9:45 - 10:25

CMake syntax

10:25 - 10:35

Break

10:35 - 11:15

Creating and running tests with CTest

11:15 - 11:25

Break

11:25 - 12:05

Probing compilation, linking, and execution

12:05 - 12:10

Break

12:10 - 12:30

Wrap-up

Day 2 - Friday 2 September 2022

9:00 - 9:10

What did we cover yesterday?

9:10 - 9:50

Target-based build systems with CMake

9:50 - 10:00

Break

10:00 - 10:30

Finding and using dependencies

10:30 - 10:35

Break

10:35 - 11:15

Automated dependency handling with FetchContent

11:15 - 11:25

Break

11:25 - 12:00

Mixing Python and compiled languages

12:00 - 12:10

Break

12:10 - 12:30

Using CMake: tips and tricks

12:30 - 13:00

Using CMake: tips and tricks

Second iteration

We decided to:

Day 1 - Monday 29 November 2021

  • The flow in CMake syntax was not great due to the fact that I (@robertodr) had not double-checked carefully after rearranging the exercises.

  • We had to skip the Detecting your environment episode due to lack of time. This will be moved to “Additional topics” in the next iterations.

9:00 - 9:10

Welcome and introduction to the training course

9:10 - 9:40

From sources to executables

9:40 - 9:45

Break

9:45 - 10:15

CMake syntax

10:15 - 10:25

Break

10:25 - 10:55

Creating and running tests with CTest

10:55 - 11:00

Break

11:00 - 11:30

Detecting your environment

11:30 - 11:40

Break

11:40 - 12:10

Probing compilation, linking, and execution

12:10 - 12:15

Break

12:15 - 12:30

Wrap-up

Day 2 - Tuesday 30 November 2021

9:00 - 9:10

What did we cover yesterday?

9:10 - 9:50

Target-based build systems with CMake

9:50 - 10:00

Break

10:00 - 10:40

Finding and using dependencies

10:40 - 10:50

Break

10:50 - 11:30

Automated dependency handling with FetchContent

11:30 - 11:40

Break

11:40 - 12:10

Mixing Python and compiled languages

12:10 - 12:15

Break

12:15 - 12:45

Using CMake: tips and tricks

12:45 - 13:00

Wrap-up

First iteration

Day 1 - Tuesday 9 February 2021

9:00 - 9:10

Welcome and introduction to the training course

9:10 - 9:40

From sources to executables

9:40 - 9:45

Break

9:45 - 10:15

CMake syntax

10:15 - 10:25

Break

10:25 - 10:55

Creating and running tests with CTest

10:55 - 11:00

Break

11:00 - 11:30

Detecting your environment

11:30 - 11:40

Break

11:40 - 12:10

Probing compilation, linking, and execution

12:10 - 12:15

Break

12:15 - 12:30

Wrap-up

Day 2 - Wednesday 10 February 2021

We allocated 40 minutes to each of the Target-based build systems with CMake, Finding and using dependencies, Mixing C++ and Fortran episodes, with short breaks during the exercises in the breakout rooms. The Automated dependency handling with FetchContent episode can be skipped in case contents from Day 1 spill over to Day 2.

9:00 - 9:10

What did we cover yesterday?

9:10 - 9:50

Target-based build systems with CMake

9:50 - 10:00

Break

10:00 - 10:40

Finding and using dependencies

10:40 - 10:50

Break

10:50 - 11:30

Mixing C++ and Fortran

11:30 - 11:40

Break

11:40 - 12:10

Automated dependency handling with FetchContent

12:10 - 12:15

Break

12:15 - 12:30

Wrap-up