Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change Kafka find #347

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,20 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Boost 1.70 REQUIRED COMPONENTS unit_test_framework program_options system)
find_package(ApMon MODULE)
find_package(CURL MODULE)
find_package(RdKafka CONFIG)
find_package(InfoLogger CONFIG)
find_package(Protobuf CONFIG)
find_package(gRPC CONFIG)

if(RDKAFKA_ROOT)
message("RDKAFKA_ROOT set, we enable corresponding libs and binaries")
find_library(RDKAFKA_LIB "rdkafka++" REQUIRED PATHS ${RDKAFKA_ROOT}/lib)
set(RDKAFKA_INCLUDE "${RDKAFKA_ROOT}/include")
set(RdKafka_FOUND true)
else()
message("RDKAFKA_ROOT not set, corresponding libs and binaries won't be built")
endif()


####################################
# Set OUTPUT vars
####################################
Expand Down Expand Up @@ -142,6 +151,7 @@ target_include_directories(Monitoring
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${RDKAFKA_INCLUDE}>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
Expand All @@ -153,7 +163,8 @@ set_target_properties(Monitoring PROPERTIES OUTPUT_NAME "O2Monitoring")
target_link_libraries(Monitoring
PUBLIC
Boost::boost
$<$<BOOL:${RdKafka_FOUND}>:RdKafka::rdkafka++>

$<$<BOOL:${RdKafka_FOUND}>:${RDKAFKA_LIB}>
PRIVATE
Boost::system
pthread
Expand All @@ -169,6 +180,8 @@ endif()

if(RdKafka_FOUND)
message(STATUS " Compiling Kafka transport")
else()
message(STATUS " Kafka not found. Corresponding features disabled.")
endif()

if(CURL_FOUND)
Expand Down
Loading