From 75b595a6867652cc2b3ff8b2749f91236b6cb58c Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 20 Apr 2016 15:41:48 -0700 Subject: Fix macdeployqt usage when client application has no rpath to Qt libs. macdeployqt used to determine the Qt library path from one of the Qt libraries linked to by the application (by searching its rpath list). However, if an application does not have an rpath pointing to the Qt library directory, macdeployqt cannot find the Qt libraries. This is likely when the application is built with a non-qmake build system like CMake or qbs. This patch adds the Qt library path (from QLibraryInfo) as a fallback search path to allow macdeployqt to find the Qt libraries and deploy them. Task-number: QTBUG-47868 Change-Id: Ie1d005955826b416c223a1bc6cac911d2ae44b20 Reviewed-by: Guilherme Steinmann Reviewed-by: Richard Moe Gustavsen --- src/macdeployqt/shared/shared.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/macdeployqt/shared/shared.h') diff --git a/src/macdeployqt/shared/shared.h b/src/macdeployqt/shared/shared.h index 604e3ef4a..47b93f42b 100644 --- a/src/macdeployqt/shared/shared.h +++ b/src/macdeployqt/shared/shared.h @@ -37,6 +37,7 @@ #include #include #include +#include extern int logLevel; #define LogError() if (logLevel < 0) {} else qDebug() << "ERROR:" @@ -65,6 +66,24 @@ public: QString binaryDestinationDirectory; }; +class DylibInfo +{ +public: + QString binaryPath; + QVersionNumber currentVersion; + QVersionNumber compatibilityVersion; +}; + +class OtoolInfo +{ +public: + QString installName; + QString binaryPath; + QVersionNumber currentVersion; + QVersionNumber compatibilityVersion; + QList dependencies; +}; + bool operator==(const FrameworkInfo &a, const FrameworkInfo &b); QDebug operator<<(QDebug debug, const FrameworkInfo &info); @@ -91,6 +110,7 @@ inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info); void changeQtFrameworks(const QString appPath, const QString &qtPath, bool useDebugLibs); void changeQtFrameworks(const QList frameworks, const QStringList &binaryPaths, const QString &qtPath); +OtoolInfo findDependencyInfo(const QString &binaryPath); FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); QString findAppBinary(const QString &appBundlePath); QList getQtFrameworks(const QString &path, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); -- cgit v1.2.3