From 5f2b2eadfd19cb527c693a4b580fcc8cb25ecc3c Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Fri, 25 Oct 2024 09:35:13 -0400 Subject: [PATCH] Respond to PR comments. --- CMakeLists.txt | 10 ++++++++-- src/CMakeLists.txt | 1 + tests/CMakeLists.txt | 3 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04ccb246..ae6bd943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,14 +19,20 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -option(NOTEST "Disable all tests" OFF) option(NO_UNIT_TESTS "Disable unit tests" OFF) option(WITH_EXAMPLES "Build examples" OFF) +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + include(CTest) +endif () + add_subdirectory(src) -if (NOT NOTEST) +if (BUILD_TESTING) add_subdirectory(tests) +else () + message(STATUS "Skipping test targets") endif () + if (WITH_EXAMPLES) add_subdirectory(examples) endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b28abd66..fa6490b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ if (NOT TARGET acquire-core-logger) + set(NOTEST ON) add_subdirectory(${CMAKE_SOURCE_DIR}/acquire-common/acquire-core-libs ${CMAKE_CURRENT_BINARY_DIR}/acquire-core-libs) endif () diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3fb6265d..80df2335 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,5 @@ -set(NOTEST "TRUE") +set(NOTEST ON) add_subdirectory(${CMAKE_SOURCE_DIR}/acquire-common ${CMAKE_CURRENT_BINARY_DIR}/acquire-common) -set(NOTEST "FALSE") # # PARAMETERS