Skip to content

Commit

Permalink
Merge pull request #1975 from Unidata/gh1962.wif
Browse files Browse the repository at this point in the history
Refactored the HDF5 version detection logic in CMakeLists.txt
  • Loading branch information
WardF authored Apr 1, 2021
2 parents 5b40de1 + ad51b0a commit f01e4f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
31 changes: 14 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,20 @@ IF(USE_HDF5)

# Check to see if HDF5 library is 1.10.6 or greater.
# Used to control path name conversion
IF(${HDF5_VERSION} VERSION_LESS "1.10.6")
SET(HDF5_UTF8_PATHS FALSE)
ELSE()
SET(HDF5_UTF8_PATHS TRUE)
ENDIF()
# Check HDF5 version
SET(HDF5_UTF8_PATHS OFF)
CHECK_C_SOURCE_COMPILES("
#include <H5public.h>
int main() {
#if (H5_VERS_MAJOR*10000 + H5_VERS_MINOR*100 + H5_VERS_RELEASE < 11006)
choke me;
#endif
}" HDF5_VERSION_1106)

IF(HDF5_VERSION_1106)
SET(HDF5_UTF8_PATHS ON)
ENDIF(HDF5_VERSION_1106)

MESSAGE("-- Checking for HDF5 version 1.10.6 or later: ${HDF5_UTF8_PATHS}")

SET(H5_USE_16_API 1)
Expand Down Expand Up @@ -869,18 +878,6 @@ IF(USE_HDF5)
#option to include HDF5 High Level header file (hdf5_hl.h) in case we are not doing a make install
INCLUDE_DIRECTORIES(${HDF5_HL_INCLUDE_DIR})

# Check HDF5 version
CHECK_C_SOURCE_COMPILES("
#include <H5public.h>
int main() {
#if (H5_VERS_MAJOR*10000 + H5_VERS_MINOR*100 + H5_VERS_RELEASE < 11006)
choke me;
#endif
}" HDF5_VERSION_1106)

IF(HDF5_VERSION_1106)
SET(HDF5_UTF8_PATHS ON)
ENDIF()

ENDIF(USE_HDF5)

Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Release Notes {#RELEASE_NOTES}
\brief Release notes file for the netcdf-c package.

This file contains a high-level description of this package's evolution. Releases are in reverse chronological order (most recent first). Note that, as of netcdf 4.2, the `netcdf-c++` and `netcdf-fortran` libraries have been separated into their own libraries.
## 4.8.1 - TBD

* [Bug Fix] Corrected HDF5 version detection logic as described in [Github #1962](https://github.com/Unidata/netcdf-c/issues/1962).

## 4.8.0 - March 30, 2021

Expand Down

0 comments on commit f01e4f1

Please sign in to comment.