Skip to content

Commit

Permalink
[cmake] add mac/win build metadata to version string
Browse files Browse the repository at this point in the history
  • Loading branch information
Saviq committed Mar 29, 2019
1 parent be11c0a commit cc593e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ function(determine_version OUTPUT_VARIABLE)
message(FATAL_ERROR "Failed to parse version number: ${GIT_VERSION}")
endif()

if(APPLE OR MSVC)
string(REGEX MATCH "\\+full$" FULL_SUFFIX_MATCH ${NEW_VERSION})
if(NOT FULL_SUFFIX_MATCH)
set(NEW_VERSION ${NEW_VERSION}.full)
endif()
if(APPLE)
string(REPLACE "full" "mac" NEW_VERSION ${NEW_VERSION})
else()
string(REPLACE "full" "win" NEW_VERSION ${NEW_VERSION})
endif()
endif()

string(REGEX MATCH "^v(.+)" VERSION_MATCH ${NEW_VERSION})

if(VERSION_MATCH)
Expand Down

0 comments on commit cc593e2

Please sign in to comment.