-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.h.in
34 lines (29 loc) · 942 Bytes
/
config.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#define INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define UNITY_2D_DIR "${UNITY_2D_DIR}"
#define UNITY_DIR "${UNITY_DIR}"
#include <QCoreApplication>
inline bool isRunningInstalled() {
static bool cachedResult = QCoreApplication::applicationDirPath() == INSTALL_PREFIX "/bin";
return cachedResult;
}
inline QString unity2dDirectory() {
if (isRunningInstalled()) {
return QString(INSTALL_PREFIX "/" UNITY_2D_DIR);
} else {
return QString(QCoreApplication::applicationDirPath()+"/../../");
}
}
inline QString unity2dImportPath() {
if (isRunningInstalled()) {
return QString(INSTALL_PREFIX "/lib/qt4/imports");
} else {
return QString(QCoreApplication::applicationDirPath()+"/../");
}
}
inline QString unity2dPluginsPath() {
if (isRunningInstalled()) {
return QString(INSTALL_PREFIX "/lib/unity-2d/plugins");
} else {
return unity2dDirectory();
}
}