From f02a0cff5b1dd404ec4a1c3ae2040689c9830c8c Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Mon, 29 Jan 2024 15:43:29 +0100 Subject: [PATCH] cmake: make tests optional --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ad90ba..acbd9cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,12 +50,16 @@ add_library(merry::oaknut ALIAS oaknut) target_sources(oaknut INTERFACE "$") target_include_directories(oaknut INTERFACE $ - $ + $ ) target_compile_features(oaknut INTERFACE cxx_std_20) # Tests if (MASTER_PROJECT) + include(CTest) +endif() + +if (BUILD_TESTING) option(OAKNUT_USE_BUNDLED_CATCH "Use the embedded Catch2 submodule" OFF) if (OAKNUT_USE_BUNDLED_CATCH) add_subdirectory(externals/catch)