forked from agenium-scale/boost.simd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Boost.SIMDConfigVersion.cmake.in
73 lines (65 loc) · 2.17 KB
/
Boost.SIMDConfigVersion.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## Copyright 2017 - NumScale SAS
##
## Distributed under the Boost Software License, Version 1.0.
## (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
##
## -------------------------------------------------------------------------------------------------
##
## Requirements for cmake's version configuration file:
##
## PACKAGE_VERSION
## PACKAGE_VERSION_EXACT
## PACKAGE_VERSION_COMPATIBLE
##
## -------------------------------------------------------------------------------------------------
##
set(MAJOR_VERSION @PROJECT_MAJOR_VERSION@)
set(MINOR_VERSION @PROJECT_MINOR_VERSION@)
set(PATCH_VERSION @PROJECT_SUBMINOR_VERSION@)
##
set(PACKAGE_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}.${SUBSUBMINOR_VERSION})
## Check each version components and report if they exists and if they matched
if (PACKAGE_FIND_VERSION_MAJOR)
set(_major true)
if (${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION})
set(_major_matched true)
endif()
endif()
if (PACKAGE_FIND_VERSION_MINOR)
set(_minor true)
if (${PACKAGE_FIND_VERSION_MINOR} EQUAL ${MINOR_VERSION})
set(_minor_matched true)
endif()
endif()
if (PACKAGE_FIND_VERSION_PATCH)
set(_patch true)
if (${PACKAGE_FIND_VERSION_PATCH} EQUAL ${PATCH_VERSION})
set(_patch_matched true)
endif()
endif()
## We want to be strict, so we strictly check for each version components, if one fails, then we
## assume that the current version is incompatible...
if (NOT PACKAGE_VERSION_UNSUITABLE AND _major AND _minor AND _patch)
if (_major_matched AND _minor_matched AND _patch_matched)
set(PACKAGE_VERSION_EXACT true)
set(PACKAGE_VERSION_COMPATIBLE true)
else()
set(PACKAGE_VERSION_UNSUITABLE true)
endif()
endif()
if (NOT PACKAGE_VERSION_UNSUITABLE AND _major AND _minor)
if (_major_matched AND _minor_matched)
set(PACKAGE_VERSION_EXACT true)
set(PACKAGE_VERSION_COMPATIBLE true)
else()
set(PACKAGE_VERSION_UNSUITABLE true)
endif()
endif()
if (NOT PACKAGE_VERSION_UNSUITABLE AND _major)
if (_major_matched)
set(PACKAGE_VERSION_EXACT true)
set(PACKAGE_VERSION_COMPATIBLE true)
else()
set(PACKAGE_VERSION_UNSUITABLE true)
endif()
endif()