Introduction
Explore the concept of targets in CMake and how they provide a structured way to partition C++ projects. Understand why project partitioning matters, how CMake manages build dependencies, and how targets produce various build artifacts. This lesson introduces writing custom commands and using generator expressions to simplify complex build processes.
We'll cover the following...
The most basic target we can build in CMake is a single binary executable file that encompasses an entire application. It can be made out of a single piece of source code, such as the classic helloworld.cpp. Or it can be complex—built with hundreds or even tens of thousands of files. This is what many beginner projects look like: create a binary with one source file, add another, and, before you know it, everything is linked to a single binary without any structure whatsoever.