diff --git a/ports/librdkafka/CONTROL b/ports/librdkafka/CONTROL index 78ece508b6..f88fa9bb32 100644 --- a/ports/librdkafka/CONTROL +++ b/ports/librdkafka/CONTROL @@ -1,5 +1,5 @@ Source: librdkafka -Version: 1.2.0-1 +Version: 1.2.0-2 Description: The Apache Kafka C/C++ library Homepage: https://github.com/edenhill/librdkafka diff --git a/ports/librdkafka/vcpkg-cmake-wrapper.cmake b/ports/librdkafka/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000000..6f32a45213 --- /dev/null +++ b/ports/librdkafka/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,45 @@ +include(SelectLibraryConfigurations) + +list(REMOVE_ITEM ARGS "NO_MODULE") +list(REMOVE_ITEM ARGS "CONFIG") +list(REMOVE_ITEM ARGS "MODULE") + +_find_package(${ARGS} CONFIG) + +if(RdKafka_FOUND) + if(TARGET RdKafka::rdkafka) + set(TARGET_NAME RdKafka::rdkafka) + else(TARGET RdKafka::rdkafka++) + set(TARGET_NAME RdKafka::rdkafka++) + endif() + + if(TARGET ${TARGET_NAME} AND NOT DEFINED RdKafka_INCLUDE_DIRS) + get_target_property(_RdKafka_INCLUDE_DIRS ${TARGET_NAME} INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(_RdKafka_LINK_LIBRARIES ${TARGET_NAME} INTERFACE_LINK_LIBRARIES) + + if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + get_target_property(_RdKafka_LIBRARY_DEBUG ${TARGET_NAME} IMPORTED_IMPLIB_DEBUG) + get_target_property(_RdKafka_LIBRARY_RELEASE ${TARGET_NAME} IMPORTED_IMPLIB_RELEASE) + endif() + + if(NOT _RdKafka_LIBRARY_DEBUG AND NOT _RdKafka_LIBRARY_RELEASE) + get_target_property(_RdKafka_LIBRARY_DEBUG ${TARGET_NAME} IMPORTED_LOCATION_DEBUG) + get_target_property(_RdKafka_LIBRARY_RELEASE ${TARGET_NAME} IMPORTED_LOCATION_RELEASE) + endif() + + set(RdKafka_INCLUDE_DIR "${_RdKafka_INCLUDE_DIRS}") + set(RdKafka_LIBRARY_DEBUG "${_RdKafka_LIBRARY_DEBUG}") + set(RdKafka_LIBRARY_RELEASE "${_RdKafka_LIBRARY_RELEASE}") + + select_library_configurations(RdKafka) + + list(APPEND RdKafka_LIBRARIES ${_RdKafka_LINK_LIBRARIES}) + list(APPEND RdKafka_LIBRARY ${_RdKafka_LINK_LIBRARIES}) + + unset(_RdKafka_INCLUDE_DIRS) + unset(_RdKafka_LINK_LIBRARIES) + unset(_RdKafka_LIBRARY_DEBUG) + unset(_RdKafka_LIBRARY_DEBUG) + unset(TARGET_NAME) + endif() +endif() \ No newline at end of file