qt6-bb10/tests/auto
Alexandru Croitor 561fc8107f CMake: Allow promoting the Qt libraries to be global targets
User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to
true so that the various imported targets created by find_package(Qt6)
are promoted to global targets.

This would allow a project to find Qt packages in a subdirectory scope
while using those Qt targets from a different scope.

E.g. it fixes errors like

  CMake Error at CMakeLists.txt:5 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:Qt6::Widgets_resources_1>

  Objects of target "Qt6::Widgets_resources_1" referenced but no such
  target exists.

when trying to use a static Qt from a sibling scope.

Various 3rd party dependency targets (like Atomic or ZLIB) are not
made global due to limitations in CMake, but as long as those targets
are not mentioned directly, it shouldn't cause issues.

The targets are made global in the generated
QtFooAdditionalTargetInfo.cmake file.

To ensure that resource object libraries promoted, the generation
of the file has to be done at the end of the defining scope
where qt_internal_export_additional_targets_file is called,
which is achieved with a deferred finalizer.

Replaced all occurrences of target promotion with a helper function
which allows tracing of all promoted targets by specifying
--log-level=debug to CMake.

Pick-to: 6.2
Fixes: QTBUG-92878
Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-16 13:22:17 +02:00
..
bic/data Add binary compatibility files for Qt 6.0.0 2021-04-08 06:34:13 +00:00
cmake CMake: Allow promoting the Qt libraries to be global targets 2021-06-16 13:22:17 +02:00
concurrent Remove the dead code for blocking methods from QtConcurrent 2021-06-14 11:52:36 +02:00
corelib Turn tst_QString::setRawData()'s QSKIP into QEXPECT_FAIL()s 2021-06-15 16:58:46 +02:00
dbus Port QDBusServiceWatcher::watchedServices to bindable properties 2021-04-28 16:59:53 +02:00
gui Improve tst_QColorSpace::imageConversion64PM test 2021-06-16 12:23:41 +02:00
guiapplauncher
network Fix QFAIL() to interract correctly with QEXPECT_FAIL() 2021-06-15 18:55:16 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Introduce float QImage formats and rendering 2021-05-26 18:00:01 +02:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql QSqlTableModel::orderByClause(): Quote the table name 2021-05-03 14:10:36 +00:00
testlib Fix QFAIL() to interract correctly with QEXPECT_FAIL() 2021-06-15 18:55:16 +02:00
tools Remove pure-virtual-signals.h include from tst_moc.cpp 2021-06-11 17:12:12 +02:00
widgets Stabilize flaky scrollerSmoothScroll test case 2021-06-15 16:03:38 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00