diff options
author | Ilya Bizyaev <bizyaev@zoho.com> | 2018-10-06 19:59:56 +0300 |
---|---|---|
committer | Ilya Bizyaev <bizyaev@zoho.com> | 2018-10-31 21:22:13 +0000 |
commit | 24189b5f0935914a979b7e9d3786bec8f9f019bc (patch) | |
tree | 6e50ef18000010a0d5e85a5befa1ec8d06f07d79 /src/macdeployqt/shared/shared.cpp | |
parent | 76cdf802b7333b037d005b75a2cb7f3623359335 (diff) |
Add option to specify qmlimportscanner importPaths
This patch adds a new option, -qmlimport, which enables
macdeployqt to pass custom QML module import paths to
qmlimportscanner.
Fixes: QTBUG-70977
Change-Id: I39edfb88e48e05c42c6c4690efa3e728046baff3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src/macdeployqt/shared/shared.cpp')
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index 33d29ecc2..a6ff37ea0 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -1216,11 +1216,12 @@ static bool importLessThan(const QVariant &v1, const QVariant &v2) } // Scan qml files in qmldirs for import statements, deploy used imports from Qml2ImportsPath to Contents/Resources/qml. -bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs) +bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs, QStringList &qmlImportPaths) { LogNormal() << ""; LogNormal() << "Deploying QML imports "; - LogNormal() << "Application QML file search path(s) is" << qmlDirs; + LogNormal() << "Application QML file path(s) is" << qmlDirs; + LogNormal() << "QML module search path(s) is" << qmlImportPaths; // Use qmlimportscanner from QLibraryInfo::BinariesPath QString qmlImportScannerPath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlimportscanner"); @@ -1243,6 +1244,8 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf argumentList.append("-rootPath"); argumentList.append(qmlDir); } + for (const QString &importPath : qmlImportPaths) + argumentList << "-importPath" << importPath; QString qmlImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); argumentList.append( "-importPath"); argumentList.append(qmlImportsPath); |