aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2020-10-14 15:56:20 +0200
committerCristian Adam <cristian.adam@qt.io>2020-10-15 13:14:25 +0200
commit6180dbf0679a6631aeb006637b00989f0956e103 (patch)
treea7331a50994f7dd6eee88426eb6224e19e64cacb /src/qml/Qt6QmlMacros.cmake
parent266cd7638d887b31d56964a0f13fe208821703b1 (diff)
CMake: Add generated qrc files to the qmlimportscanner
The list of generated qrc files is passed to qmlimportscanner via the -qrcFiles parameter. qt_import_qml_plugins(pointer) needs to be explicitly called in CMake unlike qmake which does the equivalent behind the scenes. Task-number: QTBUG-85994 Change-Id: Ia49a5e1fe5df11c0b3b8ff4c1765377767ca2478 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 826d814807..c2fe180ffe 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -972,10 +972,16 @@ but this file does not exist. Possible reasons include:
set(qml_imports_file_path
"${CMAKE_CURRENT_BINARY_DIR}/Qt6_QmlPlugins_Imports_${target}.cmake")
- # TODO: QTBUG-85994 Figure out how to handle resources like in fix for QTBUG-82873.
+ get_target_property(qrc_files ${target} _qt_generated_qrc_files)
+ if (qrc_files)
+ list(APPEND qrcFilesArguments "-qrcFiles")
+ list(APPEND qrcFilesArguments ${qrc_files})
+ endif()
+
message(STATUS "Running qmlimportscanner to find used QML plugins. ")
execute_process(COMMAND
"${tool_path}" "${arg_PATH_TO_SCAN}" -importPath "${qml_path}"
+ ${qrcFilesArguments}
-cmake-output
OUTPUT_FILE "${qml_imports_file_path}")