Skip to content

Commit

Permalink
Update testing.cmake: make fetching doctest optional (default ON)
Browse files Browse the repository at this point in the history
  • Loading branch information
bytebunny authored May 8, 2024
1 parent 76da37b commit 45ec33d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions cmake/testing.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
include_guard(GLOBAL)

include(FetchContent)
option(FETCH_DOCTEST "Use fetch content to get doctest" ON)
if (FETCH_DOCTEST)
message(STATUS "Fetching doctest")

FetchContent_Declare(
doctest
GIT_REPOSITORY "https://github.com/onqtam/doctest"
GIT_TAG "v2.4.11"
)
include(FetchContent)

set(DOCTEST_NO_INSTALL True)
FetchContent_Declare(
doctest
GIT_REPOSITORY https://github.com/onqtam/doctest
GIT_TAG v2.4.11
OVERRIDE_FIND_PACKAGE
)
endif()

FetchContent_MakeAvailable(doctest)
set(DOCTEST_NO_INSTALL True)

find_package(doctest CONFIG REQUIRED)

Expand Down

0 comments on commit 45ec33d

Please sign in to comment.