diff --git a/CMakeLists.txt b/CMakeLists.txt index cb80d05e9..5452946d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,7 +401,12 @@ IF (USE_HDF5 OR ENABLE_NETCDF_4) SET(HDF5_LIBRARIES ${HDF5_LIB} ${HDF5_HL_LIB}) SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR}) ELSE() - FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED) + IF(MSVC) + FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED) + ELSE() + FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + ENDIF() + ENDIF() INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})