-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[modern-cpp-kafka] New port (#32903)
* [modern-cpp-kafka] New port * update version database * fix dependencies * update version database * change header install path * update version database
- Loading branch information
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.12 FATAL_ERROR) | ||
|
||
project(modern-cpp-kafka LANGUAGES CXX) | ||
|
||
include(GNUInstallDirs) | ||
|
||
find_package(RdKafka CONFIG REQUIRED) | ||
find_package(Boost REQUIRED) | ||
find_package(RapidJSON CONFIG REQUIRED) | ||
|
||
add_library(modern-cpp-kafka INTERFACE) | ||
target_include_directories(modern-cpp-kafka INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | ||
target_link_libraries(modern-cpp-kafka INTERFACE RdKafka::rdkafka Boost::boost rapidjson) | ||
|
||
install(TARGETS modern-cpp-kafka EXPORT unofficial-modern-cpp-kafka) | ||
|
||
install( | ||
EXPORT unofficial-modern-cpp-kafka | ||
FILE unofficial-modern-cpp-kafka-config.cmake | ||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-modern-cpp-kafka" | ||
NAMESPACE unofficial::modern-cpp-kafka:: | ||
) | ||
|
||
install( | ||
DIRECTORY "${CMAKE_SOURCE_DIR}/include/kafka" | ||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO morganstanley/modern-cpp-kafka | ||
REF "v${VERSION}" | ||
SHA512 5071ba4aeb80d94fd078df054e3a36249e2e433bda2af4c26686cd5b0615d622cfd964c7193d075cc549a572cfa5b11bc4bbab9e00de7c80ea2bbf4a9d797201 | ||
HEAD_REF main | ||
) | ||
|
||
set(VCPKG_BUILD_TYPE release) # header-only port | ||
|
||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup() | ||
|
||
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-modern-cpp-kafka/unofficial-modern-cpp-kafka-config.cmake" cmake_config) | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-modern-cpp-kafka/unofficial-modern-cpp-kafka-config.cmake" | ||
"include(CMakeFindDependencyMacro) | ||
find_dependency(RdKafka CONFIG) | ||
find_dependency(Boost) | ||
find_dependency(RapidJSON CONFIG) | ||
${cmake_config} | ||
") | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
modern-cpp-kafka provides CMake targets: | ||
|
||
find_package(unofficial-modern-cpp-kafka CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE unofficial::modern-cpp-kafka::modern-cpp-kafka) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "modern-cpp-kafka", | ||
"version-string": "2023.03.07", | ||
"description": "A C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)", | ||
"homepage": "https://github.com/morganstanley/modern-cpp-kafka", | ||
"license": "Apache-2.0", | ||
"dependencies": [ | ||
"boost-optional", | ||
"librdkafka", | ||
"rapidjson", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "2da384edebac3371ee02b0a1d06606e93add35d5", | ||
"version-string": "2023.03.07", | ||
"port-version": 0 | ||
} | ||
] | ||
} |