cmake: better version conversion for uwp

This commit is contained in:
scribam 2024-05-17 18:06:40 +02:00 committed by flyinghead
parent 2797cca5ff
commit 6b18ad7e3e
1 changed files with 4 additions and 4 deletions

View File

@ -105,11 +105,11 @@ if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
string(REGEX REPLACE "[Vv]" "" MS_VERSION ${GIT_VERSION})
string(REPLACE "-" "." MS_VERSION ${MS_VERSION})
string(REGEX REPLACE "\.g[0-9a-f]+" "" MS_VERSION ${MS_VERSION})
string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" VERSION_3PARTS ${MS_VERSION})
string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" VERSION_4PARTS ${MS_VERSION})
if(VERSION_3PARTS STREQUAL "")
string(REGEX MATCHALL "[0-9]+" VERSION_PARTS ${MS_VERSION})
list(LENGTH VERSION_PARTS VERSION_PARTS_LENGTH)
if(VERSION_PARTS_LENGTH EQUAL 2)
string(APPEND MS_VERSION ".0.0")
elseif(VERSION_4PARTS STREQUAL "")
elseif(VERSION_PARTS_LENGTH EQUAL 3)
string(APPEND MS_VERSION ".0")
endif()
endif()