aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-10-01 12:47:33 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-10-05 05:50:13 +0000
commit068c4e9b7b9de9cac4136f613fdfa7b8e9020d3b (patch)
treebf83f0dda4bbcdf85b9a75b4bfa4e65140fe127d
parentab16f2984b6661ea172d345b0ecc9a7ce33bf40c (diff)
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 <eike.ziller@qt.io>
-rw-r--r--cmake/FindQt5.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake
index 4fde452733..1931bf019c 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)