Using build containers with CMake
Containerization brings the benefit that developers can control the build environment to some extent. Containerized build environments are also a tremendous help for setting up CI environments. There are quite a few container runtimes out there, with Docker being the most popular. It would exceed the scope of this book to look at containerization in depth, so we will use Docker for the examples in this book.
A build container contains a fully defined build system including CMake and any tools and libraries needed to build a certain software. By providing the container definition (for example, the Dockerfile), along with the project, or over a publicly accessible container registry, anyone can use the container to build the software. The huge advantage is that developers do not need to install and possibly pollute their host machine by installing additional libraries or tools except the software needed to run the containers. The downside is that...