From 0af06ca8dca24e920b487d191e8d131d98ec9d86 Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Fri, 13 Oct 2023 00:08:53 +0530 Subject: [PATCH] Use include(CTest) which automatically invokes enable_testing() --- .gitignore | 1 + CMakeLists.txt | 2 +- src/CMakeLists.txt | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e488482b9..86b86de8c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ RemoteSystemsTempFiles/ CPack* _CPack_Packages/ CTestTestfile.cmake +DartConfiguration.tcl Testing/ install_manifest_Runtime.txt *.deb diff --git a/CMakeLists.txt b/CMakeLists.txt index 61b486b11..0d03788da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ set_source_files_properties(${CMAKE_SOURCE_DIR}/src/cdogs/sys_config.h PROPERTIE include_directories(src src/cdogs) # Tests -enable_testing() +include(CTest) add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2182bfed5..d7b3acf23 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,9 @@ if(BUILD_EDITOR) endif() add_subdirectory(json) add_subdirectory(proto) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() set(CDOGS_SDL_SOURCES ammo_menu.c