diff --git a/cmake/modules/TestTarget.cmake b/cmake/modules/TestTarget.cmake index 8cced2c..f647bd4 100644 --- a/cmake/modules/TestTarget.cmake +++ b/cmake/modules/TestTarget.cmake @@ -302,10 +302,5 @@ if (CLANG_SOURCE_BASED_COVERAGE_AVAILABLE) endif () endif () -# add the test executable to the dependencies of the check target -if (NOT META_TEST_TARGET_IS_MANUAL) - add_dependencies(check ${META_TARGET_NAME}_tests) -endif () - set(META_HAVE_TESTS YES) set(TEST_CONFIG_DONE YES) diff --git a/cmake/modules/TestUtilities.cmake b/cmake/modules/TestUtilities.cmake index 1862a77..50e465a 100644 --- a/cmake/modules/TestUtilities.cmake +++ b/cmake/modules/TestUtilities.cmake @@ -64,4 +64,9 @@ function (configure_test_target) if (NOT ARGS_MANUAL) add_test(NAME "${ARGS_TARGET_NAME}_run_${ARGS_TEST_NAME}" COMMAND "${TEST_TARGET_NAME}" ${RUN_ARGS}) endif () + + # add the test executable to the dependencies of the check target + if (NOT ARGS_MANUAL AND TARGET check) + add_dependencies(check ${TEST_TARGET_NAME}) + endif () endfunction ()