2019-10-05 19:25:31 +00:00
|
|
|
option (ENABLE_CAPNP "Enable Cap'n Proto" ${ENABLE_LIBRARIES})
|
2017-10-04 00:00:22 +00:00
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if (NOT ENABLE_CAPNP)
|
|
|
|
if (USE_INTERNAL_CAPNP_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal capnproto library with ENABLE_CAPNP=OFF")
|
|
|
|
endif()
|
|
|
|
return()
|
|
|
|
endif()
|
2018-01-11 18:39:52 +00:00
|
|
|
|
2021-11-21 10:58:26 +00:00
|
|
|
option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ON)
|
2019-08-28 20:49:37 +00:00
|
|
|
|
2021-10-24 07:11:23 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/capnproto/c++")
|
2019-10-30 20:34:06 +00:00
|
|
|
if(USE_INTERNAL_CAPNP_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message(WARNING "submodule contrib/capnproto 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 capnproto")
|
|
|
|
set(USE_INTERNAL_CAPNP_LIBRARY 0)
|
2019-10-30 20:34:06 +00:00
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_CAPNP_LIBRARY 1)
|
|
|
|
endif()
|
|
|
|
|
2019-09-11 02:53:56 +00:00
|
|
|
# FIXME: refactor to use `add_library(… IMPORTED)` if possible.
|
|
|
|
if (NOT USE_INTERNAL_CAPNP_LIBRARY)
|
|
|
|
find_library (KJ kj)
|
|
|
|
find_library (CAPNP capnp)
|
|
|
|
find_library (CAPNPC capnpc)
|
2018-01-11 18:39:52 +00:00
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(KJ AND CAPNP AND CAPNPC)
|
|
|
|
set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ})
|
|
|
|
else()
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system capnproto")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (CAPNP_LIBRARIES)
|
|
|
|
set (USE_CAPNP 1)
|
2019-10-30 20:34:06 +00:00
|
|
|
elseif(NOT MISSING_INTERNAL_CAPNP_LIBRARY)
|
2019-09-11 02:53:56 +00:00
|
|
|
set (CAPNP_LIBRARIES capnpc)
|
|
|
|
set (USE_CAPNP 1)
|
2020-08-14 15:44:04 +00:00
|
|
|
set (USE_INTERNAL_CAPNP_LIBRARY 1)
|
2019-09-11 02:53:56 +00:00
|
|
|
endif ()
|
|
|
|
|
2019-10-30 20:34:06 +00:00
|
|
|
message (STATUS "Using capnp=${USE_CAPNP}: ${CAPNP_LIBRARIES}")
|