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)