summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Parker <csparker247@gmail.com>2021-03-31 15:34:10 -0400
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-05-06 14:58:39 +0200
commit3b88ee4fa2dcc0345bbb5da6025327cfebf92dc8 (patch)
treeb72d7a1b5195e57760ee4d0942fa9295abd9af7d
parentfbbe42d337d8c349a3b891df251393ce3b85c4ba (diff)
downloadqttools-3b88ee4fa2dcc0345bbb5da6025327cfebf92dc8.tar.gz
macdeployqt: Fix plugin resolution bugs for non-standard installs
Uses QLibraryInfo to resolve plugins at installed locations. [ChangeLog][macOS][macdeployqt] Uses QLibraryInfo to resolve plugins at install locations. Task-number: QTBUG-91644 Change-Id: Ie309061024abd7a58ea62d707716342c99897c26 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 03abcbabbd4caa11048d19d95b23f165cd7a5361)
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 8914e835b..628a71378 100644
--- a/src/macdeployqt/macdeployqt/main.cpp
+++ b/src/macdeployqt/macdeployqt/main.cpp
@@ -27,6 +27,7 @@
****************************************************************************/
#include <QCoreApplication>
#include <QDir>
+#include <QLibraryInfo>
#include "../shared/shared.h"
@@ -237,11 +238,29 @@ int main(int argc, char **argv)
deploymentInfo.deployedFrameworks.end()).values();
}
- if (plugins && !deploymentInfo.qtPath.isEmpty()) {
- deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins";
- LogNormal();
- deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
- createQtConf(appBundlePath);
+ // Handle plugins
+ if (plugins) {
+ // Set the plugins search directory
+ deploymentInfo.pluginPath = QLibraryInfo::path(QLibraryInfo::PluginsPath);
+
+ // Sanity checks
+ if (deploymentInfo.pluginPath.isEmpty()) {
+ LogError() << "Missing Qt plugins path\n";
+ return 1;
+ }
+
+ if (!QDir(deploymentInfo.pluginPath).exists()) {
+ LogError() << "Plugins path does not exist" << deploymentInfo.pluginPath << "\n";
+ return 1;
+ }
+
+ // Deploy plugins
+ Q_ASSERT(!deploymentInfo.pluginPath.isEmpty());
+ if (!deploymentInfo.pluginPath.isEmpty()) {
+ LogNormal();
+ deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
+ createQtConf(appBundlePath);
+ }
}
if (runStripEnabled)
@@ -257,4 +276,3 @@ int main(int argc, char **argv)
return 0;
}
-