From: Morten Johan Sørvig Date: Wed, 12 Aug 2015 11:54:31 +0000 (+0200) Subject: macdeployqt: Work around broken QLibraryInfo X-Git-Tag: v5.5.90+alpha1~2^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f843b7d1060a382dca7d42557d52af6009f6168;p=platform%2Fupstream%2Fqttools.git 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 --- diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp index 9c6e3fe..3cc8f5a 100644 --- a/src/macdeployqt/macdeployqt/main.cpp +++ b/src/macdeployqt/macdeployqt/main.cpp @@ -30,11 +30,15 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include +#include + #include "../shared/shared.h" -#include 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 0cc5963..d20b219 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -30,6 +30,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include #include #include #include @@ -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";