In CMake's Tutorial, under the section "Adding a Version Number and Configured Header File", it explains how to add a version number to a project.
Why do this with CMake when version-control tools (such as git) already allow you to specify a version number?
What, if anything, is to be gained from specifying a project's version number in CMake as well as git?
Nevermind, that same section of the tutorial has the answer. This is embarrassing!
Basically, CMake lets you substitute your version number into your code at build-time (essentially a macro), which git doesn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With