-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigVersion.cmake.in
95 lines (89 loc) · 3.11 KB
/
ConfigVersion.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
##############################################################################
# @file @VERSION_FILE@
# @brief Package configuration version file.
#
# @note The @VERSION_FILE@ file is automatically
# generated by BASIS from the template file ConfigVersion.cmake.in
# which is part of BASIS.
#
# This file supports the usage of the package by other projects. It is loaded
# by the find_package() CMake command used by other projects to find this
# package in order to verify that the version of the package found is
# compatible with the version requested.
#
# @par Input variables
# <table border="0">
# <tr>
# @tp @b PACKAGE_FIND_NAME @endtp
# <td>The package name, i.e., "@CONFIG_PREFIX@".</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION @endtp
# <td>Full requested version string.</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION_MAJOR @endtp
# <td>Major version if requested, else 0.</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION_MINOR @endtp
# <td>Minor version if requested, else 0.</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION_PATCH @endtp
# <td>Patch version if requested, else 0.</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION_TWEAK @endtp
# <td>Tweak version if requested, else 0.</td>
# </tr>
# <tr>
# @tp @b @CONFIG_PREFIX@_FIND_VERSION_COUNT @endtp
# <td>Number of version components, 0 to 4.</td>
# </tr>
# </table>
#
# @par Output variables
# <table border="0">
# <tr>
# @tp @b PACKAGE_VERSION @endtp
# <td>Full provided version string.</td>
# </tr>
# <tr>
# @tp @b PACKAGE_VERSION_EXACT @endtp
# <td>True if version is exact match.</td>
# </tr>
# <tr>
# @tp @b PACKAGE_VERSION_COMPATIBLE @endtp
# <td>True if version is compatible.</td>
# </tr>
# <tr>
# @tp @b PACKAGE_VERSION_UNSUITABLE @endtp
# <td>True if unsuitable as any version.</td>
# </tr>
# </table>
#
# @sa http://www.cmake.org/Wiki/CMake_2.6_Notes
#
# @ingroup BasisConfig
##############################################################################
# ============================================================================
# version
# ============================================================================
## @brief Version of the found package.
set (PACKAGE_VERSION "@PROJECT_VERSION@")
# ============================================================================
# check compatibility
# ============================================================================
# Perform compatibility check here using the input CMake variables.
# See example in http://www.cmake.org/Wiki/CMake_2.6_Notes.
## @brief Whether this package version is compatible with the requested version.
set (PACKAGE_VERSION_COMPATIBLE TRUE)
## @brief Whether this package version is unsuitable with the requested version.
set (PACKAGE_VERSION_UNSUITABLE FALSE)
## @brief Whether this package version is the requested version.
if (${PACKAGE_FIND_VERSION_MAJOR} EQUAL @PROJECT_VERSION_MAJOR@)
if (${PACKAGE_FIND_VERSION_MINOR} EQUAL @PROJECT_VERSION_MINOR@)
set (PACKAGE_VERSION_EXACT TRUE)
endif ()
endif ()