2016-12-30 20:31:33 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-08-19 02:05:55 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO lz4/lz4
|
2018-05-11 04:15:00 +08:00
|
|
|
REF v1.8.2
|
|
|
|
SHA512 5fadc79334d37739c947d6dfc24f48ce82989fc5ee4f2bb8201ccf7ee3230b9e6e7c8488beb64050a035369f4247161d258bdb539578bec224ccebfef1b8a763
|
2017-08-19 02:05:55 +08:00
|
|
|
HEAD_REF dev)
|
2016-12-30 20:31:33 +08:00
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-02-25 22:46:19 +08:00
|
|
|
PREFER_NINJA
|
2016-12-30 20:31:33 +08:00
|
|
|
OPTIONS_DEBUG
|
2018-03-13 00:16:43 +08:00
|
|
|
-DLZ4_SKIP_INCLUDES=ON
|
|
|
|
-DCMAKE_DEBUG_POSTFIX=d)
|
2016-12-30 20:31:33 +08:00
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2017-08-19 02:05:55 +08:00
|
|
|
foreach(FILE lz4.h lz4frame.h)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/${FILE} LZ4_HEADER)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
string(REPLACE "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" "1" LZ4_HEADER "${LZ4_HEADER}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" "0" LZ4_HEADER "${LZ4_HEADER}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/${FILE} "${LZ4_HEADER}")
|
|
|
|
endforeach()
|
2016-12-30 20:31:33 +08:00
|
|
|
|
|
|
|
file(COPY ${SOURCE_PATH}/lib/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/lz4)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/lz4/LICENSE ${CURRENT_PACKAGES_DIR}/share/lz4/copyright)
|