Enhancement: project(): allow semantic versioning
[Semantic versioning(https://semver.org/) is the de facto standard for project versioning in certain ecosystems (admittedly, not C++). It would be great if CMake supported semver-compatible versions inside project()
.
There is two parts of semver which are currently not supported.
- Prerelease: preceded by a dash, added after patch version, for example
1.0.0-rc1
, this is the part I'm actually interested in. - Build metadata: last part, starting with a plus, for example
1.0.0+afebc
or1.0.0-rc1+afebc
. This could be skipped, as encoding build metadata in a CMake file seems like a bad practice, although there may be edge cases where this is useful.
Looking around a little more, CMAKE_VERSION
itself uses a format similar to semver, one which it is invalid to use within project()
.