diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/modern-cpp-kafka | |
Diffstat (limited to 'vcpkg/ports/modern-cpp-kafka')
| -rw-r--r-- | vcpkg/ports/modern-cpp-kafka/CMakeLists.txt | 27 | ||||
| -rw-r--r-- | vcpkg/ports/modern-cpp-kafka/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/modern-cpp-kafka/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/modern-cpp-kafka/vcpkg.json | 20 |
4 files changed, 83 insertions, 0 deletions
diff --git a/vcpkg/ports/modern-cpp-kafka/CMakeLists.txt b/vcpkg/ports/modern-cpp-kafka/CMakeLists.txt new file mode 100644 index 0000000..5dc8106 --- /dev/null +++ b/vcpkg/ports/modern-cpp-kafka/CMakeLists.txt @@ -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}" +) diff --git a/vcpkg/ports/modern-cpp-kafka/portfile.cmake b/vcpkg/ports/modern-cpp-kafka/portfile.cmake new file mode 100644 index 0000000..87b57bf --- /dev/null +++ b/vcpkg/ports/modern-cpp-kafka/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO morganstanley/modern-cpp-kafka + REF "v${VERSION}" + SHA512 a6a921cc5037baaa0632fed350b4b5a3d5d47116397ae2638f9121997dbf7842d6406a889833ae551d738cd1bb189c5cec152b14f59644aec38ac9b6b5883a0b + 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}") diff --git a/vcpkg/ports/modern-cpp-kafka/usage b/vcpkg/ports/modern-cpp-kafka/usage new file mode 100644 index 0000000..6ed3611 --- /dev/null +++ b/vcpkg/ports/modern-cpp-kafka/usage @@ -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) diff --git a/vcpkg/ports/modern-cpp-kafka/vcpkg.json b/vcpkg/ports/modern-cpp-kafka/vcpkg.json new file mode 100644 index 0000000..8935e88 --- /dev/null +++ b/vcpkg/ports/modern-cpp-kafka/vcpkg.json @@ -0,0 +1,20 @@ +{ + "name": "modern-cpp-kafka", + "version-string": "2024.07.03", + "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 + } + ] +} |