diff options
author | Cristian Adam <cristian.adam@qt.io> | 2020-10-14 15:56:20 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2020-10-15 13:14:25 +0200 |
commit | 6180dbf0679a6631aeb006637b00989f0956e103 (patch) | |
tree | a7331a50994f7dd6eee88426eb6224e19e64cacb | |
parent | 266cd7638d887b31d56964a0f13fe208821703b1 (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>
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 8 | ||||
-rw-r--r-- | tests/manual/pointer/CMakeLists.txt | 1 |
2 files changed, 8 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}") diff --git a/tests/manual/pointer/CMakeLists.txt b/tests/manual/pointer/CMakeLists.txt index 6bdb0f9e78..04e99ce4e6 100644 --- a/tests/manual/pointer/CMakeLists.txt +++ b/tests/manual/pointer/CMakeLists.txt @@ -131,6 +131,7 @@ qt_internal_add_resource(pointer "quick_shared" ${quick_shared_resource_files} ) +qt_import_qml_plugins(pointer) # special case #### Keys ignored in scope 1:.:.:pointer.pro:<TRUE>: # TEMPLATE = "app" |