2020-11-03 14:56:07 +00:00
|
|
|
# Needed when using Apache Avro serialization format
|
2020-01-08 09:13:12 +00:00
|
|
|
option (ENABLE_AVRO "Enable Avro" ${ENABLE_LIBRARIES})
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT ENABLE_AVRO)
|
|
|
|
if (USE_INTERNAL_AVRO_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal avro library with ENABLE_AVRO=OFF")
|
|
|
|
endif()
|
|
|
|
return()
|
|
|
|
endif()
|
2020-01-08 09:13:12 +00:00
|
|
|
|
2020-08-16 21:04:42 +00:00
|
|
|
option (USE_INTERNAL_AVRO_LIBRARY
|
|
|
|
"Set to FALSE to use system avro library instead of bundled" ON) # TODO: provide unbundled support
|
2020-01-08 09:13:12 +00:00
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/CMakeLists.txt")
|
|
|
|
if (USE_INTERNAL_AVRO_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message(WARNING "submodule contrib/avro is missing. to fix try run: \n git submodule update --init")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot find internal avro")
|
|
|
|
set(USE_INTERNAL_AVRO_LIBRARY 0)
|
2020-01-08 09:13:12 +00:00
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_AVRO_LIBRARY 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT USE_INTERNAL_AVRO_LIBRARY)
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Using system avro library is not supported yet")
|
2020-01-08 09:13:12 +00:00
|
|
|
elseif(NOT MISSING_INTERNAL_AVRO_LIBRARY)
|
|
|
|
include(cmake/find/snappy.cmake)
|
|
|
|
set(AVROCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/include")
|
2020-01-10 05:08:29 +00:00
|
|
|
set(AVROCPP_LIBRARY avrocpp)
|
2020-08-14 15:44:04 +00:00
|
|
|
set(USE_INTERNAL_AVRO_LIBRARY 1)
|
2020-01-08 09:13:12 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (AVROCPP_LIBRARY AND AVROCPP_INCLUDE_DIR)
|
|
|
|
set(USE_AVRO 1)
|
|
|
|
endif()
|
|
|
|
|
2020-01-10 05:08:29 +00:00
|
|
|
message (STATUS "Using avro=${USE_AVRO}: ${AVROCPP_INCLUDE_DIR} : ${AVROCPP_LIBRARY}")
|