From 2ea989d934821228f8ffeb9515978290ddf35c08 Mon Sep 17 00:00:00 2001 From: Nukoooo <89713806+Nukoooo@users.noreply.github.com> Date: Wed, 20 Dec 2023 22:30:37 +0800 Subject: [PATCH] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9c69d59..f2852c80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # Only do these if this is the main project, and not if it is included through add_subdirectory -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) +if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) OR BUILD_UNIT_TESTS) # Testing only available if this is the main app # Note this needs to be done in the main CMakeLists # since it calls enable_testing, which must be in the