summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6AndroidMacros.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-10-27 13:28:54 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-11-02 21:45:35 +0100
commitb1fc45dbbfcca3ed0c489c01a5faa2f87ed09a35 (patch)
tree189963a41603e70ed17bab218f095cc1ad38ffcb /src/corelib/Qt6AndroidMacros.cmake
parent9f762f610b03f74a888a652c96d435ecfa85703c (diff)
Add Android qml staging prefix to qml import paths
Qml modules are staged to the special folder when building for android. To make them visible we need add this folder to qml imports paths that are used by qmlimportscanner. Task-number: QTBUG-96898 Change-Id: Iaf1e06c64553e8ea27f020226095da36e1f9d881 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d05da5f306c7c30616d33fe540e64dd2fee46924)
Diffstat (limited to 'src/corelib/Qt6AndroidMacros.cmake')
-rw-r--r--src/corelib/Qt6AndroidMacros.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake
index f527b949c4..00e7eabe5d 100644
--- a/src/corelib/Qt6AndroidMacros.cmake
+++ b/src/corelib/Qt6AndroidMacros.cmake
@@ -178,7 +178,14 @@ function(qt6_android_generate_deployment_settings target)
" \"android-target-sdk-version\": \"${android_target_sdk_version}\",\n")
endif()
+ # QML import paths
get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH)
+ if(NOT "${QT_QML_OUTPUT_DIRECTORY}" STREQUAL "")
+ # Need to prepend the default qml module output directory to take precedence
+ # over other qml import paths. By default QT_QML_OUTPUT_DIRECTORY is set to
+ # ${CMAKE_BINARY_DIR}/android-qml for Android.
+ list(PREPEND qml_import_path "${QT_QML_OUTPUT_DIRECTORY}")
+ endif()
if (qml_import_path)
set(_import_paths "")
foreach(_path IN LISTS qml_import_path)