forked from qt-creator/qt-creator
Fixed the data deployment on OSX
Switchen from QMAKE_BUNDLE_DATA to QMAKE_EXTRA_TARGETS, like we already do on Windows and Linux. QMAKE_BUNDLE_DATA does not seem to create make targets. We need to copy-if-changed the files into the resources folder on each run. Also pushed the Resources/ folder one level deeper, into Contents/.
This commit is contained in:
@@ -67,13 +67,17 @@ symbian {
|
||||
target.path = /opt/bin
|
||||
INSTALLS += target
|
||||
} else:macx {
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
item = item$${deploymentfolder}
|
||||
itemsources = $${item}.files
|
||||
$$itemsources = $$eval($${deploymentfolder}.source)
|
||||
itempath = $${item}.path
|
||||
$$itempath = Resources/$$eval($${deploymentfolder}.target)
|
||||
QMAKE_BUNDLE_DATA += $$item
|
||||
!isEqual(PWD,$$OUT_PWD) {
|
||||
copyCommand = @echo Copying application data...
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
|
||||
copyCommand += && $(MKDIR) $$target
|
||||
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
|
||||
}
|
||||
copydeploymentfolders.commands = $$copyCommand
|
||||
first.depends = $(first) copydeploymentfolders
|
||||
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
|
||||
message($$copyCommand)
|
||||
}
|
||||
} else { #linux
|
||||
!isEqual(PWD,$$OUT_PWD) {
|
||||
|
||||
@@ -26,7 +26,7 @@ QmlApplicationView::QmlApplicationView(const QString &mainQmlFile, QWidget *pare
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
m_d->mainQmlFile = QCoreApplication::applicationDirPath()
|
||||
+ QLatin1String("/../../Resources/") + mainQmlFile;
|
||||
+ QLatin1String("/../Resources/") + mainQmlFile;
|
||||
#else
|
||||
m_d->mainQmlFile = mainQmlFile;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user