diff --git a/CMakeLists.txt b/CMakeLists.txt index 0271a32ea..71b34e823 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,21 +177,15 @@ IF (USE_HDF5 OR ENABLE_NETCDF_4) SET(USE_HDF5 ON) SET(USE_NETCDF4 ON) - FIND_PACKAGE(HDF5 COMPONENTS C HL) - #FIND_LIBRARY(HDF5_LIBRARY NAMES hdf5) - #FIND_LIBRARY(HDF5_HL_LIBRARY NAMES hdf5_hl) - - #IF(NOT HDF5_LIBRARIES OR NOT HDF5_HL_LIBRARY) - # MESSAGE(FATAL_ERROR "HDF5 Not Found.") - #ENDIF() - IF(NOT HDF5_FOUND AND (NOT HDF5_LIBRARIES AND NOT HDF5_INCLUDE_DIRS)) - MESSAGE(FATAL_ERROR "HDF5 Not Found.") - ELSE() + IF(HD5_LIBRARIES AND HDF5_INCLUDE_DIRS) + SET(HDF5_FOUND ON) INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS}) - #MESSAGE(STATUS "HDF5_LIBRARY: ${HDF5_LIBRARY}") - #MESSAGE(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}") - #MESSAGE(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}") - #MESSAGE(STATUS "HDF5_HL_LIBRARIES: ${HDF5_HL_LIBRARIES}") + ELSE() + FIND_PACKAGE(HDF5 COMPONENTS C HL) + ENDIF() + + IF(NOT HDF5_FOUND) + MESSAGE(FATAL_ERROR "HDF5 Not Found.") ENDIF() INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIR})