From 54e31e82c3d858e42da1e802a0d856e201b3e5b6 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Tue, 5 Jan 2021 16:56:05 +1100 Subject: [PATCH] android: Generate deployment settings file with correct qml-import-paths The qt6_android_generate_deployment_settings() command had been creating deployment settings files with the wrong key name for qml import paths. This resulted in the QT_QML_IMPORT_PATH target property having no effect. The QT_QML_IMPORT_PATH property can also potentially hold a list, not just a single value. This change now handles the list case as well, previously qt6_android_generate_deployment_settings() was assuming it always held a single path if it was set. Fixes: QTBUG-89628 Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b Reviewed-by: Joerg Bornemann (cherry picked from commit ae91e3365b775789fd323301a28ed48619953369) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/Qt6AndroidMacros.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index df04619605a..f4732e4579d 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -156,9 +156,14 @@ function(qt6_android_generate_deployment_settings target) get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH) if (qml_import_path) - file(TO_CMAKE_PATH "${qml_import_path}" qml_import_path_native) + set(_import_paths "") + foreach(_path IN LISTS qml_import_path) + file(TO_CMAKE_PATH "${_path}" _path) + list(APPEND _import_paths ${_path}) + endforeach() + list(JOIN _import_paths "," _import_paths) string(APPEND file_contents - " \"qml-import-path\": \"${qml_import_path_native}\",\n") + " \"qml-import-paths\": \"${_import_paths}\",\n") endif() get_target_property(qml_root_path ${target} QT_QML_ROOT_PATH)