cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/find/cctz.cmake
23lines · modecode
6 years ago
| 1 | option (USE_INTERNAL_CCTZ_LIBRARY "Set to FALSE to use system cctz library instead of bundled" ${NOT_UNBUNDLED}) |
| 2 | |
| 3 | if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz/time_zone.h") |
| 4 | if(USE_INTERNAL_CCTZ_LIBRARY) |
| 5 | message(WARNING "submodule contrib/cctz is missing. to fix try run: \n git submodule update --init --recursive") |
| 6 | endif() |
| 7 | set(USE_INTERNAL_CCTZ_LIBRARY 0) |
| 8 | set(MISSING_INTERNAL_CCTZ_LIBRARY 1) |
| 9 | endif() |
| 10 | |
| 11 | if (NOT USE_INTERNAL_CCTZ_LIBRARY) |
| 12 | find_library (CCTZ_LIBRARY cctz) |
| 13 | find_path (CCTZ_INCLUDE_DIR NAMES cctz/civil_time.h civil_time.h PATHS ${CCTZ_INCLUDE_PATHS}) |
| 14 | endif () |
| 15 | |
| 16 | if (CCTZ_LIBRARY AND CCTZ_INCLUDE_DIR) |
| 17 | elseif (NOT MISSING_INTERNAL_CCTZ_LIBRARY) |
| 18 | set (USE_INTERNAL_CCTZ_LIBRARY 1) |
| 19 | set (CCTZ_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/cctz/include") |
| 20 | set (CCTZ_LIBRARY cctz) |
| 21 | endif () |
| 22 | |
| 23 | message (STATUS "Using cctz: ${CCTZ_INCLUDE_DIR} : ${CCTZ_LIBRARY}") |