diff --git a/modules/hdf/CMakeLists.txt b/modules/hdf/CMakeLists.txt index 2a1ae68bdf8..1f4b8679ce8 100644 --- a/modules/hdf/CMakeLists.txt +++ b/modules/hdf/CMakeLists.txt @@ -11,7 +11,14 @@ if(WIN32) mark_as_advanced(HDF5_LIBRARIES) mark_as_advanced(HDF5_C_LIBRARY) mark_as_advanced(HDF5_INCLUDE_DIRS) - add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB -D_HDF5USEDLL_) + if(HDF5_C_LIBRARY MATCHES "libhdf5.lib$") + set(HDF5_LIBRARIES "${HDF5_LIBRARIES};ShLwApi.Lib") + if(ZLIB_LIBRARY_RELEASE) + set(HDF5_LIBRARIES "${HDF5_LIBRARIES};${ZLIB_LIBRARY_RELEASE}") + endif() + else() + add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB -D_HDF5USEDLL_) + endif() else() set(HDF5_FOUND "NO") endif()