diff --git a/CMakeLists.txt b/CMakeLists.txt index de8c95a4..24049e08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,24 @@ target_include_directories(multiprocess PUBLIC $ $ $ - ${CAPNP_INCLUDE_DIRECTORY}) +) + +target_include_directories(multiprocess SYSTEM PUBLIC + $ +) + +# Hack to avoid exporting a path "which is prefixed in the source directory". +# If we're in another project's subdir and capnp is installed somewhere inside +# that project (as it is with depends in Bicoin Core) CMake refuses to allow it +# in the install interface. Use the "EXCLUDE_FROM_ALL" property as a proxy for +# detecting this condition, as in that case install won't happen anyway. +get_directory_property(mp_skip_install EXCLUDE_FROM_ALL) +if(NOT "${mp_skip_install}") + target_include_directories(multiprocess SYSTEM PUBLIC + $ + ) +endif() + target_link_libraries(multiprocess PRIVATE CapnProto::capnp) target_link_libraries(multiprocess PRIVATE CapnProto::capnp-rpc) target_link_libraries(multiprocess PRIVATE CapnProto::kj)