-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Minimal CMake
By :

Back in Chapter 2, Hello, CMake!, when we introduced the project
command, we touched on the VERSION
parameter, but haven’t yet had the opportunity to see how to apply it, and why it’s useful. In this section, we’ll show how to add a version to our mc-draw
library and how to request the correct version from our find_package
command.
Versioning for libraries is important for us to know what functionality and interface the library we’re currently using provides. Versioning is used to manage change, and, most importantly, handle API updates that may cause breaking changes. The software industry has largely adopted semantic versioning (SemVer). Briefly, in SemVer, we have a version number in the <Major>.<Minor>.<Patch>
format (e.g., 1.45.23
) where numbers further to the left represent a more notable change. For a full introduction, see https://semver.org/. Luckily, CMake supports this format, so...