| 1 |
# |
| 2 |
# Copyright by The HDF Group. |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# This file is part of HDF5. The full HDF5 copyright notice, including |
| 6 |
# terms governing use, modification, and redistribution, is contained in |
| 7 |
# the COPYING file, which can be found at the root of the source code |
| 8 |
# distribution tree, or in https://www.hdfgroup.org/licenses. |
| 9 |
# If you do not have access to either file, you may request a copy from |
| 10 |
# [email protected]. |
| 11 |
# |
| 12 |
#----------------------------------------------------------------------------- |
| 13 |
# HDF5 Version file for install directory |
| 14 |
#----------------------------------------------------------------------------- |
| 15 |
# |
| 16 |
# The created file sets PACKAGE_VERSION_EXACT if the current version string and |
| 17 |
# the requested version string are exactly the same and it sets |
| 18 |
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, |
| 19 |
# but only if the requested major.minor version is the same as the current one. |
| 20 |
# The variable HDF5_VERSION_STRING must be set before calling configure_file(). |
| 21 |
|
| 22 |
set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") |
| 23 |
|
| 24 |
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) |
| 25 |
set(PACKAGE_VERSION_COMPATIBLE FALSE) |
| 26 |
else() |
| 27 |
if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)") |
| 28 |
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") |
| 29 |
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}") |
| 30 |
else() |
| 31 |
set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@") |
| 32 |
set(CVF_VERSION_MINOR "") |
| 33 |
endif() |
| 34 |
|
| 35 |
if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND |
| 36 |
(PACKAGE_FIND_VERSION_MINOR STRLESS_EQUAL CVF_VERSION_MINOR)) |
| 37 |
set(PACKAGE_VERSION_COMPATIBLE TRUE) |
| 38 |
else() |
| 39 |
set(PACKAGE_VERSION_COMPATIBLE FALSE) |
| 40 |
endif() |
| 41 |
|
| 42 |
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) |
| 43 |
set(PACKAGE_VERSION_EXACT TRUE) |
| 44 |
endif() |
| 45 |
endif() |
| 46 |
|
| 47 |
|
| 48 |
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: |
| 49 |
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") |
| 50 |
return() |
| 51 |
endif() |
| 52 |
|
| 53 |
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: |
| 54 |
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") |
| 55 |
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") |
| 56 |
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") |
| 57 |
set(PACKAGE_VERSION_UNSUITABLE TRUE) |
| 58 |
endif() |