vcpkg/ports/liblzma/portfile.cmake

79 lines
2.8 KiB
CMake
Raw Normal View History

vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO lzmautils
FILENAME "xz-${VERSION}.tar.xz"
SHA512 f890ee5207799fbc7bb9ae031f444d39d82275b0e1b8cc7f01fdb9270050e38849bd1269db2a2f12fe87b5e23e03f9e809a5c3456d066c0a56e6f98d728553ea
2019-03-29 05:38:44 +08:00
PATCHES
fix_config_include.patch
win_output_name.patch # Fix output name on Windows. Autotool build does not generate lib prefixed libraries on windows.
add_support_ios.patch # add install bundle info for support ios
build-tools.patch
2018-07-15 05:03:36 +08:00
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DCREATE_XZ_SYMLINKS=OFF
-DCREATE_LZMA_SYMLINKS=OFF
MAYBE_UNUSED_VARIABLES
CREATE_XZ_SYMLINKS
CREATE_LZMA_SYMLINKS
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
set(PACKAGE_URL https://tukaani.org/xz/)
set(PACKAGE_VERSION 5.2.5)
if(NOT VCPKG_TARGET_IS_WINDOWS)
set(PTHREAD_CFLAGS -pthread)
endif()
set(prefix "${CURRENT_INSTALLED_DIR}")
configure_file("${SOURCE_PATH}/src/liblzma/liblzma.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/liblzma.pc" @ONLY)
if (NOT VCPKG_BUILD_TYPE)
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
configure_file("${SOURCE_PATH}/src/liblzma/liblzma.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/liblzma.pc" @ONLY)
endif()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/liblzma)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/lzma.h" "defined(LZMA_API_STATIC)" "1")
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/lzma.h" "defined(LZMA_API_STATIC)" "0")
endif()
[LibLZMA] automatic configuration (#6000) * [LibLZMA] add a config-generated by CMake * bump control files of LibLZMA and dependent ports * [tiff] use proper liblzma target [OpenCV] add an explicit dependency on LibLZMA for static linking * [liblzma] fix header install path * [LibLZMA] avoid using targets in old symbols * fixes for windows-static and trying to see if CI is happier with a share/lib folder written in lowercase * [LibLZMA] use only modern CMake language, remove patch in favour of target public definition * [lzma] put symbols in cmake cache * [libxmlpp] remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS regression * [lzma] fix header install path * [liblzma] install wrapper to force config mode * [liblzma] remove function check inside cmake config since we know it will pass * [liblzma] wrapper fix * [tiff,geotiff] general cleanup and patch fixes * [libgeotiff] remove debug tools * [tesseract] modernize * [tiff] fix also tiff_library symbol * [pdal,libgeotiff] better library integration * [tiff] restore using unix i/o on UWP, since it was working... for sure win32 one cannot work * [tiff] enable lzma also on uwp, since it works and is requested by many dependencies * [selene] enable build on arm/arm64-windows, which was surely broken before * [lzma] uniform naming with cmake 3.14 * [podofo] fix regression, it requires openssl which was disabled in dependencies * [many ports] remove unnecessary mods * [boost-iostream] chmod * [openssl] fix regression due to missing architecture * [podofo] fix regression on uwp due to missing include * [libpq] explicitly fail on UWP, it should avoid being marked as regression * [shiva] fix regression on linux
2019-05-29 07:58:00 +08:00
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/man"
)
set(TOOLS xz xzdec)
foreach(_tool IN LISTS TOOLS)
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/bin/${_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
list(REMOVE_ITEM TOOLS ${_tool})
endif()
endforeach()
if(TOOLS)
vcpkg_copy_tools(TOOL_NAMES ${TOOLS} AUTO_CLEAN)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)