Skip to content

Automatic version generation for C++ CMake projects.

License

Notifications You must be signed in to change notification settings

jahnf/CMake-GitVersion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake-GitVersion

(Yet another) automatic version generation for C++ CMake projects.

Version Generation

Defines

  • LAST_TAG_VERSION: latest tagged version (e.g. 1.2.0 for tag v1.2.0) or 0.0.0 if no tag exists.
  • DIST: commit count distance to latest version tag.

Version Number rules:

  • on master: X.Y.Z[-DIST] (using LAST_TAG_VERSION), while DIST should always be 0 on the master branch.
  • on develop and other branches: X.Y.Z-ALPHA_FLAG.DIST (using LAST_TAG_VERSION, Y incremented by 1)
  • on release branches: X.Y.Z-RC_FLAG.DIST (extracting X.Y.Z from release branch name or from develop as fallback).
    DIST is either calculated to last version tag or to the closest rc-X.Y.Z tag.
  • DIST is added to all version numbers, except:
    • Versions on master and on hotfix branches with DIST equal to 0
  • All version numbers have a pre-release identifier set, except:
    • Version on master and
    • versions on hotfix branches with DIST equal to 0
  • When creating the version string and the PATCH number is 0 - the patch number is omitted. (e.g. 1.2.0 will be 1.2)

Examples

Have a look at CMakeLists.txt and all fles in the examples directory.

About

Automatic version generation for C++ CMake projects.

Resources

License

Stars

Watchers

Forks