From a7ed4e89c7444b5c8585453fc6d015c0efdf8654 Mon Sep 17 00:00:00 2001 From: Pranav Sivaraman Date: Sun, 8 Sep 2024 12:34:44 -0400 Subject: [PATCH] doctest: if SYSTEM_DOCTEST add a `find_package(doctest REQUIRED)` --- tests/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef7fab56..de0dc32a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,6 +11,8 @@ if (NOT SYSTEM_DOCTEST) FetchContent_Declare(doctest GIT_REPOSITORY https://github.com/onqtam/doctest.git GIT_TAG v2.4.11) +else () + find_package(doctest REQUIRED) endif() if (FASTFLOAT_SUPPLEMENTAL_TESTS) FetchContent_Declare(supplemental_test_files @@ -59,6 +61,8 @@ function(fast_float_add_cpp_test TEST_NAME) target_link_libraries(${TEST_NAME} PUBLIC fast_float supplemental-data) if (NOT SYSTEM_DOCTEST) target_link_libraries(${TEST_NAME} PUBLIC doctest) + else () + target_link_libraries(${TEST_NAME} PUBLIC doctest::doctest) endif() endfunction(fast_float_add_cpp_test)