mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 01:59:00 +08:00
[librdkafka] Add vcpkg-cmake-wrapper.cmake (#8355)
* [librdkafka] Add vcpkg-cmake-wrapper.cmake * Update changes
This commit is contained in:
parent
77a0a4a615
commit
adfa6fd359
@ -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
|
||||
|
||||
|
45
ports/librdkafka/vcpkg-cmake-wrapper.cmake
Normal file
45
ports/librdkafka/vcpkg-cmake-wrapper.cmake
Normal file
@ -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()
|
Loading…
Reference in New Issue
Block a user