diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-01-31 14:21:50 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-31 20:45:28 +0000 |
commit | 9a975279977d0252e1d4031e02eb432ed55f41b4 (patch) | |
tree | 75c376ac117075cb408faffa1d8501b1af0ee555 | |
parent | 7affa153181c9fa08301ac08c04f7d886714924f (diff) |
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 <alexandru.croitor@qt.io>
(cherry picked from commit 9dc373f1f1e8839232bc37ed1bf0cd6c6300b263)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
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) |