Skip to content

Commit

Permalink
Added Mac deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hidefuku committed Jan 25, 2017
1 parent 68f16f9 commit 6b48b7a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
11 changes: 10 additions & 1 deletion src/AnimeEffects.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
7 changes: 5 additions & 2 deletions src/common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
15 changes: 7 additions & 8 deletions src/gui/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b48b7a

Please sign in to comment.