Skip to content

Commit e5a0fb0

Browse files
committed
Fix CmakeList to allow for strings in versions
1 parent 6677eee commit e5a0fb0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ else()
5151
endif()
5252
endif()
5353

54+
# CMake project() VERSION only accepts numeric components; strip any alpha suffix (e.g. "26.02arch" -> "26.02")
55+
string(REGEX REPLACE "[a-zA-Z]+.*$" "" PROJECT_VERSION_NUMERIC "${PROJECT_VERSION_FROM_CHANGELOG}")
56+
5457
project(mx-service-manager
55-
VERSION ${PROJECT_VERSION_FROM_CHANGELOG}
58+
VERSION ${PROJECT_VERSION_NUMERIC}
5659
DESCRIPTION "Service Manager - MX Linux service management tool"
5760
LANGUAGES CXX
5861
)
@@ -162,7 +165,7 @@ endif()
162165
target_compile_definitions(mx-service-manager PRIVATE
163166
QT_DEPRECATED_WARNINGS
164167
QT_DISABLE_DEPRECATED_BEFORE=0x060000
165-
VERSION="${PROJECT_VERSION}"
168+
VERSION="${PROJECT_VERSION_FROM_CHANGELOG}"
166169
)
167170

168171
# Release-specific optimizations

0 commit comments

Comments
 (0)