Skip to content

Commit

Permalink
cmake: better version conversion for uwp
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam authored and flyinghead committed May 21, 2024
1 parent 1256680 commit 0fa3e9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,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})
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")
else()
elseif(VERSION_PARTS_LENGTH EQUAL 3)
string(APPEND MS_VERSION ".0")
endif()
endif()
Expand Down

0 comments on commit 0fa3e9a

Please sign in to comment.