-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
839d99a
commit 3dff7cb
Showing
4 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# This says we require C++17 | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# This is required to issue any FetchContent commands | ||
include(FetchContent) | ||
|
||
# This declares "catch" as a git repository we depend on | ||
FetchContent_Declare( | ||
catch | ||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git | ||
GIT_TAG v2.13.3 | ||
) | ||
|
||
# This says we want the "catch" we declared available | ||
FetchContent_MakeAvailable(catch) | ||
|
||
# The ${catch_SOURCE_DIR} variable is set by MakeAvailable | ||
# In this case we want catch.hpp to be in the include path | ||
include_directories(${catch_SOURCE_DIR}/single_include/catch2) | ||
|
||
# This says to create an executable target called Ex07 that compiles Main.cpp | ||
add_executable(Ex07 Main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <iostream> | ||
#include <catch.hpp> | ||
|
||
int main() | ||
{ | ||
std::cout << "Hello, C++ Catch world!\n"; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This demonstrates how to use FetchCOntent to get and use the Catch library. |