early-access version 2853
This commit is contained in:
111
externals/vcpkg/ports/zkpp/CMakeLists.txt
vendored
Executable file
111
externals/vcpkg/ports/zkpp/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,111 @@
|
||||
#
|
||||
# This file is based on https://github.com/tgockel/zookeeper-cpp/blob/a8d5f905e01893256299d5532b1836f64c89b5b9/CMakeLists.txt
|
||||
# Which is licensed under Apache License 2.0
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
file(READ src/zk/config.hpp CONFIG_HPP_STR)
|
||||
string(REGEX REPLACE ".*# *define +ZKPP_VERSION_MAJOR +([0-9]+).*" "\\1" ZKPP_VERSION_MAJOR "${CONFIG_HPP_STR}")
|
||||
string(REGEX REPLACE ".*# *define +ZKPP_VERSION_MINOR +([0-9]+).*" "\\1" ZKPP_VERSION_MINOR "${CONFIG_HPP_STR}")
|
||||
string(REGEX REPLACE ".*# *define +ZKPP_VERSION_PATCH +([0-9]+).*" "\\1" ZKPP_VERSION_PATCH "${CONFIG_HPP_STR}")
|
||||
|
||||
set(ZKPP_VERSION "${ZKPP_VERSION_MAJOR}.${ZKPP_VERSION_MINOR}.${ZKPP_VERSION_PATCH}")
|
||||
project(zookeeper-cpp
|
||||
LANGUAGES CXX
|
||||
VERSION "${ZKPP_VERSION}"
|
||||
)
|
||||
set(PROJECT_SO_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
|
||||
message(STATUS "Software Version: ${ZKPP_VERSION}")
|
||||
|
||||
################################################################################
|
||||
# CMake #
|
||||
################################################################################
|
||||
|
||||
cmake_policy(VERSION 3.5)
|
||||
cmake_policy(SET CMP0037 OLD) # allow generation of "test" target
|
||||
set(CMAKE_REQUIRED_QUIET YES) # tell check_include_file_cxx to keep quiet
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
|
||||
include(BuildFunctions)
|
||||
include(CheckIncludeFileCXX)
|
||||
include(ConfigurationSetting)
|
||||
include(ListSplit)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
################################################################################
|
||||
# Build Configuration #
|
||||
################################################################################
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
message(STATUS "No build type selected, default to ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
set(VALID_BUILD_TYPES Debug Release)
|
||||
if(NOT ${CMAKE_BUILD_TYPE} IN_LIST VALID_BUILD_TYPES)
|
||||
message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}\nValid build types are: ${VALID_BUILD_TYPES}")
|
||||
endif()
|
||||
message(STATUS "Configuration: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
message(STATUS "Features:")
|
||||
build_option(NAME CODE_COVERAGE
|
||||
DOC "Enable code coverage (turns on the test-coverage target)"
|
||||
DEFAULT OFF
|
||||
CONFIGS_ON Debug
|
||||
)
|
||||
|
||||
configuration_setting(NAME BUFFER
|
||||
DOC "Type to use for zk::buffer"
|
||||
DEFAULT STD_VECTOR
|
||||
OPTIONS
|
||||
STD_VECTOR
|
||||
CUSTOM
|
||||
)
|
||||
|
||||
configuration_setting(NAME FUTURE
|
||||
DOC "Type to use for zk::future<T> and zk::promise<T>"
|
||||
DEFAULT STD
|
||||
OPTIONS
|
||||
STD
|
||||
STD_EXPERIMENTAL
|
||||
CUSTOM
|
||||
)
|
||||
|
||||
set(CXX_STANDARD c++17
|
||||
CACHE STRING "The language standard to target for C++."
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=${CXX_STANDARD}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DZKPP_DEBUG=1")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||
|
||||
################################################################################
|
||||
# External Libraries #
|
||||
################################################################################
|
||||
|
||||
find_package(zookeeper REQUIRED)
|
||||
|
||||
|
||||
build_module(NAME zkpp
|
||||
PATH src/zk
|
||||
NO_RECURSE
|
||||
)
|
||||
|
||||
target_include_directories(zkpp PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
||||
target_link_libraries(zkpp PRIVATE zookeeper::zookeeper)
|
||||
|
||||
install(TARGETS zkpp
|
||||
EXPORT zkpp
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
install(FILES ${zkpp_LIBRARY_HEADERS} DESTINATION include/zk/)
|
||||
|
||||
install(EXPORT zkpp DESTINATION share/zkpp/ FILE zkppConfig.cmake)
|
||||
26
externals/vcpkg/ports/zkpp/portfile.cmake
vendored
Executable file
26
externals/vcpkg/ports/zkpp/portfile.cmake
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO tgockel/zookeeper-cpp
|
||||
REF v0.2.3
|
||||
SHA512 086f31d4ca53f5a585fd8640caf9f2f21c90cf46d9cfe6c0e8e5b8c620e73265bb8aebec62ea4328f3f098a9b3000280582569966c0d3401627ab8c3edc31ca8
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
file(GLOB_RECURSE test_files LIST_DIRECTORIES false "${SOURCE_PATH}/src/zk/*_tests.cpp")
|
||||
if (NOT "${test_files}" STREQUAL "")
|
||||
file(REMOVE ${test_files})
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
vcpkg_copy_pdbs()
|
||||
11
externals/vcpkg/ports/zkpp/vcpkg.json
vendored
Executable file
11
externals/vcpkg/ports/zkpp/vcpkg.json
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "zkpp",
|
||||
"version": "0.2.3",
|
||||
"port-version": 2,
|
||||
"description": "A ZooKeeper client for C++.",
|
||||
"homepage": "https://github.com/tgockel/zookeeper-cpp",
|
||||
"supports": "!windows",
|
||||
"dependencies": [
|
||||
"zookeeper"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user