1 # Copyright (c) PLUMgrid, Inc.
2 # Licensed under the Apache License, Version 2.0 (the "License")
4 get_git_head_revision(GIT_REFSPEC GIT_SHA1)
5 string(SUBSTRING "${GIT_SHA1}" 0 8 GIT_SHA1_SHORT)
6 git_describe(GIT_DESCRIPTION)
7 git_describe(GIT_TAG_LAST "--abbrev=0" "--tags")
8 git_get_exact_tag(GIT_TAG_EXACT)
9 string(SUBSTRING "${GIT_TAG_LAST}-${GIT_SHA1_SHORT}" 1 -1 REVISION)
11 string(SUBSTRING "${GIT_TAG_EXACT}" 1 -1 REVISION)
12 message(STATUS "Currently on Git tag ${GIT_TAG_EXACT}")
14 message(STATUS "Latest recognized Git tag is ${GIT_TAG_LAST}")
17 message(STATUS "Git HEAD is ${GIT_SHA1}")
18 # rpm/deb packaging uses this, only works on whole tag numbers
20 string(SUBSTRING "${GIT_TAG_LAST}" 1 -1 REVISION_LAST)
23 set(REVISION_LAST "${REVISION}")
26 # strip leading 'v', and make unique for the tag
27 message(STATUS "Revision is ${REVISION}")