diff options
| author | Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> | 2020-01-10 19:44:44 +0100 |
|---|---|---|
| committer | dan-shaw <51385773+dan-shaw@users.noreply.github.com> | 2020-01-10 10:44:44 -0800 |
| commit | 34edf6c569373826f9c17e68869078c5ef2de1e6 (patch) | |
| tree | b55b03b8c6e1f14d2c1fac72c068c4774cdaaf15 | |
| parent | 05069fe558751c31b4eb7fd36f22875061f75a10 (diff) | |
| download | vcpkg-34edf6c569373826f9c17e68869078c5ef2de1e6.tar.gz vcpkg-34edf6c569373826f9c17e68869078c5ef2de1e6.zip | |
[HDF5] Correct SZIP linkage, modernize portfile (#9413)
* [HDF5] Correct SZIP linkage, modernize portfile and make szip and zlib features instead of hard dependencies.
* fix the features variable
| -rw-r--r-- | ports/hdf5/CONTROL | 10 | ||||
| -rw-r--r-- | ports/hdf5/portfile.cmake | 29 |
2 files changed, 27 insertions, 12 deletions
diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index 94767867a..a8d27e029 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -2,7 +2,7 @@ Source: hdf5 Version: 1.10.5-9 Homepage: https://www.hdfgroup.org/downloads/hdf5/ Description: HDF5 is a data model, library, and file format for storing and managing data -Build-Depends: zlib, szip +Default-Features: szip, zlib Feature: parallel Description: parallel support for HDF5 @@ -10,3 +10,11 @@ Build-Depends: mpi Feature: cpp Description: Builds cpp lib + +Feature: szip +Description: Build with szip +Build-Depends: szip + +Feature: zlib +Description: Build with zlib +Build-Depends: zlib diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index a721d8358..d2b3a0c15 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -15,33 +15,38 @@ vcpkg_extract_source_archive_ex( fix-generate.patch ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - parallel HDF5_ENABLE_PARALLEL - cpp HDF5_BUILD_CPP_LIB -) - if ("parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES) message(FATAL_ERROR "Feature Parallel and C++ options are mutually exclusive.") endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + parallel HDF5_ENABLE_PARALLEL + cpp HDF5_BUILD_CPP_LIB + szip HDF5_ENABLE_SZIP_SUPPORT + szip HDF5_ENABLE_SZIP_ENCODING + zlib HDF5_ENABLE_Z_LIB_SUPPORT +) + file(REMOVE ${SOURCE_PATH}/config/cmake_ext_mod/FindSZIP.cmake)#Outdated; does not find debug szip +find_library(SZIP_RELEASE NAMES libsz libszip szip sz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(SZIP_DEBUG NAMES libsz libszip szip sz libsz_D libszip_D szip_D sz_D szip_debug PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/hdf5-1.10.5 DISABLE_PARALLEL_CONFIGURE PREFER_NINJA - OPTIONS ${FEATURE_OPTIONS} + OPTIONS + ${FEATURE_OPTIONS} -DBUILD_TESTING=OFF -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_BUILD_TOOLS=OFF - -DHDF5_ENABLE_Z_LIB_SUPPORT=ON - -DHDF5_ENABLE_SZIP_SUPPORT=ON - -DHDF5_ENABLE_SZIP_ENCODING=ON -DHDF5_INSTALL_DATA_DIR=share/hdf5/data -DHDF5_INSTALL_CMAKE_DIR=share + "-DSZIP_LIBRARY_DEBUG:PATH=${SZIP_DEBUG}" + "-DSZIP_LIBRARY_RELEASE:PATH=${SZIP_RELEASE}" ) - vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() @@ -54,5 +59,7 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/hdf5/data/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) + configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) |
