cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
cmake/find/capnp.cmake
26lines · modecode
6 years ago
| 1 | option (ENABLE_CAPNP "Enable Cap'n Proto" ON) |
| 2 | |
| 3 | if (ENABLE_CAPNP) |
| 4 | |
| 5 | option (USE_INTERNAL_CAPNP_LIBRARY "Set to FALSE to use system capnproto library instead of bundled" ${NOT_UNBUNDLED}) |
| 6 | |
| 7 | # FIXME: refactor to use `add_library(… IMPORTED)` if possible. |
| 8 | if (NOT USE_INTERNAL_CAPNP_LIBRARY) |
| 9 | find_library (KJ kj) |
| 10 | find_library (CAPNP capnp) |
| 11 | find_library (CAPNPC capnpc) |
| 12 | |
| 13 | set (CAPNP_LIBRARIES ${CAPNPC} ${CAPNP} ${KJ}) |
| 14 | else () |
| 15 | add_subdirectory(contrib/capnproto-cmake) |
| 16 | |
| 17 | set (CAPNP_LIBRARIES capnpc) |
| 18 | endif () |
| 19 | |
| 20 | if (CAPNP_LIBRARIES) |
| 21 | set (USE_CAPNP 1) |
| 22 | endif () |
| 23 | |
| 24 | endif () |
| 25 | |
| 26 | message (STATUS "Using capnp: ${CAPNP_LIBRARIES}") |