Skip to content

Commit

Permalink
[netcdf-c] correctly fix hdf5 linkage (#7578)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann-A authored and cbezault committed Aug 7, 2019
1 parent 8157d85 commit c89dcc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ports/netcdf-c/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: netcdf-c
Version: 4.7.0-3
Version: 4.7.0-4
Build-Depends: hdf5, curl
Homepage: https://github.com/Unidata/netcdf-c
Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.
8 changes: 5 additions & 3 deletions ports/netcdf-c/hdf5_3.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ diff --git a/libhdf5/CMakeLists.txt b/libhdf5/CMakeLists.txt
index f3c7bbc..34fc2ab 100644
--- a/libhdf5/CMakeLists.txt
+++ b/libhdf5/CMakeLists.txt
@@ -20,3 +20,7 @@ add_library(netcdfhdf5 OBJECT ${libnchdf5_SOURCES})
@@ -20,3 +20,9 @@ add_library(netcdfhdf5 OBJECT ${libnchdf5_SOURCES})

# Remember to package this file for CMake builds.
ADD_EXTRA_DIST(${libnchdf5_SOURCES} CMakeLists.txt)
+
+if(BUILD_SHARED_LIBS)
+target_link_libraries(netcdfhdf5 PRIVATE hdf5::hdf5-shared hdf5::hdf5-static hdf5::hdf5_hl-shared hdf5::hdf5_hl-static)
+if(HDF5_BUILD_SHARED_LIBS)
+ target_link_libraries(netcdfhdf5 PRIVATE hdf5::hdf5-shared hdf5::hdf5_hl-shared)
+else()
+ target_link_libraries(netcdfhdf5 PRIVATE hdf5::hdf5-static hdf5::hdf5_hl-static)
+endif()

0 comments on commit c89dcc1

Please sign in to comment.