2017-11-27 02:28:16 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
message(FATAL_ERROR "${PORT} does not currently support UWP")
|
|
|
|
endif()
|
|
|
|
|
2017-01-11 19:18:49 +08:00
|
|
|
include(vcpkg_common_functions)
|
2019-03-15 05:29:33 +08:00
|
|
|
#set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CMake-hdf5-1.10.5/hdf5-1.10.5)
|
2017-01-11 19:18:49 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2019-03-15 05:29:33 +08:00
|
|
|
URLS "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/CMake-hdf5-1.10.5.tar.gz"
|
|
|
|
FILENAME "CMake-hdf5-1.10.5.tar.gz"
|
|
|
|
SHA512 a25ea28d7a511f9184d97b5b8cd4c6d52dcdcad2bffd670e24a1c9a6f98b03108014a853553fa2b00d4be7523128b5fd6a4454545e3b17ff8c66fea16a09e962
|
2017-01-11 19:18:49 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
2019-03-15 05:29:33 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF hdf5
|
2017-02-28 17:09:04 +08:00
|
|
|
PATCHES
|
2019-03-15 05:29:33 +08:00
|
|
|
hdf5_config.patch
|
2017-02-28 17:09:04 +08:00
|
|
|
)
|
2019-03-15 05:29:33 +08:00
|
|
|
set(SOURCE_PATH ${SOURCE_PATH}/hdf5-1.10.5)
|
2017-02-28 17:09:04 +08:00
|
|
|
|
2018-01-09 14:22:02 +08:00
|
|
|
if ("parallel" IN_LIST FEATURES)
|
|
|
|
set(ENABLE_PARALLEL ON)
|
|
|
|
else()
|
|
|
|
set(ENABLE_PARALLEL OFF)
|
|
|
|
endif()
|
|
|
|
|
2018-02-01 22:48:40 +08:00
|
|
|
if ("cpp" IN_LIST FEATURES)
|
|
|
|
set(ENABLE_CPP ON)
|
|
|
|
else()
|
|
|
|
set(ENABLE_CPP OFF)
|
|
|
|
endif()
|
|
|
|
|
2019-03-15 05:29:33 +08:00
|
|
|
#Note: HDF5 Builds by default static as well as shared libraries set BUILD_SHARED_LIBS to OFF to only get static libraries
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS)
|
|
|
|
|
2017-01-11 19:18:49 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-02-09 15:15:27 +08:00
|
|
|
PREFER_NINJA
|
2017-01-11 19:18:49 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DHDF5_BUILD_EXAMPLES=OFF
|
|
|
|
-DHDF5_BUILD_TOOLS=OFF
|
2019-03-15 05:29:33 +08:00
|
|
|
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
|
2018-02-01 22:48:40 +08:00
|
|
|
-DHDF5_BUILD_CPP_LIB=${ENABLE_CPP}
|
2018-01-09 14:22:02 +08:00
|
|
|
-DHDF5_ENABLE_PARALLEL=${ENABLE_PARALLEL}
|
2017-01-11 19:18:49 +08:00
|
|
|
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON
|
|
|
|
-DHDF5_ENABLE_SZIP_SUPPORT=ON
|
|
|
|
-DHDF5_ENABLE_SZIP_ENCODING=ON
|
|
|
|
-DHDF5_INSTALL_DATA_DIR=share/hdf5/data
|
2019-03-15 05:29:33 +08:00
|
|
|
-DHDF5_INSTALL_CMAKE_DIR=share
|
2017-01-11 19:18:49 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/hdf5/data/COPYING ${CURRENT_PACKAGES_DIR}/share/hdf5/copyright)
|
|
|
|
|
2017-11-09 07:33:01 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/hdf5)
|
2017-01-11 19:18:49 +08:00
|
|
|
|
2019-03-15 05:29:33 +08:00
|
|
|
#Linux build create additional scripts here. I dont know what they are doing so I am deleting them and hope for the best
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
2019-03-06 03:09:22 +08:00
|
|
|
|
2017-01-11 19:18:49 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|