Merge branch 'hdf5-version-check' of https://github.com/nschloe/netcdf-c into nschloe-hdf5-version-check

This commit is contained in:
Ward Fisher 2014-03-12 11:20:39 -06:00
commit 019de54669

View File

@ -600,6 +600,16 @@ IF (USE_HDF5 OR ENABLE_NETCDF_4)
ENDIF()
ENDIF()
# Assert HDF5 version.
SET(HDF5_VERSION_REQUIRED 1.8.6)
execute_process(COMMAND sh -c "h5cc -showconfig | grep -i \"HDF5 version\" | sed 's/^.*[^0-9]\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*$/\\1/'"
OUTPUT_VARIABLE HDF5_VERSION
)
IF (${HDF5_VERSION} VERSION_LESS ${HDF5_VERSION_REQUIRED})
MESSAGE(FATAL_ERROR
"netCDF requires at least HDF5 ${HDF5_VERSION_REQUIRED}. Found ${HDF5_VERSION}.")
ENDIF()
INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
# Starting with hdf5 1.8.11, dynamic loading is an option.