From 0ccc12a6696f79573f8b02aba02e6cdcd78b087c Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 5 Oct 2023 11:04:22 +0200 Subject: [PATCH] Add missing package name suffix to CMake/CPack Fixes e98e0a64e69716e069604c3f95f1e5070bbea842 Signed-off-by: Steffen Jaeckel --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb40d285..b28ca0b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,6 +300,15 @@ else() set(DISTRO_PACK_PATH ${CMAKE_SYSTEM_NAME}/) endif() +# make sure untagged versions get a different package name +execute_process(COMMAND git describe --exact-match --tags ERROR_QUIET RESULT_VARIABLE REPO_HAS_TAG) +if(REPO_HAS_TAG EQUAL 0) + set(PACKAGE_NAME_SUFFIX "") +else() + set(PACKAGE_NAME_SUFFIX "-git") + message(STATUS "Use -git suffix") +endif() + # default CPack generators set(CPACK_GENERATOR TGZ STGZ)