Build system 2026-11-05
A build system executes declared transformations from source files and other inputs to build outputs, respecting their dependency graph. Common steps include code generation, compilation, linking and packaging. CMake describes builds through targets such as executables and software libraries, with dependencies between them.[ref]
For example, main.o and math.o must exist before they can be linked into an executable. If only the source for math.o changes, an incremental build can reuse main.o, rebuild math.o and relink. Reuse is valid only when every relevant requirement has been tracked: a changed header, tool option or generated input can invalidate an apparently unchanged output. Correct dependency declarations are part of build correctness.
Software library 2026-11-05
A software library is reusable code exposed through an interface for other computer programs to call. It can supply operations such as sorting, text decoding or solving a linear system. Clients depend on the interface and its behavioral contract rather than having to copy the implementation.
A compiled software library can be linked into a computer program or supplied as a shared component loaded for execution. CMake distinguishes static, shared and other library targets in a build description.[ref] For example, two applications can call the same numerical routine with different arrays. Reusing the implementation saves duplication, while both callers must still satisfy its dimension, precision and error-handling requirements. A software package is a distribution unit and can contain several software libraries.