aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-04 17:29:46 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-12 16:19:01 +0000
commit8042ecdb8b4decd6cea0fc0aa5dd54f3815d76fb (patch)
tree500bd5d716f894f31621f81ea693bebbd08da74f
parenta2717215137a1157ae35d749e5dbe144d6e940db (diff)
CMake: Fix issue with Xcode common dep between qmllint and tooling
Sometimes when using the Xcode generator and there 2 or more Qml modules added in different subdirectories, you get an error like CMake Error in Bar/CMakeLists.txt: The custom command generating build_dir/Bar/B.qml is attached to multiple targets: Bar_qmllint Bar_tooling but none of these is a common dependency of the other(s). This is not allowed by the Xcode "new build system". The main reason for the error is that we accidentally make the _qmllint target depend on the qml files that are supposed to be copied by the _tooling target to the build dir, instead of making qmllint depend on the source files. The qmllint target queries the QT_QML_LINT_FILES property with a generator expression, but the values are relative qml file paths. Within the context of add_custom_command they evaluate to the build dir qml files that are copied by the _tooling target. To avoid the issue, ensure that QT_QML_LINT_FILES contains absolute paths to the qml files. This way it will not depend the output of the _tooling target and avoid the Xcode issue. It is not clear why the issue does not trigger when there is only one qml module in the project. But the fix applies nevertheless. Resembles 1bd0a5ce02352a600367beb5a5421c8f8332e1fe Task-number: QTBUG-95763 Fixes: QTBUG-100307 Change-Id: Ie3af503635de3ca61ce5975dcd0983d4e19f259f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit ea7024ef7bcae60c26d0470abb2ffeb56cac1875) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/Qt6QmlMacros.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index d2b1d2a9eb..99f37f623e 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1456,7 +1456,7 @@ function(qt6_target_qml_sources target)
# The set of qml files to run qmllint on may be a subset of the
# full set of files, so record these in a separate property.
_qt_internal_target_enable_qmllint(${target})
- set_property(TARGET ${target} APPEND PROPERTY QT_QML_LINT_FILES ${qml_file_src})
+ set_property(TARGET ${target} APPEND PROPERTY QT_QML_LINT_FILES ${file_absolute})
endif()
# Add qml file's type to qmldir