Skip to content

Commit 9de2c22

Browse files
committed
Make sure untagged versions get a different package name
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 2a5e0b6 commit 9de2c22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ else()
225225
set(DISTRO_PACK_PATH ${CMAKE_SYSTEM_NAME}/)
226226
endif()
227227

228+
# make sure untagged versions get a different package name
229+
execute_process(COMMAND git describe --exact-match --tags RESULT_VARIABLE REPO_HAS_TAG)
230+
if(REPO_HAS_TAG EQUAL 0)
231+
set(PACKAGE_NAME_SUFFIX "")
232+
else()
233+
set(PACKAGE_NAME_SUFFIX "-git")
234+
endif()
235+
228236
# default CPack generators
229237
set(CPACK_GENERATOR TGZ STGZ)
230238

@@ -245,6 +253,7 @@ if(BUILD_SHARED_LIBS)
245253
else()
246254
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-devel")
247255
endif()
256+
set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${PACKAGE_NAME_SUFFIX}")
248257
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
249258
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LibTomMath")
250259
set(CPACK_PACKAGE_VENDOR "libtom projects")

0 commit comments

Comments
 (0)