diff --git a/ports/szip/CONTROL b/ports/szip/CONTROL new file mode 100644 index 0000000000..cabcb582b0 --- /dev/null +++ b/ports/szip/CONTROL @@ -0,0 +1,3 @@ +Source: szip +Version: 2.1 +Description: Szip compression software, providing lossless compression of scientific data diff --git a/ports/szip/disable-static-lib-in-shared-build.patch b/ports/szip/disable-static-lib-in-shared-build.patch new file mode 100644 index 0000000000..f06e6dcf63 --- /dev/null +++ b/ports/szip/disable-static-lib-in-shared-build.patch @@ -0,0 +1,39 @@ +--- a/src/CMakeLists.txt Mon Aug 03 17:10:33 2015 ++++ b/src/CMakeLists.txt Fri Jan 13 09:38:07 2017 +@@ -22,20 +22,22 @@ + ${SZIP_SRC_SOURCE_DIR}/szlib.h + ) + +-add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) +-#set_target_properties (${SZIP_LIB_TARGET} +-# PROPERTIES +-# LINK_FLAGS "-version-info 2:0:0" +-#) +-TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") +-target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) +-set_target_properties(${SZIP_LIB_TARGET} PROPERTIES +- PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" +- INTERFACE_INCLUDE_DIRECTORIES "$/include>" +-) +-set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) +-SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) +-set (install_targets ${SZIP_LIB_TARGET}) ++if (NOT BUILD_SHARED_LIBS) ++ add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) ++ #set_target_properties (${SZIP_LIB_TARGET} ++ # PROPERTIES ++ # LINK_FLAGS "-version-info 2:0:0" ++ #) ++ TARGET_C_PROPERTIES (${SZIP_LIB_TARGET} STATIC " " " ") ++ target_link_libraries (${SZIP_LIB_TARGET} ${LINK_LIBS}) ++ set_target_properties(${SZIP_LIB_TARGET} PROPERTIES ++ PUBLIC_HEADER "${SZIP_PUBLIC_HEADERS}" ++ INTERFACE_INCLUDE_DIRECTORIES "$/include>" ++ ) ++ set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) ++ SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) ++ set (install_targets ${SZIP_LIB_TARGET}) ++endif() + + if (BUILD_SHARED_LIBS) + add_library (${SZIP_LIBSH_TARGET} SHARED ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) diff --git a/ports/szip/portfile.cmake b/ports/szip/portfile.cmake new file mode 100644 index 0000000000..06040cedc3 --- /dev/null +++ b/ports/szip/portfile.cmake @@ -0,0 +1,48 @@ +include(vcpkg_common_functions) + +# set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/szip-2.1) +# vcpkg_download_distfile(ARCHIVE +# URLS "https://support.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz" +# FILENAME "szip-2.1.tar.gz" +# SHA512 ea91b877bb061fe6c96988a3c4b705e101a6950e34e9be53d6a57455c6a625be0afa60f4a3cfdd09649205b9f8586cc25ea60fe07a8131579acf3826b35fb749 +# ) +# vcpkg_extract_source_archive(${ARCHIVE}) + +# NOTE: We use Szip from the HDF5 cmake package dir, because it includes a lot of fixes for the CMake build files + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CMake-hdf5-1.10.0-patch1) +vcpkg_download_distfile(ARCHIVE + URLS "http://hdf4.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.zip" + FILENAME "CMake-hdf5-1.10.0-patch1.zip" + SHA512 ec2edb43438661323be5998ecf64c4dd537ddc7451e31f89390260d16883e60a1ccc1bf745bcb809af22f2bf7157d50331a33910b8ebf5c59cd50693dfb2ef8f +) +vcpkg_extract_source_archive(${ARCHIVE}) +set(ARCHIVE ${SOURCE_PATH}/SZip.tar.gz) +vcpkg_extract_source_archive(${ARCHIVE}) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Szip) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/disable-static-lib-in-shared-build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=1 + -DSZIP_INSTALL_DATA_DIR=share/szip/data + -DSZIP_INSTALL_CMAKE_DIR=share/szip +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(RENAME ${CURRENT_PACKAGES_DIR}/share/szip/data/COPYING ${CURRENT_PACKAGES_DIR}/share/szip/copyright) + +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/szip/szip-targets-debug.cmake SZIP_TARGETS_DEBUG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SZIP_TARGETS_DEBUG_MODULE "${SZIP_TARGETS_DEBUG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/szip/szip-targets-debug.cmake "${SZIP_TARGETS_DEBUG_MODULE}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)