2020-01-08 09:13:12 +00:00
|
|
|
option (ENABLE_AVRO "Enable Avro" ${ENABLE_LIBRARIES})
|
|
|
|
|
|
|
|
if (ENABLE_AVRO)
|
|
|
|
|
2020-01-10 22:46:48 +00:00
|
|
|
option (USE_INTERNAL_AVRO_LIBRARY "Set to FALSE to use system avro library instead of bundled" ${NOT_UNBUNDLED})
|
2020-01-08 09:13:12 +00:00
|
|
|
|
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/CMakeLists.txt")
|
|
|
|
if(USE_INTERNAL_AVRO_LIBRARY)
|
|
|
|
message(WARNING "submodule contrib/avro is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_AVRO_LIBRARY 1)
|
|
|
|
set(USE_INTERNAL_AVRO_LIBRARY 0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT USE_INTERNAL_AVRO_LIBRARY)
|
|
|
|
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-01-08 09:13:12 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (AVROCPP_LIBRARY AND AVROCPP_INCLUDE_DIR)
|
|
|
|
set(USE_AVRO 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2020-01-10 05:08:29 +00:00
|
|
|
message (STATUS "Using avro=${USE_AVRO}: ${AVROCPP_INCLUDE_DIR} : ${AVROCPP_LIBRARY}")
|