Commit dd2430ce authored by Harris Hancock's avatar Harris Hancock Committed by Harris Hancock

cmake: Revise external capnp search logic

No change in behavior, but the comments needed updating, so I updated them.
Then I noticed a never-true if() case and removed it.
parent 647cea86
...@@ -4,17 +4,16 @@ ...@@ -4,17 +4,16 @@
if(BUILD_TESTING) if(BUILD_TESTING)
include(CTest) include(CTest)
if (EXTERNAL_CAPNP) 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)
# Try and find the executables from an autotools-based installation # No working installation of Cap'n Proto found, so fall back to searching the environment.
# Setup paths to the schema compiler for generating ${test_capnp_files} #
if(NOT EXTERNAL_CAPNP AND NOT CAPNP_LITE) # We search for the external capnp compiler binaries via $CAPNP, $CAPNPC_CXX, and
set(CAPNP_EXECUTABLE $<TARGET_FILE:capnp_tool>) # find_program(). find_program() will use various paths in its search, among them
set(CAPNPC_CXX_EXECUTABLE $<TARGET_FILE:capnpc_cpp>) # ${CMAKE_PREFIX_PATH}/bin and $PATH.
else()
# Allow paths to tools to be set with either environment variables or find_program()
if (NOT CAPNP_EXECUTABLE) if (NOT CAPNP_EXECUTABLE)
if (DEFINED ENV{CAPNP}) if (DEFINED ENV{CAPNP})
set(CAPNP_EXECUTABLE "$ENV{CAPNP}") set(CAPNP_EXECUTABLE "$ENV{CAPNP}")
...@@ -33,7 +32,6 @@ if(BUILD_TESTING) ...@@ -33,7 +32,6 @@ if(BUILD_TESTING)
endif() endif()
endif() endif()
endif() 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 #TODO(someday) It would be nice to use targets instead of variables in CAPNP_GENERATE_CPP macro
......
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