Skip to content

Commit 481137d

Browse files
committed
Update CMakeLists.txt
1 parent 91b4f06 commit 481137d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,15 @@ if(VERSION_MATCH)
366366
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
367367
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_2}")
368368
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_MATCH_3}")
369+
set(CPACK_PACKAGE_VERSION "${GIT_VERSION}")
370+
else()
371+
# Debian/RPM versions must start with a digit
372+
# If git version doesn't (e.g., "continuous-12-g91b4f06"), prefix with 0.0.0~
373+
set(CPACK_PACKAGE_VERSION_MAJOR "0")
374+
set(CPACK_PACKAGE_VERSION_MINOR "0")
375+
set(CPACK_PACKAGE_VERSION_PATCH "0")
376+
set(CPACK_PACKAGE_VERSION "0.0.0~${GIT_VERSION}")
369377
endif()
370-
set(CPACK_PACKAGE_VERSION "${GIT_VERSION}")
371378

372379
# Debian package settings
373380
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "HeadsetControl <headsetcontrol@users.noreply.github.com>")

0 commit comments

Comments
 (0)