vcpkg/ports/redis-plus-plus/portfile.cmake

51 lines
1.6 KiB
CMake
Raw Normal View History

2019-11-22 09:16:30 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO sewenew/redis-plus-plus
REF f3b19a8a1f609d1a1b79002802e5cf8c336dc262 # 1.3.7
SHA512 c99a4506be06224ebc4adaa29d5eeff0f6efae8b99e48ac02c26cec4a86fb46237a7d380ddb89eddc3d2e75c0c567e9b68610bcf271a0c708bca8ca6a5641075
2019-11-22 09:16:30 +08:00
HEAD_REF master
PATCHES
fix-conversion.patch
fix-dependency-libuv.patch
2019-11-22 09:16:30 +08:00
)
if("cxx17" IN_LIST FEATURES)
set(REDIS_PLUS_PLUS_CXX_STANDARD 17)
else()
set(REDIS_PLUS_PLUS_CXX_STANDARD 11)
endif()
set(EXTRA_OPT "")
if ("async" IN_LIST FEATURES)
list(APPEND EXTRA_OPT -DREDIS_PLUS_PLUS_BUILD_ASYNC="libuv")
endif()
if ("async-std" IN_LIST FEATURES)
list(APPEND EXTRA_OPT -DREDIS_PLUS_PLUS_ASYNC_FUTURE="std")
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" REDIS_PLUS_PLUS_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" REDIS_PLUS_PLUS_BUILD_SHARED)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DREDIS_PLUS_PLUS_USE_TLS=OFF
-DREDIS_PLUS_PLUS_BUILD_STATIC=${REDIS_PLUS_PLUS_BUILD_STATIC}
-DREDIS_PLUS_PLUS_BUILD_SHARED=${REDIS_PLUS_PLUS_BUILD_SHARED}
-DREDIS_PLUS_PLUS_BUILD_TEST=OFF
-DREDIS_PLUS_PLUS_CXX_STANDARD=${REDIS_PLUS_PLUS_CXX_STANDARD}
${EXTRA_OPT}
2019-11-22 09:16:30 +08:00
)
vcpkg_cmake_install()
2019-11-22 09:16:30 +08:00
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
2019-11-22 09:16:30 +08:00
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
vcpkg_fixup_pkgconfig()