2019-08-28 20:49:37 +00:00
|
|
|
option (USE_CAPNP "Enable Cap'n Proto" ON)
|
2017-10-04 00:00:22 +00:00
|
|
|
|
2019-08-28 20:49:37 +00:00
|
|
|
if (USE_CAPNP)
|
|
|
|
option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED})
|
2018-01-11 18:39:52 +00:00
|
|
|
|
2019-08-28 20:49:37 +00:00
|
|
|
# FIXME: refactor to use `add_library(… IMPORTED)` if possible.
|
2018-01-11 18:39:52 +00:00
|
|
|
if (NOT USE_INTERNAL_CAPNP_LIBRARY)
|
2019-08-28 20:49:37 +00:00
|
|
|
find_library (KJ kj)
|
|
|
|
find_library (CAPNP capnp)
|
|
|
|
find_library (CAPNPC capnpc)
|
|
|
|
|
|
|
|
set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ})
|
|
|
|
else ()
|
|
|
|
add_subdirectory(contrib/capnproto-cmake)
|
2018-01-11 18:39:52 +00:00
|
|
|
|
2019-08-28 20:49:37 +00:00
|
|
|
set (CAPNP_LIBRARIES capnpc)
|
2018-01-11 18:39:52 +00:00
|
|
|
endif ()
|
2017-10-04 00:00:22 +00:00
|
|
|
|
2019-08-28 20:49:37 +00:00
|
|
|
message (STATUS "Using capnp: ${CAPNP_LIBRARIES}")
|
2017-10-04 00:00:22 +00:00
|
|
|
endif ()
|