From 6c043b45b214ecdee1618da16de57a1dceb11ac8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sat, 16 Sep 2023 08:52:06 -0400 Subject: [PATCH] Move include(CTest) to inside testing guard The RTAUDIO_BUILD_TESTING variable stops the testing target ejection but still does an include(CTest) which injects the standard CTest macros from enable_testing(). In rtmidi you include(CTest) inside the guard but in rtaudio you do not; as such using the cmake in a non-ctest project ejects multiple targets. For now you can get around this with BUILD_TESTING globally off but that means you can't activate your own ctests optionally. So move the include(CTEst) to be in the same spot as it is in rtmidi. Thanks for great software! --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bea3710..1be49c9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,12 +280,12 @@ target_compile_definitions(rtaudio PRIVATE RTAUDIO_EXPORT) target_link_libraries(rtaudio ${LINKLIBS}) # Subdirs -include(CTest) if (NOT DEFINED RTAUDIO_BUILD_TESTING OR RTAUDIO_BUILD_TESTING STREQUAL "") set(RTAUDIO_BUILD_TESTING ${BUILD_TESTING}) endif() if (RTAUDIO_BUILD_TESTING) + include(CTest) add_subdirectory(tests) endif()