diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL index ee49b173372..baf0147c68b 100644 --- a/ports/netcdf-cxx4/CONTROL +++ b/ports/netcdf-cxx4/CONTROL @@ -1,5 +1,5 @@ Source: netcdf-cxx4 Version: 4.3.1 -Build-Depends: netcdf-c +Build-Depends: hdf5, netcdf-c Homepage: https://github.com/Unidata/netcdf-cxx4 Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch index 2e8fa423cc3..5d289ec2efd 100644 --- a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch +++ b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch @@ -11,3 +11,22 @@ index 60c699d..6bd7822 100644 IF(NOT HAVE_H5FREE_MEMORY) MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.") SET(NC_HAS_DEF_VAR_FILTER "") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6a48709..79de128 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -399,7 +399,13 @@ IF(MSVC) + SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME}) + FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL NO_MODULES REQUIRED ${NC_HDF5_LINK_TYPE}) + ELSE(MSVC) +- FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) ++ FIND_PACKAGE(hdf5 CONFIG REQUIRED) ++ set(HDF5_FOUND ${hdf5_FOUND}) ++ if (BUILD_SHARED_LIBS) ++ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared hdf5::hdf5_hl-shared) ++ else() ++ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static hdf5::hdf5_hl-static) ++ endif() + ENDIF(MSVC) + + set(HAVE_H5FREE_MEMORY ON)