Join our book community on Discord
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, speed up the build process, and finally, to discover and extract reusable components into autonomic units.
Every big project will push you to introduce some form of partitioning. This is where...