From efcf1cdeed2c1a0534b069b3564ae004a9617d50 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 10 Oct 2023 14:29:33 +0200 Subject: [PATCH] CMake: Fix Gui package to auto look up IntegrityPlatformGraphics When building non-qtbase tqtc repos in CI, we don't load a lot of Plugin Config files in static builds due to project names having a tqtc- prefix. This is similar to the issue and workaround that was done in 4c6292686259e4e232f29cb6fd6c79065e9fa96d for qtserialport. The specific issue here is the following error: CMake Error at Qt6Gui/Qt6GuiTargets.cmake:61 (set_target_properties): The link interface of target "Qt6::Gui" contains: IntegrityPlatformGraphics::IntegrityPlatformGraphics but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Call Stack (most recent call first): /home/qt/work/install/target/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake:52 (include) /home/qt/work/install/target/lib/cmake/Qt6/Qt6Config.cmake:157 (find_package) CMakeLists.txt:15 (find_package) To work around the issue, explicitly record a dependency on the IntegrityPlatformGraphics target for Gui when building on INTEGRITY. The underlying issue is sadly still not fixed. Change-Id: I9a9cff05d036f224aab8083ad6bc8b8e568abd8b Task-number: QTBUG-102883 Reviewed-by: Qt CI Bot Reviewed-by: Tatiana Borisova (cherry picked from commit c03eb94c8a4c776a0315acc35538b3954e031222) Reviewed-by: Qt Cherry-pick Bot --- src/gui/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index c2c9b964654..b9c300f8bcc 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -336,7 +336,8 @@ if(QT_FEATURE_opengl) target_link_libraries(Gui PUBLIC GLESv2::GLESv2) if(INTEGRITY AND _qt_igy_gui_libs) - find_package(IntegrityPlatformGraphics) + qt_find_package(IntegrityPlatformGraphics + PROVIDED_TARGETS IntegrityPlatformGraphics::IntegrityPlatformGraphics) target_link_libraries(Gui INTERFACE $) endif()