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 <joerg.bornemann@qt.io>
(cherry picked from commit ae91e3365b775789fd323301a28ed48619953369)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Craig Scott 2021-01-05 16:56:05 +11:00 committed by Qt Cherry-pick Bot
parent 7b356d7367
commit 54e31e82c3

View File

@ -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)