-
Notifications
You must be signed in to change notification settings - Fork 370
/
wt-config-version.cmake.in
51 lines (44 loc) · 1.68 KB
/
wt-config-version.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
set(PACKAGE_VERSION @VERSION_SERIES@.@VERSION_MAJOR@.@VERSION_MINOR@)
# Match the version just as precisely as it was specified
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL "@VERSION_SERIES@")
set(_MAJOR_MATCHES TRUE)
else()
set(_MAJOR_MATCHES FALSE)
endif()
if(PACKAGE_FIND_VERSION_MINOR STREQUAL "@VERSION_MAJOR@")
set(_MINOR_MATCHES TRUE)
else()
set(_MINOR_MATCHES FALSE)
endif()
if(PACKAGE_FIND_VERSION_PATCH STREQUAL "@VERSION_MINOR@")
set(_PATCH_MATCHES TRUE)
else()
set(_PATCH_MATCHES FALSE)
endif()
if(PACKAGE_FIND_VERSION_COUNT EQUAL 0)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
elseif(PACKAGE_FIND_VERSION_COUNT EQUAL 1 AND _MAJOR_MATCHES)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
elseif(PACKAGE_FIND_VERSION_COUNT EQUAL 2 AND
_MAJOR_MATCHES AND _MINOR_MATCHES)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
elseif(PACKAGE_FIND_VERSION_COUNT GREATER 2 AND
_MAJOR_MATCHES AND _MINOR_MATCHES AND _PATCH_MATCHES)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
# bitness checks copied from autogenerated CMakePackageConfigHelpers version file
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()