fix Qt6.2 builds

use foreach to be prepared for the future

Change-Id: I9157bb04479ff2376a567380c76c38b9aee900b7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Tim Jenssen
2021-06-22 13:50:30 +02:00
parent 5b0889777a
commit a803d04c17

View File

@@ -42,16 +42,17 @@ if (NOT Qt6_FOUND)
endif() endif()
return() return()
else() else()
# since Qt 6.2 DesignerComponents is called DesignerComponentsPrivate # since Qt 6.2 some components are renamed to *Private
list(FIND Qt5_FIND_COMPONENTS DesignerComponents dcIndex) foreach(possible_private_libs DesignerComponents QmlDebug)
if(dcIndex GREATER_EQUAL 0) list(FIND Qt5_FIND_COMPONENTS ${possible_private_libs} dcIndex)
find_package(Qt6DesignerComponentsPrivate CONFIG QUIET) if(dcIndex GREATER_EQUAL 0)
if(TARGET Qt6::DesignerComponentsPrivate) find_package(Qt6${possible_private_libs}Private CONFIG QUIET)
add_library(Qt5::DesignerComponents ALIAS Qt6::DesignerComponentsPrivate) if(TARGET Qt6::${possible_private_libs}Private)
list(REMOVE_AT Qt5_FIND_COMPONENTS ${dcIndex}) add_library(Qt5::${possible_private_libs} ALIAS Qt6::${possible_private_libs}Private)
endif() list(REMOVE_AT Qt5_FIND_COMPONENTS ${dcIndex})
endif() endif()
endif()
endforeach()
find_package(Qt6 CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS}) find_package(Qt6 CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS})
endif() endif()