diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ea55749..b46834c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,29 @@ project("newtype" # Project Options -option(NEWTYPE_BUILD_DOCS "Build the library documentation" ON) -option(NEWTYPE_BUILD_EXAMPLES "Build the library examples" ON) -option(NEWTYPE_BUILD_TESTS "Build the library tests" ON) +option(NEWTYPE_BUILD_DOCS "Build the library documentation" OFF) +option(NEWTYPE_BUILD_EXAMPLES "Build the library examples" OFF) +option(NEWTYPE_BUILD_TESTS "Build the library tests" OFF) + +# Project Dependencies + +include("FetchContent") + +if(NEWTYPE_BUILD_TESTS) + FetchContent_Declare( + "Catch2" + URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.0.zip" + URL_HASH "SHA256=75b04c94471a70680f10f5d0d985bd1a96b8941d040d6a7bfd43f6c6b1de9daf" + EXCLUDE_FROM_ALL + FIND_PACKAGE_ARGS + "3.7.0" EXACT + COMPONENTS "Catch2WithMain" + ) + + FetchContent_MakeAvailable("Catch2") + + include("Catch") +endif() # Project Components @@ -21,6 +41,7 @@ if(NEWTYPE_BUILD_DOCS) endif() if(NEWTYPE_BUILD_EXAMPLES) + include("cmake/Modules/AddExample.cmake") add_subdirectory("examples") endif() |
