2019-05-19 07:58:03 +02:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO lz4/lz4
|
2021-04-09 13:25:45 -04:00
|
|
|
REF v1.9.3
|
|
|
|
SHA512 c246b0bda881ee9399fa1be490fa39f43b291bb1d9db72dba8a85db1a50aad416a97e9b300eee3d2a4203c2bd88bda2762e81bc229c3aa409ad217eb306a454c
|
2019-05-19 07:58:03 +02:00
|
|
|
HEAD_REF dev
|
|
|
|
)
|
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
2019-05-19 07:58:03 +02:00
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-05-19 07:58:03 +02:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
|
|
|
)
|
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
vcpkg_cmake_install()
|
2019-05-19 07:58:03 +02:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(DLL_IMPORT "1 && defined(_MSC_VER)")
|
|
|
|
else()
|
|
|
|
set(DLL_IMPORT "0")
|
|
|
|
endif()
|
2019-05-19 07:58:03 +02:00
|
|
|
foreach(FILE lz4.h lz4frame.h)
|
2021-09-13 22:25:29 +02:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${FILE}"
|
|
|
|
"defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)"
|
|
|
|
"${DLL_IMPORT}"
|
|
|
|
)
|
2019-05-19 07:58:03 +02:00
|
|
|
endforeach()
|
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
vcpkg_cmake_config_fixup()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-09-24 21:06:17 +02:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/liblz4.pc" " -llz4" " -llz4d")
|
2021-09-13 22:25:29 +02:00
|
|
|
endif()
|
2019-05-19 07:58:03 +02:00
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2019-05-19 07:58:03 +02:00
|
|
|
|
2021-09-13 22:25:29 +02:00
|
|
|
file(INSTALL "${SOURCE_PATH}/lib/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|