Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d841a4

Browse files
committedFeb 1, 2025
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`.
1 parent 1e06ff0 commit 9d841a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1010
set(CMAKE_CXX_STANDARD_REQUIRED YES)
1111
endif()
1212

13+
include(CTest)
14+
1315
include("cmake/compat_find.cmake")
1416

1517
find_package(CapnProto REQUIRED)

‎test/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
include(CTest)
6-
75
# Custom test targets for convenience, based on
86
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/EmulateMakeCheck.
97
#

0 commit comments

Comments
 (0)
Please sign in to comment.