2017-06-09 02:42:25 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Cylix/cpp_redis
|
2018-01-03 07:03:43 +08:00
|
|
|
REF 4.3.0
|
|
|
|
SHA512 d4a2865b72b4dfa80b6d3c004245014a77e74d4a3d254d6b0a9d50e890a22dc3d9ce54688a8c9185ecee9bbf8cdf76046a9788c70887ccf8a08d5cdcef298b46
|
2017-06-09 02:42:25 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2018-01-03 07:03:43 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/fix-export.patch
|
|
|
|
)
|
|
|
|
|
2017-08-02 06:23:45 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/tacopie/CMakeLists.txt DESTINATION ${SOURCE_PATH}/tacopie)
|
|
|
|
|
2017-08-02 05:55:47 +08:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
|
|
|
set(MSVC_RUNTIME_LIBRARY_CONFIG "/MD")
|
|
|
|
else()
|
|
|
|
set(MSVC_RUNTIME_LIBRARY_CONFIG "/MT")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# cpp-redis forcibly removes "/RTC1" in its cmake file. Because this is an ABI-sensitive flag, we need to re-add it in a form that won't be detected.
|
2017-08-02 06:23:45 +08:00
|
|
|
set(VCPKG_CXX_FLAGS_DEBUG "${VCPKG_CXX_FLAGS_DEBUG} -RTC1")
|
|
|
|
set(VCPKG_C_FLAGS_DEBUG "${VCPKG_C_FLAGS_DEBUG} -RTC1")
|
2017-06-09 02:42:25 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
2017-08-02 05:55:47 +08:00
|
|
|
OPTIONS
|
|
|
|
-DMSVC_RUNTIME_LIBRARY_CONFIG=${MSVC_RUNTIME_LIBRARY_CONFIG}
|
2018-01-03 07:03:43 +08:00
|
|
|
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE
|
2017-06-09 02:42:25 +08:00
|
|
|
)
|
|
|
|
|
2017-08-02 05:55:47 +08:00
|
|
|
vcpkg_install_cmake()
|
2017-06-09 02:42:25 +08:00
|
|
|
|
2018-01-03 07:03:43 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-08-02 05:55:47 +08:00
|
|
|
|
|
|
|
file(GLOB_RECURSE FILES "${CURRENT_PACKAGES_DIR}/include/*")
|
|
|
|
foreach(file ${FILES})
|
|
|
|
file(READ ${file} _contents)
|
2017-08-02 06:23:45 +08:00
|
|
|
string(REPLACE "ifndef __CPP_REDIS_USE_CUSTOM_TCP_CLIENT" "if 1" _contents "${_contents}")
|
2017-08-02 05:55:47 +08:00
|
|
|
file(WRITE ${file} "${_contents}")
|
|
|
|
endforeach()
|
2017-06-09 02:42:25 +08:00
|
|
|
|
2018-01-03 07:03:43 +08:00
|
|
|
file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/lib ${CURRENT_PACKAGES_DIR}/debug/bin/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
|
|
|
|
file(COPY ${CURRENT_PACKAGES_DIR}/lib/lib ${CURRENT_PACKAGES_DIR}/bin/bin DESTINATION ${CURRENT_PACKAGES_DIR})
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/lib ${CURRENT_PACKAGES_DIR}/debug/bin/bin ${CURRENT_PACKAGES_DIR}/lib/lib ${CURRENT_PACKAGES_DIR}/bin/bin)
|
|
|
|
|
2017-06-09 02:42:25 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpp-redis RENAME copyright)
|
|
|
|
|
2018-01-03 07:03:43 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
|
2017-06-09 02:42:25 +08:00
|
|
|
vcpkg_copy_pdbs()
|