[ppconsul] Add new port (#6911)

This commit is contained in:
Samuel Marks 2019-06-18 03:46:34 +10:00 committed by Phil Christensen
parent f00fbcb2e5
commit 783fa14d0b
3 changed files with 67 additions and 0 deletions

5
ports/ppconsul/CONTROL Normal file
View File

@ -0,0 +1,5 @@
Source: ppconsul
Version: 0.3
Homepage: https://github.com/oliora/ppconsul
Description: A C++ client library for Consul. Consul is a distributed tool for discovering and configuring services in your infrastructure.
Build-Depends: boost-core, boost-variant, curl[openssl]

View File

@ -0,0 +1,37 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92e4698..002981e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,8 @@ else ()
set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CURL_ROOT}/lib")
endif ()
find_package(CURL REQUIRED)
+ find_package(OpenSSL REQUIRED)
+ find_package(ZLIB REQUIRED)
endif ()
set(LIBB64_DIR "${PROJECT_SOURCE_DIR}/ext/b64")
@@ -89,7 +91,6 @@ endif()
add_subdirectory(ext/json11)
add_subdirectory(src)
-add_subdirectory(tests)
install(
DIRECTORY "${HEADERS_DIR}"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8e24aab..beaac68 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -85,7 +85,10 @@ if (${USE_CPPNETLIB})
target_link_libraries(${PROJECT_NAME} PRIVATE ${CPPNETLIB_LIBRARIES})
else ()
target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIR})
- target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})
+ target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ZLIB::ZLIB)
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ target_link_libraries(${PROJECT_NAME} PRIVATE "-framework CoreFoundation" "-framework Security")
+ endif ()
endif ()
source_group(${PROJECT_NAME} FILES ${SOURCES})

View File

@ -0,0 +1,25 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO oliora/ppconsul
REF fd3a22eba03a49623832a8f8c990fee499e3f8fb
SHA512 098f2fa0fdc3f219f5958d0d5b2a620231e3cd94dc3110cfbedb87e787e8402a7b0294f7ffa4fcb4169b0428b4f65376b621e5840706ff7cc8f02ac7fc1d7757
HEAD_REF master
PATCHES "cmake_build.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ppconsul RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()