5
Working with Targets
The entire application in CMake can be built from a single source code file (such as the classic helloworld.cpp). But it’s equally possible to create a project where the executable is built from many source files: dozens or even thousands. Many beginners follow this path: they build their binaries with only a few files and let their projects grow organically without strict planning. They keep adding files as required and before they know it, everything is linked directly to a single binary without any structure whatsoever.
As software developers, we deliberately draw boundaries and designate components to group one or more units of translation (.cpp files). We do it to increase code readability, manage coupling and connascence, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access