From bb88f5b9f33a1a151ce5cb94eaec0854fdc91ad6 Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Sun, 30 Mar 2025 15:50:09 -0400 Subject: [PATCH] Revert "CMake: Use the bundled catch2 header with the Test target, rather than a system-installed one if that exists." This reverts commit 5a2e2206ea1a9948ab2945bd354f8fb9524bfc6e. --- Tests/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2563c963..c0ea3c3e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -19,8 +19,12 @@ set_target_properties(Tests PROPERTIES add_dependencies(Tests Recast Detour DetourCrowd) target_link_libraries(Tests Recast Detour DetourCrowd) -# Use bundled catch2 rather than a possibly incompatible version installed elsewhere. -include_directories(./Contrib) -target_sources(Tests PRIVATE Contrib/catch2/catch_amalgamated.cpp) +find_package(Catch2 QUIET) +if (Catch2_FOUND) + target_link_libraries(Tests Catch2::Catch2WithMain) +else() + include_directories(./Contrib) + target_sources(Tests PRIVATE Contrib/catch2/catch_amalgamated.cpp) +endif() add_test(Tests Tests)