forked from facebookarchive/RakNet
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added version handling support for cmake integration (facebookarchi…
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 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,36 @@ | ||
# Copyright (c) 2019, SLikeSoft UG (haftungsbeschränkt) | ||
# | ||
# This file is licensed under the MIT-style license found in the license.txt | ||
# file in the root directory of this source tree. | ||
|
||
set(PACKAGE_VERSION @SLikeNet_VERSION@) | ||
|
||
if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@SLikeNet_VERSION_MAJOR@") | ||
if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL "@SLikeNet_VERSION_MINOR@") | ||
if("${PACKAGE_FIND_VERSION_PATCH}" EQUAL "@SLikeNet_VERSION_PATCH@") | ||
# exactly the required version | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
else() | ||
# requested x.y.z with x.y.z1 being installed where z1 is != z | ||
# since it's just a patch level change, the version is fully compatible | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
endif() | ||
elseif("${PACKAGE_FIND_VERSION_MINOR}" LESS "@SLikeNet_VERSION_MINOR@") | ||
# requested x.y.z with x.y1.z1 being installed where y1 is != y | ||
# the version is compatible, if y1 is > y | ||
if("${PACKAGE_FIND_VERSION_MINOR}" LESS "@SLikeNet_VERSION_MINOR@") | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
else() | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
endif() | ||
else() | ||
# requested was x.y.z while we have installed x.y1.z with y1 < y -> not compatbile | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
endif() | ||
elseif("$(PACKAGE_FIND_VERSION_MAJOR)" EQUAL 1 AND "@SLikeNet_VERSION_MAJOR@" EQUAL 0) | ||
# version 0.x.y was requested while we have 1.x.y installed - 1.x.y is backwards compatible with 0.x.y | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
else() | ||
# requested was x.y.z while we have installed x1.y.z with x1 != x -> not compatible | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
endif() |