summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-12 13:54:31 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-13 10:14:02 +0000
commit1f843b7d1060a382dca7d42557d52af6009f6168 (patch)
tree5c24d56fd8a6e93e1b2a22f780d3b81b761e6fb0
parentcb96c4973404c25249a6e7a5e5a1e428dd1885e1 (diff)
downloadqttools-1f843b7d1060a382dca7d42557d52af6009f6168.tar.gz
qttools-1f843b7d1060a382dca7d42557d52af6009f6168.tar.bz2
qttools-1f843b7d1060a382dca7d42557d52af6009f6168.zip
macdeployqt: Work around broken QLibraryInfo
Add fallback code path for locating qmlimportscanner relative to the macdeployqt binary. Task-number: QTBUG-46404 Change-Id: I9c837b5da518af45cef1292f9cd0422fccba8e5f Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp6
-rw-r--r--src/macdeployqt/shared/shared.cpp9
2 files changed, 13 insertions, 2 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 9c6e3fe0..3cc8f5a8 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 0cc59632..d20b2198 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";