@@ -89,6 +89,7 @@ int main(int argc, char **argv)
8989 qInfo () << " -no-translations : Skip deployment of translations." ;
9090 qInfo () << " -qmake=<path> : The qmake executable to use." ;
9191 qInfo () << " -qmldir=<path> : Scan for QML imports in the given path." ;
92+ qInfo () << " -qmlimport=<path> : Add the given path to QML module search locations." ;
9293 qInfo () << " -show-exclude-libs : Print exclude libraries list." ;
9394 qInfo () << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default)," ;
9495 qInfo () << " 2 = normal, 3 = debug." ;
@@ -215,6 +216,7 @@ int main(int argc, char **argv)
215216 bool qmldirArgumentUsed = false ;
216217 bool skipTranslations = false ;
217218 QStringList qmlDirs;
219+ QStringList qmlImportPaths;
218220 QString qmakeExecutable;
219221 extern QStringList extraQtPlugins;
220222 extern QStringList excludeLibs;
@@ -413,6 +415,13 @@ int main(int argc, char **argv)
413415 LogError () << " Missing qml directory path" ;
414416 else
415417 qmlDirs << argument.mid (index+1 );
418+ } else if (argument.startsWith (QByteArray (" -qmlimport" ))) {
419+ LogDebug () << " Argument found:" << argument;
420+ int index = argument.indexOf (' =' );
421+ if (index == -1 )
422+ LogError () << " Missing qml import path" ;
423+ else
424+ qmlImportPaths << argument.mid (index+1 );
416425 } else if (argument.startsWith (" -no-copy-copyright-files" )) {
417426 LogDebug () << " Argument found:" << argument;
418427 copyCopyrightFiles = false ;
@@ -471,7 +480,7 @@ int main(int argc, char **argv)
471480 }
472481
473482 if (!qmlDirs.isEmpty ()) {
474- bool ok = deployQmlImports (appDirPath, deploymentInfo, qmlDirs);
483+ bool ok = deployQmlImports (appDirPath, deploymentInfo, qmlDirs, qmlImportPaths );
475484 if (!ok && qmldirArgumentUsed)
476485 return 1 ; // exit if the user explicitly asked for qml import deployment
477486 // Update deploymentInfo.deployedLibraries - the QML imports
0 commit comments