ClickHouse/cmake/find/capnp.cmake

27 lines
641 B
CMake
Raw Normal View History

2019-09-11 02:53:56 +00:00
option (ENABLE_CAPNP "Enable Cap'n Proto" ON)
2019-09-11 02:53:56 +00:00
if (ENABLE_CAPNP)
2019-09-11 02:53:56 +00:00
option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED})
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)
2019-09-11 02:53:56 +00:00
set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ})
else ()
add_subdirectory(contrib/capnproto-cmake)
2019-09-11 02:53:56 +00:00
set (CAPNP_LIBRARIES capnpc)
endif ()
2019-09-11 02:53:56 +00:00
if (CAPNP_LIBRARIES)
set (USE_CAPNP 1)
endif ()
endif ()
message (STATUS "Using capnp: ${CAPNP_LIBRARIES}")