summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-11 13:46:14 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-13 09:03:44 +0000
commiteeb8d316f9e7ae2e5d09edecda5dcc6b03bdf9c3 (patch)
treeb5b58485bf8993eae021a50ac664244e112f1eb0
parent6a86f7026816fa657f070d10f9164d7b7099a71c (diff)
downloadqttools-eeb8d316f9e7ae2e5d09edecda5dcc6b03bdf9c3.tar.gz
macdeployqt: fix QML import deps deployment
The plugin deployment step needs to run after QML imports deployment in order to take frameworks added by QML imports into account. Move deployPlugins() down. Update deploymentInfo. deployedFrameworks after deployQmlImports() has run. Change-Id: I1d9ce827b1c0205ec37f027d03a9b4a2bb846801 Task-number: QTBUG-46981 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r--src/macdeployqt/macdeployqt/main.cpp22
-rw-r--r--src/macdeployqt/shared/shared.cpp16
-rw-r--r--src/macdeployqt/shared/shared.h1
3 files changed, 31 insertions, 8 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp
index 750316f8d..cf9000c72 100644
--- a/src/macdeployqt/macdeployqt/main.cpp
+++ b/src/macdeployqt/macdeployqt/main.cpp
@@ -142,13 +142,6 @@ int main(int argc, char **argv)
DeploymentInfo deploymentInfo = deployQtFrameworks(appBundlePath, additionalExecutables, useDebugLibs);
- if (plugins && !deploymentInfo.qtPath.isEmpty()) {
- deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins";
- LogNormal();
- deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
- createQtConf(appBundlePath);
- }
-
// Convenience: Look for .qml files in the current directoty if no -qmldir specified.
if (qmlDirs.isEmpty()) {
QDir dir;
@@ -157,9 +150,22 @@ int main(int argc, char **argv)
}
}
- if (!qmlDirs.isEmpty())
+ if (!qmlDirs.isEmpty()) {
deployQmlImports(appBundlePath, deploymentInfo, qmlDirs);
+ // Update deploymentInfo.deployedFrameworks - the QML imports
+ // may have brought in extra frameworks as dependencies.
+ deploymentInfo.deployedFrameworks += findAppFrameworkNames(appBundlePath);
+ deploymentInfo.deployedFrameworks = deploymentInfo.deployedFrameworks.toSet().toList();
+ }
+
+ if (plugins && !deploymentInfo.qtPath.isEmpty()) {
+ deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins";
+ LogNormal();
+ deployPlugins(appBundlePath, deploymentInfo, useDebugLibs);
+ createQtConf(appBundlePath);
+ }
+
if (runCodesign)
codesign(codesignIdentiy, appBundlePath);
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index 5ed6c43de..b85fa0d5a 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -332,6 +332,22 @@ QString findAppBinary(const QString &appBundlePath)
return QString();
}
+QStringList findAppFrameworkNames(const QString &appBundlePath)
+{
+ QStringList frameworks;
+
+ // populate the frameworks list with QtFoo.framework etc,
+ // as found in /Contents/Frameworks/
+ QString searchPath = appBundlePath + "/Contents/Frameworks/";
+ QDirIterator iter(searchPath, QStringList() << QString::fromLatin1("*.framework"), QDir::Dirs);
+ while (iter.hasNext()) {
+ iter.next();
+ frameworks << iter.fileInfo().fileName();
+ }
+
+ return frameworks;
+}
+
QStringList findAppLibraries(const QString &appBundlePath)
{
QStringList result;
diff --git a/src/macdeployqt/shared/shared.h b/src/macdeployqt/shared/shared.h
index 27628b7a2..c3cbf1d67 100644
--- a/src/macdeployqt/shared/shared.h
+++ b/src/macdeployqt/shared/shared.h
@@ -105,6 +105,7 @@ void changeIdentification(const QString &id, const QString &binaryPath);
void changeInstallName(const QString &oldName, const QString &newName, const QString &binaryPath);
void runStrip(const QString &binaryPath);
QString findAppBinary(const QString &appBundlePath);
+QStringList findAppFrameworkNames(const QString &appBundlePath);
void codesignFile(const QString &identity, const QString &filePath);
void codesign(const QString &identity, const QString &appBundlePath);
void createDiskImage(const QString &appBundlePath);