2019-10-05 19:25:31 +00:00
|
|
|
option (ENABLE_H3 "Enable H3" ${ENABLE_LIBRARIES})
|
2020-08-13 20:10:06 +00:00
|
|
|
if (ENABLE_H3)
|
2019-10-05 19:25:31 +00:00
|
|
|
|
2020-08-13 20:10:06 +00:00
|
|
|
option (USE_INTERNAL_H3_LIBRARY "Set to FALSE to use system h3 library instead of bundled" ${NOT_UNBUNDLED})
|
2019-03-25 14:34:52 +00:00
|
|
|
|
2019-10-05 19:25:31 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include/h3Index.h")
|
|
|
|
if(USE_INTERNAL_H3_LIBRARY)
|
2020-08-13 20:10:06 +00:00
|
|
|
message(WARNING "submodule contrib/h3 is missing. to fix try run: \n git submodule update --init --recursive")
|
2019-10-05 19:25:31 +00:00
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_H3_LIBRARY 1)
|
2020-08-13 20:10:06 +00:00
|
|
|
set(USE_INTERNAL_H3_LIBRARY 0)
|
2019-10-05 19:25:31 +00:00
|
|
|
endif()
|
2019-06-26 11:52:36 +00:00
|
|
|
|
2020-08-13 20:10:06 +00:00
|
|
|
if (USE_INTERNAL_H3_LIBRARY)
|
|
|
|
set (H3_LIBRARY h3)
|
|
|
|
set (H3_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/h3/src/h3lib/include)
|
|
|
|
elseif (NOT MISSING_INTERNAL_H3_LIBRARY)
|
|
|
|
find_library (H3_LIBRARY h3)
|
|
|
|
find_path (H3_INCLUDE_DIR NAMES h3/h3api.h PATHS ${H3_INCLUDE_PATHS})
|
|
|
|
endif ()
|
2019-03-25 14:34:52 +00:00
|
|
|
|
|
|
|
if (H3_LIBRARY AND H3_INCLUDE_DIR)
|
|
|
|
set (USE_H3 1)
|
2020-08-13 20:10:06 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
endif ()
|
2019-03-25 14:34:52 +00:00
|
|
|
|
|
|
|
message (STATUS "Using h3=${USE_H3}: ${H3_INCLUDE_DIR} : ${H3_LIBRARY}")
|