MB-14425: Populate ep_version with commit SHA 57/52957/3
authorChris Hillery <ceej@couchbase.com>
Wed, 8 Jul 2015 08:20:16 +0000 (01:20 -0700)
committerChris Hillery <ceej@couchbase.com>
Wed, 8 Jul 2015 09:18:35 +0000 (09:18 +0000)
Change-Id: I8c65ce557e65de4ec4a772750cbeb521d0e98162
Reviewed-on: http://review.couchbase.org/52957
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Dave Finlay <dave.finlay@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
CMakeLists.txt

index 08e50db..103865d 100644 (file)
@@ -54,11 +54,13 @@ CHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
 #endif()
 
 IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
-   EXECUTE_PROCESS(COMMAND git describe
+   EXECUTE_PROCESS(COMMAND git rev-parse HEAD
                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                    OUTPUT_VARIABLE EP_ENGINE_VERSION
-                   ERROR_QUIET
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+   IF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
+     MESSAGE (FATAL_ERROR "Failed to determine commit SHA!")
+   ENDIF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
 ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
    SET(EP_ENGINE_VERSION "unknown")
 ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)