Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctest: if SYSTEM_DOCTEST add a find_package(doctest REQUIRED) #270

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down