vcpkg/ports/liblzma/portfile.cmake

34 lines
1.2 KiB
CMake
Raw Normal View History

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "${PORT} does not currently support UWP")
endif()
2016-12-25 21:34:01 +08:00
include(vcpkg_common_functions)
2017-02-25 22:55:57 +08:00
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/xz-5.2.3)
2016-12-25 21:34:01 +08:00
vcpkg_download_distfile(ARCHIVE
2017-02-25 22:55:57 +08:00
URLS "http://tukaani.org/xz/xz-5.2.3.tar.gz"
FILENAME "xz-5.2.3.tar.gz"
SHA512 a5eb4f707cf31579d166a6f95dbac45cf7ea181036d1632b4f123a4072f502f8d57cd6e7d0588f0bf831a07b8fc4065d26589a25c399b95ddcf5f73435163da6)
2016-12-25 21:34:01 +08:00
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2017-02-25 22:55:57 +08:00
PREFER_NINJA
2016-12-25 21:34:01 +08:00
OPTIONS_DEBUG
-DLIBLZMA_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
PATCHES
${CMAKE_CURRENT_LIST_DIR}/auto-define-lzma-api-static.patch)
endif()
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/liblzma/COPYING ${CURRENT_PACKAGES_DIR}/share/liblzma/copyright)