summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6AndroidMacros.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-08-13 18:40:26 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-09-08 23:37:51 +0200
commit42d0089d44bec5628884d8cf6bf2b910a298a141 (patch)
treee9a13ef631c0ada6be853b38c1f4f0a4ec4d7453 /src/corelib/Qt6AndroidMacros.cmake
parentfd3315bc614c907eef098d6940b9358b193c4327 (diff)
androiddeployqt: Add support of multiple qml root paths
If application uses qml files from multiple locations, e.g. subdirectories inside source directory it's important to provide this information to qmlimportscanner to produce consistent set of QML modules that need to be included into the end-point application apk. This makes possible to specify more than one QT_QML_ROOT_PATH per target and propagates these paths to the qmlimportscanner using androiddeployqt tool. Pick-to: 6.2 Task-number: QTBUG-93340 Change-Id: Ic31017b3f2671108adb6d6118ef1c75f1ccc3ec5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/corelib/Qt6AndroidMacros.cmake')
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index c5f04c49bc..3640624aa3 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -187,13 +187,21 @@ function(qt6_android_generate_deployment_settings target)
" \"qml-import-paths\": \"${_import_paths}\",\n")
endif()
- get_target_property(qml_root_path ${target} QT_QML_ROOT_PATH)
- if(NOT qml_root_path)
- set(qml_root_path "${target_source_dir}")
+ get_target_property(qml_root_paths ${target} QT_QML_ROOT_PATH)
+ if(NOT qml_root_paths)
+ set(qml_root_paths "${target_source_dir}")
endif()
- file(TO_CMAKE_PATH "${qml_root_path}" qml_root_path_native)
+
+ set(qml_native_root_paths "")
+ foreach(root_path IN LISTS qml_root_paths)
+ file(TO_CMAKE_PATH "${root_path}" qml_root_path_native)
+ list(APPEND qml_native_root_paths "\"${qml_root_path_native}\"")
+ endforeach()
+
+ list(JOIN qml_native_root_paths "," qml_native_root_paths)
+
string(APPEND file_contents
- " \"qml-root-path\": \"${qml_root_path_native}\",\n")
+ " \"qml-root-path\": [${qml_native_root_paths}],\n")
# App binary
string(APPEND file_contents