@@ -89,6 +89,7 @@ int main(int argc, char **argv)
89
89
qInfo () << " -no-translations : Skip deployment of translations." ;
90
90
qInfo () << " -qmake=<path> : The qmake executable to use." ;
91
91
qInfo () << " -qmldir=<path> : Scan for QML imports in the given path." ;
92
+ qInfo () << " -qmlimport=<path> : Add the given path to QML module search locations." ;
92
93
qInfo () << " -show-exclude-libs : Print exclude libraries list." ;
93
94
qInfo () << " -verbose=<0-3> : 0 = no output, 1 = error/warning (default)," ;
94
95
qInfo () << " 2 = normal, 3 = debug." ;
@@ -215,6 +216,7 @@ int main(int argc, char **argv)
215
216
bool qmldirArgumentUsed = false ;
216
217
bool skipTranslations = false ;
217
218
QStringList qmlDirs;
219
+ QStringList qmlImportPaths;
218
220
QString qmakeExecutable;
219
221
extern QStringList extraQtPlugins;
220
222
extern QStringList excludeLibs;
@@ -413,6 +415,13 @@ int main(int argc, char **argv)
413
415
LogError () << " Missing qml directory path" ;
414
416
else
415
417
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 );
416
425
} else if (argument.startsWith (" -no-copy-copyright-files" )) {
417
426
LogDebug () << " Argument found:" << argument;
418
427
copyCopyrightFiles = false ;
@@ -471,7 +480,7 @@ int main(int argc, char **argv)
471
480
}
472
481
473
482
if (!qmlDirs.isEmpty ()) {
474
- bool ok = deployQmlImports (appDirPath, deploymentInfo, qmlDirs);
483
+ bool ok = deployQmlImports (appDirPath, deploymentInfo, qmlDirs, qmlImportPaths );
475
484
if (!ok && qmldirArgumentUsed)
476
485
return 1 ; // exit if the user explicitly asked for qml import deployment
477
486
// Update deploymentInfo.deployedLibraries - the QML imports
0 commit comments