aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2021-06-22 13:50:30 +0200
committerTim Jenssen <tim.jenssen@qt.io>2021-06-22 13:02:11 +0000
commita803d04c171b31ec90c1ea2bb82930a967027ec8 (patch)
treedbba83a01a05694bc43374aabe1c10b41e1a38db /cmake
parent5b0889777a786698f801c2703f57b3648daeb40a (diff)
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>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindQt5.cmake21
1 files changed, 11 insertions, 10 deletions
diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake
index 831ea046a0..ae58487eea 100644
--- a/cmake/FindQt5.cmake
+++ b/cmake/FindQt5.cmake
@@ -42,16 +42,17 @@ if (NOT Qt6_FOUND)
endif()
return()
else()
- # since Qt 6.2 DesignerComponents is called DesignerComponentsPrivate
- list(FIND Qt5_FIND_COMPONENTS DesignerComponents dcIndex)
- if(dcIndex GREATER_EQUAL 0)
- find_package(Qt6DesignerComponentsPrivate CONFIG QUIET)
- if(TARGET Qt6::DesignerComponentsPrivate)
- add_library(Qt5::DesignerComponents ALIAS Qt6::DesignerComponentsPrivate)
- list(REMOVE_AT Qt5_FIND_COMPONENTS ${dcIndex})
- endif()
- endif()
-
+ # since Qt 6.2 some components are renamed to *Private
+ foreach(possible_private_libs DesignerComponents QmlDebug)
+ list(FIND Qt5_FIND_COMPONENTS ${possible_private_libs} dcIndex)
+ if(dcIndex GREATER_EQUAL 0)
+ find_package(Qt6${possible_private_libs}Private CONFIG QUIET)
+ if(TARGET Qt6::${possible_private_libs}Private)
+ add_library(Qt5::${possible_private_libs} ALIAS Qt6::${possible_private_libs}Private)
+ list(REMOVE_AT Qt5_FIND_COMPONENTS ${dcIndex})
+ endif()
+ endif()
+ endforeach()
find_package(Qt6 CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS})
endif()