summaryrefslogtreecommitdiffstats
path: root/src/macdeployqt
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-01 11:01:44 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-02 03:54:56 +0200
commitcb72077e562a5a53e52f7ac94b0c3c26320c6242 (patch)
tree24327b6aa3234e1b3d0865204a455a0ebb3e3cb8 /src/macdeployqt
parente2bb989e237da8479a2dca647e3420861ad526e2 (diff)
parentbda7ece99a8162118a91e9f475c149be39846ecd (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/designer/src/designer/qdesigner.cpp One side changed Q_OS_MAC -> Q_OS_MACOS; the other changed it to Q_OS_OSX and combined with Q_OS_WIN. Kept the latter. tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result One side added some XML next to where another made a local change. Change-Id: I812b55fbaccc85baa9856aedf90f9258428dfcab
Diffstat (limited to 'src/macdeployqt')
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp9
-rw-r--r--src/macdeployqt/shared/shared.cpp16
2 files changed, 23 insertions, 2 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 2e6ad0c29..5488a5f61 100644
--- a/src/macdeployqt/macdeployqt/main.cpp
+++ b/src/macdeployqt/macdeployqt/main.cpp
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
qDebug() << " -always-overwrite : Copy files even if the target file exists";
qDebug() << " -codesign=<ident> : Run codesign with the given identity on all executables";
qDebug() << " -appstore-compliant: Skip deployment of components that use private API";
+ qDebug() << " -libpath=<path> : Add the given path to the library search path";
qDebug() << "";
qDebug() << "macdeployqt takes an application bundle as input and makes it";
qDebug() << "self-contained by copying in the Qt frameworks and plugins that";
@@ -85,6 +86,7 @@ int main(int argc, char **argv)
bool useDebugLibs = false;
extern bool runStripEnabled;
extern bool alwaysOwerwriteEnabled;
+ extern QStringList librarySearchPath;
QStringList additionalExecutables;
bool qmldirArgumentUsed = false;
QStringList qmlDirs;
@@ -132,6 +134,13 @@ int main(int argc, char **argv)
LogError() << "Missing qml directory path";
else
qmlDirs << argument.mid(index+1);
+ } else if (argument.startsWith(QByteArray("-libpath"))) {
+ LogDebug() << "Argument found:" << argument;
+ int index = argument.indexOf('=');
+ if (index == -1)
+ LogError() << "Missing library search path";
+ else
+ librarySearchPath << argument.mid(index+1);
} else if (argument == QByteArray("-always-overwrite")) {
LogDebug() << "Argument found:" << argument;
alwaysOwerwriteEnabled = true;
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index b9d71d11e..47bd70e17 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -51,6 +51,7 @@
bool runStripEnabled = true;
bool alwaysOwerwriteEnabled = false;
bool runCodesign = false;
+QStringList librarySearchPath;
QString codesignIdentiy;
bool appstoreCompliant = false;
int logLevel = 1;
@@ -293,15 +294,26 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl
} else if (trimmed.startsWith("/") == false) { // If the line does not contain a full path, the app is using a binary Qt package.
QStringList partsCopy = parts;
partsCopy.removeLast();
+ foreach (QString path, librarySearchPath) {
+ if (!path.endsWith("/"))
+ path += '/';
+ QString nameInPath = path + parts.join("/");
+ if (QFile::exists(nameInPath)) {
+ info.frameworkDirectory = path + partsCopy.join("/");
+ break;
+ }
+ }
if (currentPart.contains(".framework")) {
- info.frameworkDirectory = "/Library/Frameworks/" + partsCopy.join("/");
+ if (info.frameworkDirectory.isEmpty())
+ info.frameworkDirectory = "/Library/Frameworks/" + partsCopy.join("/");
if (!info.frameworkDirectory.endsWith("/"))
info.frameworkDirectory += "/";
state = FrameworkName;
--part;
continue;
} else if (currentPart.contains(".dylib")) {
- info.frameworkDirectory = "/usr/lib/" + partsCopy.join("/");
+ if (info.frameworkDirectory.isEmpty())
+ info.frameworkDirectory = "/usr/lib/" + partsCopy.join("/");
if (!info.frameworkDirectory.endsWith("/"))
info.frameworkDirectory += "/";
state = DylibName;