diff options
Diffstat (limited to 'src/macdeployqt')
-rw-r--r-- | src/macdeployqt/macdeployqt/main.cpp | 6 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp index 9c6e3fe03..3cc8f5a8e 100644 --- a/src/macdeployqt/macdeployqt/main.cpp +++ b/src/macdeployqt/macdeployqt/main.cpp @@ -30,11 +30,15 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include <QCoreApplication> +#include <QDir> + #include "../shared/shared.h" -#include <qdir.h> int main(int argc, char **argv) { + QCoreApplication app(argc, argv); + QString appBundlePath; if (argc > 1) appBundlePath = QString::fromLocal8Bit(argv[1]); diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index 0cc596320..d20b2198e 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -30,6 +30,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include <QCoreApplication> #include <QString> #include <QStringList> #include <QDebug> @@ -1079,8 +1080,14 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf LogNormal() << "Deploying QML imports "; LogNormal() << "Application QML file search path(s) is" << qmlDirs; - // verify that qmlimportscanner is in BinariesPath + // Use qmlimportscanner from QLibraryInfo::BinariesPath QString qmlImportScannerPath = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlimportscanner"); + + // Fallback: Look relative to the macdeployqt binary + if (!QFile(qmlImportScannerPath).exists()) + qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner"; + + // Verify that we found a qmlimportscanner binary if (!QFile(qmlImportScannerPath).exists()) { LogError() << "qmlimportscanner not found at" << qmlImportScannerPath; LogError() << "Rebuild qtdeclarative/tools/qmlimportscanner"; |