Commit 16b14a2c authored by Branislav Katreniak's avatar Branislav Katreniak

cmake: don't use find_package(CapnProto) if EXTERNAL_CAPNP is not set

Using installed capnp tools during instead of built capnp tools
easily leads to bad results.
parent 71f1fa97
...@@ -6,6 +6,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}") ...@@ -6,6 +6,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
if(BUILD_TESTING) if(BUILD_TESTING)
include(CTest) include(CTest)
if (EXTERNAL_CAPNP)
# Setup CAPNP_GENERATE_CPP for compiling test schemas # Setup CAPNP_GENERATE_CPP for compiling test schemas
find_package(CapnProto CONFIG QUIET) find_package(CapnProto CONFIG QUIET)
if (NOT CapnProto_FOUND) if (NOT CapnProto_FOUND)
...@@ -37,6 +38,8 @@ if(BUILD_TESTING) ...@@ -37,6 +38,8 @@ if(BUILD_TESTING)
endif() endif()
set(CAPNP_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") set(CAPNP_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
#TODO(someday) It would be nice to use targets instead of variables in CAPNP_GENERATE_CPP macro
endif()
# Sadly, we can't use the 'test' target, as that's coopted by ctest # Sadly, we can't use the 'test' target, as that's coopted by ctest
add_custom_target(check "${CMAKE_CTEST_COMMAND}" -V) add_custom_target(check "${CMAKE_CTEST_COMMAND}" -V)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment