Technical Requirements
You can find the code files that are present in this chapter on GitHub at https://github.com/PacktPublishing/Modern-CMake-for-Cpp-2E/tree/main/examples/ch10
The following toolchain utilities are required to try out examples in this chapter:
- CMake 3.26 or newer (3.28 recommended)
- Any of the supported generators:
- Ninja 1.11 and newer (Ninja and Ninja Multi-Config)
- Visual Studio 17 2022 and newer
- Any of the supported compilers:
- MSVC toolset 14.34 and newer
- Clang 16 and newer
- GCC 14 (for the in-development branch, after 2023-09-20) and newer
If you’re familiar with Docker, you can use a fully-tooled image introduced in the Installing CMake on different platforms section.
To build examples provided in this chapter use the following command:
cmake -B <build tree> -S <source tree> -G "Ninja" -D CMAKE_CXX_COMPILER=clang++-18 && cmake --build <build tree>
Be sure to replace placeholders <build tree>
and <source...