From 553be332f2e33a292a1392b4db8fa1b7a6790386 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Fri, 9 Mar 2018 15:33:46 +0100 Subject: Provide QML import paths to androiddeployqt Summary: This makes the qmlimportscanner find our QML files and plugins correctly. That's IMHO much cleaner than the full copy of everything in the lib/qml folder we do via the android-extra-plugins list. Reviewers: #build_system, apol Reviewed By: apol Subscribers: #frameworks Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D11177 --- toolchain/Android.cmake | 10 ++++++++++ toolchain/deployment-file.json.in | 1 + 2 files changed, 11 insertions(+) diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 4590539e..a8e3c96e 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -239,6 +239,16 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) set(EXPORT_DIR "${CMAKE_BINARY_DIR}/${QTANDROID_EXPORTED_TARGET}_build_apk/") set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/${ANDROID_ABI}/lib${QTANDROID_EXPORTED_TARGET}.so") + set(QML_IMPORT_PATHS "") + foreach(prefix ${ECM_ADDITIONAL_FIND_ROOT_PATH}) + if(EXISTS "${prefix}/lib/qml") + if (QML_IMPORT_PATHS) + set(QML_IMPORT_PATHS "${QML_IMPORT_PATHS},${prefix}/lib/qml") + else() + set(QML_IMPORT_PATHS "${prefix}/lib/qml") + endif() + endif() + endforeach() configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json.in") if (CMAKE_GENERATOR STREQUAL "Unix Makefiles") diff --git a/toolchain/deployment-file.json.in b/toolchain/deployment-file.json.in index 6aa1a7c7..5730758c 100644 --- a/toolchain/deployment-file.json.in +++ b/toolchain/deployment-file.json.in @@ -9,6 +9,7 @@ "target-architecture": "@ANDROID_ABI@", "application-binary": "@EXECUTABLE_DESTINATION_PATH@", "qml-root-path": "@CMAKE_SOURCE_DIR@", + "qml-import-paths": "@QML_IMPORT_PATHS@", ##EXTRALIBS## ##EXTRAPLUGINS## "android-package-source-directory": "@ANDROID_APK_DIR@", -- cgit v1.2.1