From 82cc00bfcddc7aa747f86f4e780fc013afe2f062 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 11 Nov 2013 16:32:35 +0100 Subject: [PATCH] templates: fix deployment for ios Task-number: QTCREATORBUG-10683 Change-Id: I1a7d721430b4a5bd15422d161f58a4247da79e08 Reviewed-by: Fawzi Mohamed --- .../qtquick1applicationviewer.cpp | 6 ++++- .../qtquick2applicationviewer.cpp | 6 ++++- .../qtcreator/templates/shared/deployment.pri | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp b/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp index d487e109f9c..0b7ffe85da1 100644 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp +++ b/share/qtcreator/templates/qtquick/qtquick_1_1/qtquick1applicationviewer/qtquick1applicationviewer.cpp @@ -27,7 +27,11 @@ class QtQuick1ApplicationViewerPrivate QString QtQuick1ApplicationViewerPrivate::adjustPath(const QString &path) { -#ifdef Q_OS_MAC +#if defined(Q_OS_IOS) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_MAC) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); diff --git a/share/qtcreator/templates/qtquick/qtquick_2_0/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/share/qtcreator/templates/qtquick/qtquick_2_0/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 127a25e6c41..2a62ca97b67 100644 --- a/share/qtcreator/templates/qtquick/qtquick_2_0/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/share/qtcreator/templates/qtquick/qtquick_2_0/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -22,7 +22,11 @@ class QtQuick2ApplicationViewerPrivate QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) { -#if defined(Q_OS_MAC) +#if defined(Q_OS_IOS) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_MAC) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); diff --git a/share/qtcreator/templates/shared/deployment.pri b/share/qtcreator/templates/shared/deployment.pri index 21ee643ae26..63dc0f39239 100644 --- a/share/qtcreator/templates/shared/deployment.pri +++ b/share/qtcreator/templates/shared/deployment.pri @@ -89,6 +89,28 @@ android-no-sdk { export(copydeploymentfolders.commands) QMAKE_EXTRA_TARGETS += first copydeploymentfolders } +} ios { + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, \\\\, /) + target = $CODESIGNING_FOLDER_PATH/$$eval($${deploymentfolder}.target) + target = $$replace(target, \\\\, /) + sourcePathSegments = $$split(source, /) + targetFullPath = $$target/$$last(sourcePathSegments) + targetFullPath ~= s,/\\.?/,/, + !isEqual(source,$$targetFullPath) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += mkdir -p \"$$target\" + copyCommand += && cp -r \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = echo Copying application data... && $$copyCommand + !isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";" + QMAKE_POST_LINK += "$$copyCommand" + export(QMAKE_POST_LINK) + } } else:unix { maemo5 { desktopfile.files = $${TARGET}.desktop