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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorClare Macrae2021-04-16 20:19:58 +0100
committerGitHub2021-04-16 21:19:58 +0200
commit2dc5a5f402831a659681b6e7c1ee7f7b93489a82 (patch)
treed31735948fdaa61dc9efb8832f351262403f5356
parent04166514feec057540e4835c9f6636e6ad47721d (diff)
downloadcatch3-2dc5a5f402831a659681b6e7c1ee7f7b93489a82.tar.gz
Prepare to prevent Catch2 v3's tests from being run, and CTest targets from being added, if Catch2 is configured as a sub-project. (#2205)
This commit fixes issue that happens if the project above us uses the same variable name, thus confusing our script which see the variable scoped from the project including Catch2, rather than ours See #2202
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c0e13d44..89b37418 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.5)
# disable testsuite in that case
if(NOT DEFINED PROJECT_NAME)
set(NOT_SUBPROJECT ON)
+else()
+ set(NOT_SUBPROJECT OFF)
endif()
option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON)