summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/GenerateVersion.cmake2
-rw-r--r--cmake/Version.cmake4
2 files changed, 4 insertions, 2 deletions
diff --git a/cmake/GenerateVersion.cmake b/cmake/GenerateVersion.cmake
index bddd672..b7579bc 100644
--- a/cmake/GenerateVersion.cmake
+++ b/cmake/GenerateVersion.cmake
@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
include(Version)
# get Git version of Git repository
-get_repository_version(DNBD3_VERSION DNBD3_BRANCH ${VERSION_INPUT_FILE} ${VERSION_BUILD_TYPE} ${GIT_EXECUTABLE} ${REPOSITORY_DIR})
+get_repository_version(DNBD3_VERSION DNBD3_VERSION_SHORT DNBD3_BRANCH ${VERSION_INPUT_FILE} ${VERSION_BUILD_TYPE} ${GIT_EXECUTABLE} ${REPOSITORY_DIR})
# generate version header if header does not exists
if(NOT EXISTS ${VERSION_INPUT_FILE})
diff --git a/cmake/Version.cmake b/cmake/Version.cmake
index c121499..0f26944 100644
--- a/cmake/Version.cmake
+++ b/cmake/Version.cmake
@@ -31,7 +31,7 @@ macro(gen_project_version VERSION_INPUT_FILE VERSION_INPUT_FILE_TEMPLATE VERSION
endmacro(gen_project_version VERSION_INPUT_FILE VERSION_INPUT_FILE_TEMPLATE VERSION_OUTPUT_FILE)
# macro to get Git version information
-macro(get_repository_version REPOSITORY_VERSION REPOSITORY_BRANCH VERSION_HEADER_FILE VERSION_BUILD_TYPE GIT_EXECUTABLE REPOSITORY_DIR)
+macro(get_repository_version REPOSITORY_VERSION REPOSITORY_VERSION_SHORT REPOSITORY_BRANCH VERSION_HEADER_FILE VERSION_BUILD_TYPE GIT_EXECUTABLE REPOSITORY_DIR)
# set empty Git version information
set(GIT_VERSION "")
# set empty Git branch information
@@ -74,6 +74,8 @@ macro(get_repository_version REPOSITORY_VERSION REPOSITORY_BRANCH VERSION_HEADER
endif(${VERSION_BUILD_TYPE} MATCHES "Release")
endif(GIT_VERSION STREQUAL "")
+ set(${REPOSITORY_VERSION_SHORT} ${GIT_VERSION})
+
# get current branch of Git repository
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${REPOSITORY_DIR}