-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Our regex would only ever capture a single digit, so versions that had more than one digit per section would lose additional digits. Fixes and moves the helper to a cmake file to be shared between GuestLibs and HostLibs. Uses the fix in xcb because Fedora ships an older version that doesn't have some of FEX's newer symbols.
- Loading branch information
1 parent
9def04c
commit da0a171
Showing
4 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Extracts a version from the passed in version string in the form of "<Major>.<Minor>.<Patch>". | ||
# If a part of the version is missing then it gets set as zero. | ||
# Version variables returned in: | ||
# ${Package}_VERSION_MAJOR | ||
# ${Package}_VERSION_MINOR | ||
# ${Package}_VERSION_PATCH | ||
function(version_to_variables VERSION _Package) | ||
string(REPLACE "." ";" VERSION_LIST "${VERSION}") | ||
list (LENGTH VERSION_LIST VERSION_LEN) | ||
if (${VERSION_LEN} GREATER 0) | ||
list(GET VERSION_LIST 0 VERSION_MAJOR) | ||
set(${_Package}_VERSION_MAJOR ${VERSION_MAJOR} PARENT_SCOPE) | ||
else() | ||
set(${_Package}_VERSION_MAJOR 0 PARENT_SCOPE) | ||
endif() | ||
|
||
if (${VERSION_LEN} GREATER 1) | ||
list(GET VERSION_LIST 1 VERSION_MINOR) | ||
set(${_Package}_VERSION_MINOR ${VERSION_MINOR} PARENT_SCOPE) | ||
else() | ||
set(${_Package}_VERSION_MINOR 0 PARENT_SCOPE) | ||
endif() | ||
|
||
if (${VERSION_LEN} GREATER 2) | ||
list(GET VERSION_LIST 2 VERSION_PATCH) | ||
set(${_Package}_VERSION_PATCH ${VERSION_PATCH} PARENT_SCOPE) | ||
else() | ||
set(${_Package}_VERSION_PATCH 0 PARENT_SCOPE) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters