diff options
| author | Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> | 2019-06-08 23:08:59 +0200 |
|---|---|---|
| committer | Curtis J Bezault <curtbezault@gmail.com> | 2019-06-08 14:08:59 -0700 |
| commit | 2ca347614929463fed9a3075902d455929026fa4 (patch) | |
| tree | 72e9746e4378512db6cfb9b5d12e0709ba6acf9f /ports/netcdf-c | |
| parent | 388d219f256b75452c088b4cc2e16fd38f7f6995 (diff) | |
| download | vcpkg-2ca347614929463fed9a3075902d455929026fa4.tar.gz vcpkg-2ca347614929463fed9a3075902d455929026fa4.zip | |
[netcdf-c/hdf5] improve/correct linkage (#6771)
* [netcdf_c] improve HDF5 linkage
* [hdf5] add required HDF5 definitions not set by findHDF5
* [netcdf-c] Call chain HDF5: -> vcpkg_cmake_wrapper (old behvior)
-> port supplied FindHDF5 -> includes hdf5Config from HDF5_ROOT
* [hdf5] fix szip linkage...again..
will now double link against szip target but thats better than before
the double link issue does not hurt and should be resolved upstream
* revert find_dependency
requires include(CMakeFindDependencyMacro)
* [netcdf-c] removed unnecessary patch
Diffstat (limited to 'ports/netcdf-c')
| -rw-r--r-- | ports/netcdf-c/CONTROL | 2 | ||||
| -rw-r--r-- | ports/netcdf-c/fix_curl_linkage.patch | 12 | ||||
| -rw-r--r-- | ports/netcdf-c/hdf5.patch | 27 | ||||
| -rw-r--r-- | ports/netcdf-c/hdf5_2.patch | 13 | ||||
| -rw-r--r-- | ports/netcdf-c/portfile.cmake | 15 | ||||
| -rw-r--r-- | ports/netcdf-c/transitive-hdf5.patch | 2 |
6 files changed, 56 insertions, 15 deletions
diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL index 902a166eb..e27c923f8 100644 --- a/ports/netcdf-c/CONTROL +++ b/ports/netcdf-c/CONTROL @@ -1,4 +1,4 @@ Source: netcdf-c -Version: 4.7.0 +Version: 4.7.0-1 Build-Depends: hdf5, curl Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. diff --git a/ports/netcdf-c/fix_curl_linkage.patch b/ports/netcdf-c/fix_curl_linkage.patch deleted file mode 100644 index 09fead1f0..000000000 --- a/ports/netcdf-c/fix_curl_linkage.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index eb0bc26b..f1409fc6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -783,6 +783,7 @@ IF(ENABLE_DAP) -
- ADD_DEFINITIONS(-DCURL_STATICLIB=1)
- INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
-+ LINK_LIBRARIES(${CURL_LIBRARIES})
-
- # Check to see if CURLOPT_USERNAME is defined.
- # It is present starting version 7.19.1.
diff --git a/ports/netcdf-c/hdf5.patch b/ports/netcdf-c/hdf5.patch new file mode 100644 index 000000000..71f4921ed --- /dev/null +++ b/ports/netcdf-c/hdf5.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3874c13..36f15beb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -599,11 +599,10 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + IF(NC_FIND_SHARED_LIBS) + SET(NC_HDF5_LINK_TYPE "shared") + SET(NC_HDF5_LINK_TYPE_UPPER "SHARED") +- ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB) + ELSE(NC_FIND_SHARED_LIBS) + SET(NC_HDF5_LINK_TYPE "static") + SET(NC_HDF5_LINK_TYPE_UPPER "STATIC") +- ADD_DEFINITIONS(-DH5_BUILT_AS_STATIC_LIB) ++ SET(HDF5_USE_STATIC_LIBRARIES ON) + ENDIF(NC_FIND_SHARED_LIBS) + + #####
+@@ -614,8 +615,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4) + # had worked.
+ #####
+ 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}) ++ FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) + ELSE(MSVC)
+ FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
+ ENDIF(MSVC)
diff --git a/ports/netcdf-c/hdf5_2.patch b/ports/netcdf-c/hdf5_2.patch new file mode 100644 index 000000000..a3a3fb751 --- /dev/null +++ b/ports/netcdf-c/hdf5_2.patch @@ -0,0 +1,13 @@ +diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt +index ea9b0294..3c7f427d 100644 +--- a/liblib/CMakeLists.txt ++++ b/liblib/CMakeLists.txt +@@ -83,7 +83,7 @@ IF(USE_HDF5 OR USE_NETCDF4) + # HDF5_HL_LIBRARY. + SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) + ELSE() # Windows CMake defines HDF5_LIBRARIES. +- SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) ++ SET(TLL_LIBS ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY}) + ENDIF() + ENDIF() + diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake index a965ce70e..37ed2f04e 100644 --- a/ports/netcdf-c/portfile.cmake +++ b/ports/netcdf-c/portfile.cmake @@ -10,9 +10,20 @@ vcpkg_from_github( no-install-deps.patch config-pkg-location.patch transitive-hdf5.patch - fix_curl_linkage.patch + hdf5.patch + hdf5_2.patch ) +#Remove outdated find modules +file(REMOVE "${SOURCE_PATH}/cmake/modules/FindSZIP.cmake") +file(REMOVE "${SOURCE_PATH}/cmake/modules/FindZLIB.cmake") + +if(VCPKG_CRT_LINKAGE STREQUAL "static") + set(NC_USE_STATIC_CRT ON) +else() + set(NC_USE_STATIC_CRT OFF) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE @@ -22,9 +33,11 @@ vcpkg_configure_cmake( -DBUILD_TESTING=OFF -DENABLE_EXAMPLES=OFF -DENABLE_TESTS=OFF + -DENABLE_FILTER_TESTING=OFF -DUSE_HDF5=ON -DENABLE_DAP_REMOTE_TESTS=OFF -DDISABLE_INSTALL_DEPENDENCIES=ON + -DNC_USE_STATIC_CRT=${NC_USE_STATIC_CRT} -DConfigPackageLocation=share/netcdf ) diff --git a/ports/netcdf-c/transitive-hdf5.patch b/ports/netcdf-c/transitive-hdf5.patch index 220640366..89773e6d4 100644 --- a/ports/netcdf-c/transitive-hdf5.patch +++ b/ports/netcdf-c/transitive-hdf5.patch @@ -6,7 +6,7 @@ index 6f4ccf8..14a3743 100644 set(netCDF_LIBRARIES netcdf) -+find_package(HDF5 REQUIRED) ++find_package(HDF5 COMPONENTS C HL CONFIG REQUIRED) + # include target information include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake") |
