Skip to content

Commit fe53e76

Browse files
authored
Merge pull request #270 from pranav-sivaraman/add-find-package
doctest: if SYSTEM_DOCTEST add a `find_package(doctest REQUIRED)`
2 parents 564af6d + a7ed4e8 commit fe53e76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if (NOT SYSTEM_DOCTEST)
1111
FetchContent_Declare(doctest
1212
GIT_REPOSITORY https://github.com/onqtam/doctest.git
1313
GIT_TAG v2.4.11)
14+
else ()
15+
find_package(doctest REQUIRED)
1416
endif()
1517
if (FASTFLOAT_SUPPLEMENTAL_TESTS)
1618
FetchContent_Declare(supplemental_test_files
@@ -59,6 +61,8 @@ function(fast_float_add_cpp_test TEST_NAME)
5961
target_link_libraries(${TEST_NAME} PUBLIC fast_float supplemental-data)
6062
if (NOT SYSTEM_DOCTEST)
6163
target_link_libraries(${TEST_NAME} PUBLIC doctest)
64+
else ()
65+
target_link_libraries(${TEST_NAME} PUBLIC doctest::doctest)
6266
endif()
6367
endfunction(fast_float_add_cpp_test)
6468

0 commit comments

Comments
 (0)