From 8c3979a3c2978eb1044d1e638a950445df759f02 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 22 Dec 2019 08:28:32 +0100 Subject: [PATCH] cmake: Add support for version suffixes --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7de06504..498ed959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,12 +23,13 @@ set(VERSION_MAJOR 0) set(VERSION_MINOR 7) set(VERSION_PATCH 1) set(VERSION_TWEAK 0) +set(VERSION_SUFFIX "") set(PROJECT_COMMIT "N/A") if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git") set(GIT_RESULT "") set(GIT_OUTPUT "") execute_process( - COMMAND git rev-list --count --topo-order ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}..HEAD + COMMAND git rev-list --count --topo-order ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}..HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} RESULT_VARIABLE GIT_RESULT OUTPUT_VARIABLE GIT_OUTPUT @@ -157,7 +158,7 @@ configure_file( # Packaging if("${CMAKE_PACKAGE_SUFFIX_OVERRIDE}" STREQUAL "") - set(_PACKAGE_SUFFIX_OVERRIDE "${PROJECT_VERSION}-${PROJECT_COMMIT}") + set(_PACKAGE_SUFFIX_OVERRIDE "${PROJECT_VERSION}${VERSION_SUFFIX}-${PROJECT_COMMIT}") else() set(_PACKAGE_SUFFIX_OVERRIDE "${CMAKE_PACKAGE_SUFFIX_OVERRIDE}") endif()