From 9a975279977d0252e1d4031e02eb432ed55f41b4 Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Mon, 31 Jan 2022 14:21:50 +0100 Subject: qmltc: Ignore qmltypes dependencies from INTERFACE_LIBRARY and IMPORTED INTERFACE_LIBRARY and IMPORTED targets do not have properties we need, so ignore them to avoid accidental errors during CMake run Fixes: QTBUG-100314 Change-Id: I20c04bd4728ae86eddbc4a29f4461c9df597bf2d Reviewed-by: Alexandru Croitor (cherry picked from commit 9dc373f1f1e8839232bc37ed1bf0cd6c6300b263) Reviewed-by: Qt Cherry-pick Bot --- src/qml/Qt6QmlMacros.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 5b3e3cb005..2033617419 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -1094,6 +1094,25 @@ function(qt6_target_compile_qml_to_cpp target) continue() endif() + # if we have a versionless Qt lib, find the public one with a version + if(lib MATCHES "^Qt::(.*)") + set(lib "${CMAKE_MATCH_1}") + if(lib MATCHES "^(.*)Private") # remove "Private" + set(lib "${CMAKE_MATCH_1}") + endif() + set(lib ${QT_CMAKE_EXPORT_NAMESPACE}::${lib}) + if(NOT TARGET ${lib}) + continue() + endif() + endif() + + # when we have a suitable lib, ignore INTERFACE_LIBRARY and IMPORTED + get_target_property(lib_type ${lib} TYPE) + get_target_property(lib_is_imported ${lib} IMPORTED) + if(lib_type STREQUAL "INTERFACE_LIBRARY" OR lib_is_imported) + continue() + endif() + # get any QT_QML_MODULE_ property, this way we can tell whether we deal # with QML module target or not. use output dir as it's used later get_target_property(external_output_dir ${lib} QT_QML_MODULE_OUTPUT_DIRECTORY) -- cgit v1.2.3