Build systems and tooling

This part of the C++ course makes the build reproducible. A Makefile comes first: targets, prerequisites and the pattern rule that rebuilds only what changed. CMake generates the build, a target carries its includes and its language level, and CTest runs the tests the target holds. The part ends on a Debug, Release and sanitizer variant, an imported library found by find_package, and a static and a shared library linked into one program.

9.1 Make a first Makefile, targets, prerequisites, recipes and make that rebuilds only what changed Open 9.2 Make variables and pattern rules variables, automatic variables, a pattern rule for .cpp to .o and a clean target Open 9.3 CMake CMakeLists.txt, configure, build, the build directory and an executable target Open 9.4 CMake targets and libraries add_library, target_include_directories, target_compile_features and a test executable Open 9.5 CTest enable_testing, add_test, ctest output and a failing test that is reported Open 9.6 Debug, Release and sanitizer builds CMAKE_BUILD_TYPE, optimisation flags, assertions and a build with AddressSanitizer Open 9.7 find_package and linking libraries find_package(Threads), imported targets, target_link_libraries and a library that is not found Open 9.8 Static and shared libraries ar, a .so with -fPIC, the linker search path and a program that loads both Open

Lessons