summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-09-16 17:53:41 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-09-17 00:30:39 +0200
commit469dbe5c6d42b3b814d0b99e162c137451222c07 (patch)
treeec6bcdb73aee39b68237b76ab170ea8d15f05361 /cmake
parent0e90bdbaa43b05a0c0711c78c749bb8379efa755 (diff)
CMake: Fix _qt_is_test_executable assignment for tests
_qt_is_test_executable can only be set on a test that is backed by a real target. QMLTESTs might not backed by an executable target, if they are missing cpp SOURCES. Which led to errors like CMake Error at cmake/QtTestHelpers.cmake:510 (set_target_properties): set_target_properties Can not find target to add properties to: textedit Call Stack (most recent call first): tests/auto/qmltest/textedit/CMakeLists.txt:10 (qt_internal_add_test) Amends 62c681a5991b7f215e108f74c1dd3dd58c1d92c7 Change-Id: Ie66fd3e94484562061f851c0a034629959d091da Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtTestHelpers.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index 1ab70d290d..657bb160de 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -297,6 +297,7 @@ function(qt_internal_add_test_to_batch batch_name name)
set_property(TARGET ${target} PROPERTY _qt_has_gui ${arg_GUI})
set_property(TARGET ${target} PROPERTY _qt_has_lowdpi ${arg_LOWDPI})
set_property(TARGET ${target} PROPERTY _qt_version ${version_arg})
+ set_property(TARGET ${target} PROPERTY _qt_is_test_executable TRUE)
else()
# Check whether the args match with the batch. Some differences between
# flags cannot be reconciled - one should not combine these tests into
@@ -506,8 +507,8 @@ function(qt_internal_add_test name)
LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Gui
)
set(setting_up_batched_test FALSE)
+ set_target_properties(${name} PROPERTIES _qt_is_test_executable TRUE)
endif()
- set_target_properties(${name} PROPERTIES _qt_is_test_executable TRUE)
foreach(path IN LISTS arg_QML_IMPORTPATH)
list(APPEND extra_test_args "-import" "${path}")