diff options
author | Manuel Bentele | 2021-11-30 14:15:56 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-11-30 14:33:53 +0100 |
commit | b8326e90edc0150d69e0ad54d73bbd003a556875 (patch) | |
tree | 596f30735d427fd5ff514971f450025f5dcb27bc /cmake | |
parent | [KERNEL] Add support for Linux kernel 5.15.x LTS (diff) | |
download | dnbd3-b8326e90edc0150d69e0ad54d73bbd003a556875.tar.gz dnbd3-b8326e90edc0150d69e0ad54d73bbd003a556875.tar.xz dnbd3-b8326e90edc0150d69e0ad54d73bbd003a556875.zip |
[BUILD] Fix versioning format for Docker tags
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/GenerateVersion.cmake | 2 | ||||
-rw-r--r-- | cmake/Version.cmake | 4 |
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} |