From 4ef3da04c3390f02bcb0507128372e6a299dc8fd Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Thu, 19 Nov 2020 10:33:33 +0200 Subject: [PATCH] Android: use extraPrefixDirs with qmlimportscanner This will ensure that qmlimportscanner can use the extraPrefixDirs, when an extra prefix is provided like the case with Conan builds. Task-number: QTBUG-88519 Change-Id: Idec3916b043822da094973a7e246a6ee4af14c83 Reviewed-by: Andy Shaw --- src/tools/androiddeployqt/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 1b29fe73813..016db897bea 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1827,8 +1827,18 @@ bool scanImports(Options *options, QSet *usedDependencies) importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml")); if (!rootPath.isEmpty()) importPaths += shellQuote(rootPath); - for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) - importPaths += shellQuote(qmlImportPath); + for (const QString &prefix : options->extraPrefixDirs) + if (QDir().exists(prefix + QLatin1String("/qml"))) + importPaths += shellQuote(prefix + QLatin1String("/qml")); + + for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) { + if (QDir().exists(qmlImportPath)) { + importPaths += shellQuote(qmlImportPath); + } else { + fprintf(stderr, "Warning: QML import path %s does not exist.\n", + qPrintable(qmlImportPath)); + } + } qmlImportScanner += QLatin1String(" -importPath %1").arg(importPaths.join(QLatin1Char(' '))); if (options->verbose) {