diff --git a/cmake/QtPublicTestHelpers.cmake b/cmake/QtPublicTestHelpers.cmake index dc8fe5231be..0cfbfab4046 100644 --- a/cmake/QtPublicTestHelpers.cmake +++ b/cmake/QtPublicTestHelpers.cmake @@ -102,3 +102,7 @@ if(NOT result EQUAL 0) endif()" ) endfunction() + +function(_qt_internal_test_batch_target_name out) + set(${out} "test_batch" PARENT_SCOPE) +endfunction() diff --git a/cmake/QtResourceHelpers.cmake b/cmake/QtResourceHelpers.cmake index 8a3ea8babda..9ad9c682b83 100644 --- a/cmake/QtResourceHelpers.cmake +++ b/cmake/QtResourceHelpers.cmake @@ -7,7 +7,7 @@ function(qt_internal_add_resource target resourceName) if(NOT in_batch) message(FATAL_ERROR "Trying to add resource to a non-existing target \"${target}\".") endif() - qt_internal_test_batch_target_name(target) + _qt_internal_test_batch_target_name(target) endif() # Don't try to add resources when cross compiling, and the target is actually a host target diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index 4a51849c786..fefb614a725 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -9,7 +9,7 @@ function(qt_internal_extend_target target) if(NOT in_batch) message(FATAL_ERROR "Trying to extend a non-existing target \"${target}\".") endif() - qt_internal_test_batch_target_name(target) + _qt_internal_test_batch_target_name(target) endif() # Don't try to extend_target when cross compiling an imported host target (like a tool). @@ -893,7 +893,7 @@ function(qt_internal_undefine_global_definition target) if(NOT ${in_batch}) message(FATAL_ERROR "${target} is not a target.") endif() - qt_internal_test_batch_target_name(target) + _qt_internal_test_batch_target_name(target) endif() if("${ARGN}" STREQUAL "") diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 6b90ea55554..8bd09dec46f 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -77,15 +77,11 @@ endfunction() function(qt_internal_add_test_dependencies target) if(QT_BUILD_TESTS_BATCHED) - qt_internal_test_batch_target_name(target) + _qt_internal_test_batch_target_name(target) endif() add_dependencies(${target} ${ARGN}) endfunction() -function(qt_internal_test_batch_target_name out) - set(${out} "test_batch" PARENT_SCOPE) -endfunction() - # Simple wrapper around qt_internal_add_executable for manual tests which insure that # the binary is built under ${CMAKE_CURRENT_BINARY_DIR} and never installed. # See qt_internal_add_executable() for more details. @@ -267,7 +263,7 @@ function(qt_internal_add_test_to_batch batch_name name) arg "${optional_args}" "${single_value_args}" "${multi_value_args}" ${ARGN}) qt_internal_prepare_test_target_flags(version_arg exceptions_text gui_text ${ARGN}) - qt_internal_test_batch_target_name(target) + _qt_internal_test_batch_target_name(target) # Lazy-init the test batch if(NOT TARGET ${target}) @@ -705,7 +701,7 @@ for this function. Will be ignored") set(executable_name ${arg_NAME}) if(QT_BUILD_TESTS_BATCHED) - qt_internal_test_batch_target_name(executable_name) + _qt_internal_test_batch_target_name(executable_name) endif() add_test(NAME "${arg_NAME}" COMMAND "${CMAKE_COMMAND}" "-P" "${arg_OUTPUT_FILE}" WORKING_DIRECTORY "${arg_WORKING_DIRECTORY}")