aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-24 17:27:27 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-25 22:26:10 +1000
commitde2637d98d289f30cea6245baea27287ffc1675d (patch)
tree9ec2880e4c41f69a1d23b5ca7216b1e19b1caa16 /src/qml/Qt6QmlMacros.cmake
parent2a48b85b44be846b89d22490370d40aeae9a9614 (diff)
Clean up arguments qt6_import_qml_plugins() passes to qmlimportscanner
We already provide the list of .qml files via the .qrc files, so we don't need to explicitly list out all the .qml files on the command line as well. Remove them. The first argument given to qmlimportscanner is the source directory of the target whose qml plugins are being imported. That argument should be preceded by -rootPath, but it wasn't. It still worked due to the way qmlimportscanner's argument parsing was implemented, but we shouldn't rely on that. Precede it with -rootPath. Fixes: QTBUG-95094 Pick-to: 6.2 Change-Id: I863a1bda2e54bb70d2dabe43525ad972f8cdadfd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 692b4f2ca7..985a6a3a06 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1444,10 +1444,6 @@ function(qt6_target_qml_sources target)
# resource paths and the source locations might be structured quite
# differently.
- # Fed to qmlimportscanner in qt6_import_qml_plugins. Also may be used in
- # generator expressions to install all qml files for the target.
- set_property(TARGET ${target} APPEND PROPERTY QT_QML_MODULE_FILES ${qml_file_out})
-
# Add file to those processed by qmllint
get_source_file_property(skip_qmllint ${qml_file_src} QT_QML_SKIP_QMLLINT)
if(NOT no_lint AND NOT skip_qmllint)
@@ -1935,7 +1931,7 @@ but this file does not exist. Possible reasons include:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.qt_plugins)
set(cmd_args
- "${arg_PATH_TO_SCAN}"
+ -rootPath "${arg_PATH_TO_SCAN}"
-cmake-output
-importPath "${qml_path}"
)
@@ -1952,11 +1948,10 @@ but this file does not exist. Possible reasons include:
list(APPEND cmd_args "${QT_QML_OUTPUT_DIRECTORY}")
endif()
- get_target_property(qml_files ${target} QT_QML_MODULE_FILES)
- if (qml_files)
- list(APPEND cmd_args "-qmlFiles" ${qml_files})
- endif()
-
+ # All of the module's .qml files will be listed in one of the generated
+ # .qrc files, so there's no need to list the files individually. We provide
+ # the .qrc files instead because they have the additional information for
+ # each file's resource alias.
get_target_property(qrc_files ${target} _qt_generated_qrc_files)
if (qrc_files)
list(APPEND cmd_args "-qrcFiles" ${qrc_files})