cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/find/avro.cmake
28lines · modecode
6 years ago
| 1 | option (ENABLE_AVRO "Enable Avro" ${ENABLE_LIBRARIES}) |
| 2 | |
| 3 | if (ENABLE_AVRO) |
| 4 | |
| 5 | option (USE_INTERNAL_AVRO_LIBRARY "Set to FALSE to use system avro library instead of bundled" ${NOT_UNBUNDLED}) |
| 6 | |
| 7 | if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/CMakeLists.txt") |
| 8 | if(USE_INTERNAL_AVRO_LIBRARY) |
| 9 | message(WARNING "submodule contrib/avro is missing. to fix try run: \n git submodule update --init --recursive") |
| 10 | endif() |
| 11 | set(MISSING_INTERNAL_AVRO_LIBRARY 1) |
| 12 | set(USE_INTERNAL_AVRO_LIBRARY 0) |
| 13 | endif() |
| 14 | |
| 15 | if (NOT USE_INTERNAL_AVRO_LIBRARY) |
| 16 | elseif(NOT MISSING_INTERNAL_AVRO_LIBRARY) |
| 17 | include(cmake/find/snappy.cmake) |
| 18 | set(AVROCPP_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/avro/lang/c++/include") |
| 19 | set(AVROCPP_LIBRARY avrocpp) |
| 20 | endif () |
| 21 | |
| 22 | if (AVROCPP_LIBRARY AND AVROCPP_INCLUDE_DIR) |
| 23 | set(USE_AVRO 1) |
| 24 | endif() |
| 25 | |
| 26 | endif() |
| 27 | |
| 28 | message (STATUS "Using avro=${USE_AVRO}: ${AVROCPP_INCLUDE_DIR} : ${AVROCPP_LIBRARY}") |