Skip to content

Commit

Permalink
Updated CMakeLists to explicitely look for static or shared hdf5 libr…
Browse files Browse the repository at this point in the history
…aries. Required as part of hdf5 1.8.16, and is documented in #186
  • Loading branch information
WardF committed Jan 7, 2016
1 parent 3bb57f0 commit 2d25f9b
Show file tree
Hide file tree
Showing 3 changed files with 21,281 additions and 21,276 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -482,22 +482,27 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
IF(FIND_SHARED_LIBS)
SET(H5_BUILT_AS_DYNAMIC_LIB ON)
SET(HDF5_USE_STATIC_LIBRARIES OFF)
SET(NC_HDF5_LINK_TYPE "shared")
ELSE()
SET(H5_BUILT_AS_DYNAMIC_LIB OFF)
SET(HDF5_USE_STATIC_LIBRARIES ON)
SET(NC_HDF5_LINK_TYPE "static")
ENDIF()

IF(MSVC)
FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED)
FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED ${NC_HDF5_LINK_TYPE})
ELSE()
FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED ${NC_HDF5_LINK_TYPE})
ENDIF()
ENDIF()

IF(NOT HDF5_FOUND)
MESSAGE(FATAL_ERROR "Unable to locate HDF5. Disable netcdf-4 or install libhdf5 1.8.9 or later.")
ELSE()
MESSAGE(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}")
MESSAGE(STATUS "HDF_FOUND: ${HDF5_FOUND}")
MESSAGE(STATUS "hdf5: ${hdf5}")
MESSAGE(STATUS "HDF5_hdf5: ${hdf5}")
MESSAGE(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}")
MESSAGE(STATUS "HDF5_C_LIBRARIES: ${HDF5_C_LIBRARIES}")
MESSAGE(STATUS "HDF5_C_SHARED_LIBRARIES: ${HDF5_C_SHARED_LIBRARIES}")
MESSAGE(STATUS "HDF5_C_LIBRARIES_SHARED: ${HDF5_C_LIBRARIES_SHARED}")
Expand Down
Loading

0 comments on commit 2d25f9b

Please sign in to comment.