From 068c4e9b7b9de9cac4136f613fdfa7b8e9020d3b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Oct 2021 12:47:33 +0200 Subject: [PATCH] CMake: Work around Qt6::ATSPI2_nolink issue This works around QTBUG-97023. When building the Qt Creator super repo against the installer-provided Qt 6.2.0 on Linux, Qt6Gui creates an imported library target named Qt6::ATSPI2_nolink. This one must also be promoted to global scope. Otherwise, subsequent find_package(Qt6 COMPONENTS Gui) calls fail with Some (but not all) targets in this export set were already defined. Targets Defined: Qt6::Gui;Qt6::GuiPrivate Targets not yet defined: Qt6::ATSPI2_nolink Add Qt6::ATSPI2_nolink to the components that are promoted and aliased. Change-Id: I39c46e8f1c831e2fad2aa4e928b785da08a0407c Reviewed-by: Eike Ziller --- cmake/FindQt5.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake index 4fde452733d..1931bf019c2 100644 --- a/cmake/FindQt5.cmake +++ b/cmake/FindQt5.cmake @@ -57,7 +57,8 @@ else() find_package(Qt6 CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS}) endif() -foreach(comp IN LISTS Qt5_FIND_COMPONENTS) +set(__additional_imported_components ATSPI2_nolink) # Work around QTBUG-97023 +foreach(comp IN LISTS Qt5_FIND_COMPONENTS __additional_imported_components) if(TARGET Qt6::${comp}) if (NOT TARGET Qt5::${comp}) set_property(TARGET Qt6::${comp} PROPERTY IMPORTED_GLOBAL TRUE)