]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Add ENABLE_GIT_VERSION to avoid rebuilding 7171/head
authorKefu Chai <kchai@redhat.com>
Mon, 11 Jan 2016 04:33:13 +0000 (12:33 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 11 Jan 2016 05:22:45 +0000 (13:22 +0800)
it is a pain to see something like
"expected plugin ./ec_plugins/libec_jerasure.so version
 v10.0.1-1239-g73c5763 but it claims to be v10.0.1-1241-gdb83f12
 instead" from time to time. so this is a cmake port of b227426.
the option ENABLE_GIT_VERSION is ON by default. if it is set OFF,
ceph_ver.h will not be recreated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/CMakeLists.txt

index 0a122b7d2ecd305f1aa1a1701468d6a546975532..3d3e174112e303282869259334c9e209994681ed 100644 (file)
@@ -92,8 +92,14 @@ endif(USE_NSS)
 
 set(GCOV_PREFIX_STRIP 4)
 
-get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
-git_describe(CEPH_GIT_NICE_VER --always)
+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)
+else(${ENABLE_GIT_VERSION})
+  set(CEPH_GIT_VER "no_version")
+  set(CEPH_GIT_NICE_VER "Development")
+endif(${ENABLE_GIT_VERSION})
 
 # Python stuff
 find_package(PythonInterp 2 QUIET)