From 6b48b7a37ca9a38a2c1e348aa835e88b288f1893 Mon Sep 17 00:00:00 2001 From: hidefuku Date: Wed, 25 Jan 2017 15:44:30 +0900 Subject: [PATCH] Added Mac deploy --- src/AnimeEffects.pro | 11 ++++++++++- src/common.pri | 7 +++++-- src/gui/Main.cpp | 15 +++++++-------- src/gui/gui.pro | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/AnimeEffects.pro b/src/AnimeEffects.pro index d61277d6..69e72c29 100644 --- a/src/AnimeEffects.pro +++ b/src/AnimeEffects.pro @@ -21,7 +21,7 @@ export(copydata.commands) export(copytools.commands) QMAKE_EXTRA_TARGETS += first copydata copytools } -unix|macx { +unix:!macx { copydata.commands = rsync -ru $$shell_path($$PWD/../data) $$shell_path($$OUT_PWD) copytools.commands = rsync -ru $$shell_path($$PWD/../tools) $$shell_path($$OUT_PWD) first.depends = $(first) copydata copytools @@ -30,3 +30,12 @@ export(copydata.commands) export(copytools.commands) QMAKE_EXTRA_TARGETS += first copydata copytools } +macx { +copydata.commands = rsync -ru $$shell_path($$PWD/../data) $$shell_path($$OUT_PWD/AnimeEffects.app) +copytools.commands = rsync -ru $$shell_path($$PWD/../tools) $$shell_path($$OUT_PWD/AnimeEffects.app) +first.depends = $(first) copydata copytools +export(first.depends) +export(copydata.commands) +export(copytools.commands) +QMAKE_EXTRA_TARGETS += first copydata copytools +} diff --git a/src/common.pri b/src/common.pri index 093f376f..b5032531 100644 --- a/src/common.pri +++ b/src/common.pri @@ -23,9 +23,12 @@ DEFINES += "AE_PROJECT_FORMAT_OLDEST_MAJOR_VERSION=0" DEFINES += "AE_PROJECT_FORMAT_OLDEST_MINOR_VERSION=4" # OpenGL CoreProfile Option -unix|macx { +unix { DEFINES += USE_GL_CORE_PROFILE } -unix { +unix:!macx { QMAKE_RPATHDIR += ./ } +macx { +QMAKE_RPATHDIR += ../Frameworks +} diff --git a/src/gui/Main.cpp b/src/gui/Main.cpp index b2555d9e..64738098 100644 --- a/src/gui/Main.cpp +++ b/src/gui/Main.cpp @@ -101,22 +101,21 @@ int entryPoint(int argc, char *argv[]) // create qt application QApplication app(argc, argv); - - // unicode argments - const QStringList uniArgs = app.arguments(); + XC_DEBUG_REPORT() << "exe path =" << app.applicationFilePath(); // application path - const QString exeFilePath(uniArgs.at(0)); #if defined(Q_OS_MAC) - const QString appDir = QDir(app.applicationDirPath() + "/../../../").absolutePath(); + const QString appDir = QDir(app.applicationDirPath() + "/../../").absolutePath(); + app.addLibraryPath(app.applicationDirPath() + "/../PlugIns/"); #else - const QString appDir(QFileInfo(exeFilePath).dir().path()); + const QString appDir = app.applicationDirPath(); #endif - QDir::setCurrent(appDir); const QString resourceDir(appDir + "/data"); const QString stdCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); const QString cacheDir = !stdCacheDir.isEmpty() ? stdCacheDir : (appDir + "/cache"); - XC_DEBUG_REPORT() << "exe path =" << exeFilePath; + + // initialize current + QDir::setCurrent(appDir); // set fatal error handler static AEErrorHandler aeErrorHandler; diff --git a/src/gui/gui.pro b/src/gui/gui.pro index c1f81c60..bcbec1dc 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -12,7 +12,7 @@ MOC_DIR = .moc RCC_DIR = .rcc win32:RC_ICONS = ../AnimeEffects.ico -mac:ICON = ../AnimeEffects.icns +macx:ICON = ../AnimeEffects.icns msvc:LIBS += ../util/util.lib ../thr/thr.lib ../cmnd/cmnd.lib ../gl/gl.lib ../img/img.lib ../core/core.lib ../ctrl/ctrl.lib msvc:PRE_TARGETDEPS += ../util/util.lib ../thr/thr.lib ../cmnd/cmnd.lib ../gl/gl.lib ../img/img.lib ../core/core.lib ../ctrl/ctrl.lib