summaryrefslogtreecommitdiffstats
path: root/config/cmake/hdf5-config-version.cmake.in
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-02-18 17:02:42 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-02-18 17:02:42 (GMT)
commitb901552b1ca315db8b27ea090011f2f557491d46 (patch)
treeedf2c01077258e07693a49d513cbbd021bdfc5a6 /config/cmake/hdf5-config-version.cmake.in
parent5ad3891d9b861593ebe25d540bed2d913eb83aba (diff)
parent6d07eb126e63b025199a5fe68f41a42269b5921b (diff)
downloadhdf5-b901552b1ca315db8b27ea090011f2f557491d46.zip
hdf5-b901552b1ca315db8b27ea090011f2f557491d46.tar.gz
hdf5-b901552b1ca315db8b27ea090011f2f557491d46.tar.bz2
Merge pull request #1559 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '6d07eb126e63b025199a5fe68f41a42269b5921b': Update standard check Fix typo HDFFV-10703 Update version match logic HDFFV-10703 revert pre-3.11 option HDFFV-10703 macro vars need quotes HDFFV-10703 Update CMake commands to latest standard Use correct variable name
Diffstat (limited to 'config/cmake/hdf5-config-version.cmake.in')
-rw-r--r--config/cmake/hdf5-config-version.cmake.in50
1 files changed, 25 insertions, 25 deletions
diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in
index 8e16725..575c1ab 100644
--- a/config/cmake/hdf5-config-version.cmake.in
+++ b/config/cmake/hdf5-config-version.cmake.in
@@ -21,38 +21,38 @@
set (PACKAGE_VERSION "@HDF5_VERSION_STRING@")
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else ()
- if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@")
+else()
+ if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)")
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
+ else()
+ set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@")
+ set(CVF_VERSION_MINOR "")
+ endif()
+
+ if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
+ (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
+ 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()
+endif()
- # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
- if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@")
-
- # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
- set (PACKAGE_VERSION_COMPATIBLE TRUE)
-
- if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@")
- set (PACKAGE_VERSION_EXACT TRUE)
-
- if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@")
- # not using this yet
- endif ()
- endif ()
- else ()
- set (PACKAGE_VERSION_COMPATIBLE FALSE)
- endif ()
- endif ()
-endif ()
# 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 "")
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
-endif ()
+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@")
+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 ()
+endif()