]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/CMakeLists: remove leading 'v' from 'git describe' version 31387/head
authorSage Weil <sage@redhat.com>
Mon, 4 Nov 2019 22:56:45 +0000 (16:56 -0600)
committerSage Weil <sage@redhat.com>
Mon, 4 Nov 2019 22:56:45 +0000 (16:56 -0600)
git describe gives you something like 'v15.0.0-6865-g7e4ef7f8ecc' but we
want no leading v, to match prior versions of ceph.

Signed-off-by: Sage Weil <sage@redhat.com>
src/CMakeLists.txt

index c2a9d7a66920c715dfd90895fa063c4e31961773..5d77091b11f07502ca79a6977997fe137f117004 100644 (file)
@@ -176,7 +176,9 @@ set(GCOV_PREFIX_STRIP 4)
 option(ENABLE_GIT_VERSION "build Ceph with git version string" ON)
 if(${ENABLE_GIT_VERSION})
   get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
-  git_describe(CEPH_GIT_NICE_VER --always)
+  git_describe(CEPH_GIT_NICE_VER_WITH_V --always)
+  # remove leading 'v'
+  string(SUBSTRING ${CEPH_GIT_NICE_VER_WITH_V} 1 -1 CEPH_GIT_NICE_VER)
   #if building from a source tarball via make-dist
   if(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
     message(STATUS "Ceph/.git directory not found, parsing ${CMAKE_CURRENT_SOURCE_DIR}/.git_version for CEPH_GIT_VER and CEPH_GIT_NICE_VER")