From 8a325bab4b4b4876c3bd63adcfb71957ec5c31a9 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 3 Oct 2023 16:59:44 -0400 Subject: [PATCH] make catch2 include path precise --- utest/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utest/CMakeLists.txt b/utest/CMakeLists.txt index c6e6e596..a135895a 100644 --- a/utest/CMakeLists.txt +++ b/utest/CMakeLists.txt @@ -15,7 +15,18 @@ target_code_coverage(${SELF_EXECUTABLE_NAME} AUTO ALL) # ---------------------------------------------------------------- # 3rd party dependency: catch2 +# 1. using target_link_libraries(.. Catch2) here doesn't work; +# build tries to link to a Catch2 library. +# perhaps Catch2 target not declared INTERFACE? +# 2. nix build doesn't need this; dependency on catch2 +# puts include directory in NIX_CFLAGS_COMPILE, so stuff 'just works' +# find_package(Catch2 2 REQUIRED) +set(Catch2_INCLUDES "${Catch2_DIR}/../..") +target_include_directories(${SELF_EXECUTABLE_NAME} PUBLIC ${Catch2_INCLUDES}) + +#xo_internal_dependency(${SELF_EXECUTABLE_NAME} Catch2) +#target_link_libraries(${SELF_EXECUTABLE_NAME} PUBLIC Catch2) # ---------------------------------------------------------------- # make standard directories for std:: includes explicit