Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFlorian Berchtold2020-09-20 18:09:33 +0200
committerMartin Hořeňovský2020-10-08 11:35:18 +0200
commitb1df96e7e491ab56473f869a9f4860a11fccab36 (patch)
tree38acffb9a44da298fed6e6a6cbec240154005dee
parenta4dfcf9042ffa066739b67a44c4b15e6fb45affd (diff)
downloadcatch3-b1df96e7e491ab56473f869a9f4860a11fccab36.tar.gz
Docu/Show how to use CMake FetchContent (#2028)
-rw-r--r--docs/cmake-integration.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md
index 4bbc3f9d..1835a043 100644
--- a/docs/cmake-integration.md
+++ b/docs/cmake-integration.md
@@ -36,6 +36,20 @@ add_subdirectory(lib/Catch2)
target_link_libraries(tests Catch2::Catch2)
```
+Another possibility is to use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html):
+```cmake
+Include(FetchContent)
+
+FetchContent_Declare(
+ Catch2
+ GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+ GIT_TAG v2.13.1)
+
+FetchContent_MakeAvailable(Catch2)
+
+target_link_libraries(tests Catch2::Catch2)
+```
+
## Automatic test registration
Catch2's repository also contains two CMake scripts that help users