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/ch01.
To build the examples provided in this book, always execute all the recommended commands:
cmake -B <build tree> -S <source tree>
cmake --build <build tree>
Be sure to replace the placeholders <build tree>
and <source tree>
with the appropriate paths. As you will learn in this chapter, build tree is the path of your output directory, and source tree is the path at which your source code is located.
To build C++ programs, you also need a compiler appropriate for your platform. If you’re familiar with Docker, you can use a fully tooled image introduced in the Installing CMake on different platforms section. If you’d rather set up CMake manually, we’ll explain the installation in the same section.