Different method for checking HDF5 version requirement

This method works for me when I have a local HDF5 build; the previous method seems to have issues comparing version numbers...
This commit is contained in:
Greg Sjaardema 2024-06-26 15:57:40 -06:00 committed by GitHub
parent bfee002d77
commit abe4d0107e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,8 +134,13 @@ if(USE_HDF5)
#####
# First, find the C and HL libraries.
#####
find_package(HDF5 ${HDF5_VERSION_REQUIRED} COMPONENTS C HL REQUIRED)
find_package(HDF5 COMPONENTS C HL REQUIRED)
message(STATUS "Found HDF5 version: ${HDF5_VERSION}")
if(${HDF5_VERSION} VERSION_LESS ${HDF5_VERSION_REQUIRED})
message(FATAL_ERROR "NetCDF requires HDF5 version ${HDF5_VERSION_REQUIRED} or later; found version ${HDF5_VERSION}.")
endif()
message(STATUS "Using HDF5 include dir: ${HDF5_INCLUDE_DIRS}")
target_link_libraries(netcdf
PRIVATE