vcpkg/ports/liblzma/portfile.cmake
2018-08-01 11:14:10 +02:00

38 lines
1.2 KiB
CMake

if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "${PORT} does not currently support UWP")
endif()
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xz-mirror/xz
REF 06eebd4543196ded36fa9b8b9544195b38b24ef2
SHA512 978f49412bb8edaf3ca9b3db958f2f558cceb674a8b1dc641e8030249e48a08a14ed4a637140a922ac2a873fc66a610e4bb87bcb8812f80a072caa29403fdc8c
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
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)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/liblzma)