From 63ac092ddd8156b5eb56f2302b3d03ba739cf9ce Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Sat, 1 Feb 2025 15:15:26 +0100 Subject: [PATCH] CTest: Module must be included at the top level In order to be able to run `ctest` from the top level build directory, it is necessary that `enable_testing()` is invoked in the top level CMakeLists.txt file. The `CTest` module invokes `enable_testing()` based on the value of `BUILD_TESTING`. --- CMakeLists.txt | 1 + test/CMakeLists.txt | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5e65ff3..66350c45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ set(Libmultiprocess_EXTERNAL_MPGEN "" CACHE FILEPATH "If specified, should be fu include("cmake/compat_config.cmake") include("cmake/pthread_checks.cmake") +include(CTest) include(GNUInstallDirs) # Set convenience variables for subdirectories. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 129cb563..997a0289 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,8 +2,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -include(CTest) - # Custom test targets for convenience, based on # https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/EmulateMakeCheck. #