Skip to content

Commit 40ce719

Browse files
author
Henry Hoegelow
committed
avoid conflicts with catch already pulled via submodule in hosting project
1 parent 3b1be6f commit 40ce719

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tests/CMakeLists.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
cmake_minimum_required(VERSION 3.16.3)
22

3-
Include(FetchContent)
3+
if(NOT TARGET Catch2WithMain)
4+
Include(FetchContent)
45

5-
FetchContent_Declare(
6-
Catch2
7-
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
8-
GIT_TAG v3.4.0 # or a later release
9-
)
6+
FetchContent_Declare(
7+
Catch2
8+
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
9+
GIT_TAG v3.4.0 # or a later release
10+
)
1011

11-
FetchContent_MakeAvailable(Catch2)
12-
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
13-
include(CTest)
14-
include(Catch)
12+
FetchContent_MakeAvailable(Catch2)
13+
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
14+
include(CTest)
15+
include(Catch)
16+
endif()
1517

1618
add_executable(reactive-tests
1719
LatchTests.cpp

0 commit comments

Comments
 (0)