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

[OMON-793] Restore the kafka dependency. #344

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# Copyright 2019-2024 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand Down Expand Up @@ -76,11 +76,19 @@ 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 +150,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 +162,7 @@ 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 Down Expand Up @@ -247,8 +256,10 @@ foreach (example ${EXAMPLES})
add_executable(${example_name} ${example})
target_link_libraries(${example_name}
PRIVATE
pthread
Monitoring Boost::program_options
$<$<BOOL:${CURL_FOUND}>:CURL::libcurl>
$<$<BOOL:${RdKafka_FOUND}>:${RDKAFKA_LIB}>
)
endforeach()

Expand Down Expand Up @@ -290,6 +301,7 @@ if(RdKafka_FOUND AND Protobuf_FOUND AND CURL_FOUND)
Boost::program_options
protobuf::libprotobuf
$<$<BOOL:${InfoLogger_FOUND}>:AliceO2::InfoLogger>
$<$<BOOL:${RdKafka_FOUND}>:${RDKAFKA_LIB}>
)
target_compile_definitions(${example_name} PRIVATE $<$<BOOL:${InfoLogger_FOUND}>:O2_MONITORING_WITH_INFOLOGGER>)
target_include_directories(${example_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
Loading