2017-10-14 00:53:01 +00:00
|
|
|
option (ENABLE_RDKAFKA "Enable kafka" ON)
|
|
|
|
|
|
|
|
if (ENABLE_RDKAFKA)
|
|
|
|
|
2017-10-06 04:40:18 +00:00
|
|
|
option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2017-11-02 14:14:16 +00:00
|
|
|
if (USE_INTERNAL_RDKAFKA_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/CMakeLists.txt")
|
2017-10-20 17:59:44 +00:00
|
|
|
message (WARNING "submodule contrib/librdkafka is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
set (USE_INTERNAL_RDKAFKA_LIBRARY 0)
|
|
|
|
set (MISSING_INTERNAL_RDKAFKA_LIBRARY 1)
|
|
|
|
endif ()
|
|
|
|
|
2017-10-06 04:40:18 +00:00
|
|
|
if (NOT USE_INTERNAL_RDKAFKA_LIBRARY)
|
|
|
|
find_library (RDKAFKA_LIBRARY rdkafka)
|
|
|
|
find_path (RDKAFKA_INCLUDE_DIR NAMES librdkafka/rdkafka.h PATHS ${RDKAFKA_INCLUDE_PATHS})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (RDKAFKA_LIBRARY AND RDKAFKA_INCLUDE_DIR)
|
|
|
|
include_directories (${RDKAFKA_INCLUDE_DIR})
|
2017-10-20 17:59:44 +00:00
|
|
|
set (USE_RDKAFKA 1)
|
|
|
|
elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY)
|
2017-10-06 04:40:18 +00:00
|
|
|
set (USE_INTERNAL_RDKAFKA_LIBRARY 1)
|
|
|
|
set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src")
|
|
|
|
set (RDKAFKA_LIBRARY rdkafka)
|
2017-10-20 17:59:44 +00:00
|
|
|
set (USE_RDKAFKA 1)
|
2017-10-06 04:40:18 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-10-14 00:53:01 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY}")
|