CMake: Fix Gui package to auto look up IntegrityPlatformGraphics v2

The previous attempt to record a dependency on the
IntegrityPlatformGraphics target for the Gui target was insufficient.

Aside from a qt_find_package(PROVIDED_TARGETS) call, we also need to
use qt_internal_extend_target(Gui PRIVATE IntegrityPlatformGraphics)
to ensure the dependency is written into the Qt6GuiDependencies.cmake
file.

Replace the target_link_libraries call with qt_internal_extend_target,
and remove the qt_find_package all together. A qt_find_package call
in src/gui/configure.cmake already exists, so the one in
CMakeLists.txt is redundant and can be removed.

Finally the
  qt_internal_extend_target(Gui PRIVATE IntegrityPlatformGraphics)
call will also result in a
  target_link_libraries(Gui INTERFACE
  $<LINK_ONLY:IntegrityPlatformGraphics::IntegrityPlatformGraphics>)
because Gui is a static library when building on Integrity, so the
transitive requirement will still be passed along to user projects.

Amends c03eb94c8a4c776a0315acc35538b3954e031222
Amends 8116fdde1c13fe00fb03414b56da2d66e215f279

Fixes: QTBUG-118051
Task-number: QTBUG-102883
Change-Id: Ic962df94a20071d3f2459e705dbafaca0319a638
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8170e9e85a6e479ad3d2d1f2645f9bc148ab6fde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2023-10-12 12:36:06 +00:00 committed by Qt Cherry-pick Bot
parent 740104872d
commit deb49de7bc

View File

@ -336,10 +336,10 @@ if(QT_FEATURE_opengl)
target_link_libraries(Gui PUBLIC GLESv2::GLESv2) target_link_libraries(Gui PUBLIC GLESv2::GLESv2)
if(INTEGRITY AND _qt_igy_gui_libs) if(INTEGRITY AND _qt_igy_gui_libs)
qt_find_package(IntegrityPlatformGraphics qt_internal_extend_target(Gui
PROVIDED_TARGETS IntegrityPlatformGraphics::IntegrityPlatformGraphics) LIBRARIES
target_link_libraries(Gui IntegrityPlatformGraphics::IntegrityPlatformGraphics
INTERFACE $<LINK_ONLY:IntegrityPlatformGraphics::IntegrityPlatformGraphics>) )
endif() endif()
elseif(NOT QT_FEATURE_opengl_dynamic) elseif(NOT QT_FEATURE_opengl_dynamic)