]> granicus.if.org Git - icinga2/commitdiff
Implement the ICINGA2_GIT_VERSION_INFO option.
authorGunnar Beutner <gunnar.beutner@netways.de>
Sun, 18 May 2014 12:33:38 +0000 (14:33 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 18 May 2014 12:34:13 +0000 (14:34 +0200)
Refs #5410

CMakeLists.txt
INSTALL

index 1aab592fe1fc6f8a5a49180b36cb2720de1c6c13..b46ca827dcbdbe5219c48f4ef5af2e1489c97e51 100644 (file)
@@ -34,6 +34,7 @@ set(ICINGA2_USER "icinga" CACHE STRING "Icinga 2 user")
 set(ICINGA2_GROUP "icinga" CACHE STRING "Icinga 2 group")
 set(ICINGA2_COMMAND_USER "icinga" CACHE STRING "Icinga 2 command user")
 set(ICINGA2_COMMAND_GROUP "icingacmd" CACHE STRING "Icinga 2 command group")
+set(ICINGA2_GIT_VERSION_INFO ON CACHE BOOL "Whether to use git describe")
 
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" ICINGA2_LICENSE_GPL)
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDITIONS)
@@ -45,7 +46,7 @@ git_describe(GIT_VERSION --tags)
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force)
   configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY)
 else()
-  if(GIT_VERSION MATCHES "-NOTFOUND$")
+  if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$")
     file(STRINGS icinga2.spec SPEC_VERSION REGEX "^Version:")
     string(SUBSTRING ${SPEC_VERSION} 9 -1 SPEC_VERSION)
     set(GIT_VERSION "r${SPEC_VERSION}")
diff --git a/INSTALL b/INSTALL
index d51440dd65a27488e46272a96044703f8b86c228..71c3f0513722d1437a6dc3c043a99c86f6abd998 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -81,6 +81,8 @@ Note: CMake determines the Icinga 2 version number using "git describe" if the
 source directory is contained in a Git repository. Otherwise the version number
 is extracted from the icinga2.spec file. This behavior can be overridden by
 creating a file called "icinga-version.h.force" in the source directory.
+Alternatively the -DICINGA2_GIT_VERSION_INFO=ON option for CMake can be used to
+disable the usage of "git describe".
 
 Use "git archive" to build the release tarball: