Skip to content

Commit

Permalink
change version.cmake to check all tags
Browse files Browse the repository at this point in the history
Fix issue #2666

Currently, in master where latest tag is v0.12.0,
the build still says is it v0.11.0.

  [ben@centos bcc]$ cd build/
  [ben@centos build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
  -- Latest recognized Git tag is v0.11.0

The reason is the git_describe by default only checks
annotated tag while tag v0.12.0 is tagged through
github release process which just tags whatever the
top of the master.

Making git_describe to check all tags fixed the issue.

Signed-off-by: Yonghong Song <yhs@fb.com>
  • Loading branch information
yonghong-song committed Dec 26, 2019
1 parent 8bb4e47 commit 977a7e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/version.cmake
Expand Up @@ -4,7 +4,7 @@ if(NOT REVISION)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
string(SUBSTRING "${GIT_SHA1}" 0 8 GIT_SHA1_SHORT)
git_describe(GIT_DESCRIPTION)
git_describe(GIT_TAG_LAST "--abbrev=0")
git_describe(GIT_TAG_LAST "--abbrev=0" "--tags")
git_get_exact_tag(GIT_TAG_EXACT)
string(SUBSTRING "${GIT_TAG_LAST}-${GIT_SHA1_SHORT}" 1 -1 REVISION)
if(GIT_TAG_EXACT)
Expand Down

0 comments on commit 977a7e3

Please sign in to comment.