-
Notifications
You must be signed in to change notification settings - Fork 0
/
o3dstudio.pri
175 lines (138 loc) · 4 KB
/
o3dstudio.pri
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
!isEmpty(O3DSTUDIO_PRI_INCLUDED):error("qtcreator.pri already included")
O3DSTUDIO_PRI_INCLUDED = 1
#
# Environment and compiler switch
#
O3S_BUILD_ENV = $$getenv(VIRTUAL_ENV)
isEmpty(O3S_BUILD_ENV) {
O3S_BUILD_ENV = "amd64"
}
BUILD_PREFIX = $$getenv(PREFIX)
isEmpty(BUILD_PREFIX) {
linux: BUILD_PREFIX = /usr/local
macx: BUILD_PREFIX = /usr/local
}
ENV_CC = $$getenv(CC)
!isEmpty(ENV_CC) {
QMAKE_CC = $$ENV_CC
}
ENV_CXX = $$getenv(CXX)
!isEmpty(ENV_CXX) {
QMAKE_CXX = $$ENV_CXX
}
ENV_AR = $$getenv(AR)
!isEmpty($$ENV_AR) {
QMAKE_AR_CMD = $$ENV_AR
}
#ENV_LD = $$getenv(LD)
#!isEmpty($$ENV_LD) {
# QMAKE_LINK = $$ENV_LD
#}
#
# Global
#
O3DSTUDIO_VERSION = 0.1
VERSION = $$O3DSTUDIO_VERSION
O3DSTUDIO_COPYRIGHT_YEAR = 2017
BINARY_ARTIFACTS_BRANCH = master
O3S_BIN_DIR = $$join($$list($$top_builddir, "bin"), "/")
CONFIG(debug, debug|release) {
# O3S_BUILD_TARGET_MODE = "-dbg"
} else {
# CONFIG(profile, profile|release) {
# O3S_BUILD_TARGET_MODE = "-pro"
# } else {
# O3S_BUILD_TARGET_MODE = ""
# }
}
# O3S_BIN_DIR = $$absolute_path($$join($$list($$PWD, "..", "build-o3dstudio-$$O3S_BUILD_ENV$$O3S_BUILD_TARGET_MODE", "bin"), "/"))
CONFIG += c++14 # declarative_debug
QMAKE_CXXFLAGS += -fno-rtti
QMAKE_CXXFLAGS_RELEASE += -O2 -DNDEBUG -ffunction-sections # -fvisibility=hidden
# @todo msvc
*-clang* {
QMAKE_CFLAGS_DEBUG += -O0 -D_DEBUG -glldb
QMAKE_CXXFLAGS_DEBUG += -O0 -D_DEBUG -glldb
QMAKE_LFLAGS_DEBUG += -g -glldb
}
*-g++* {
QMAKE_CFLAGS_DEBUG += -O0 -D_DEBUG -ggdb
QMAKE_CXXFLAGS_DEBUG += -O0 -D_DEBUG -ggdb
QMAKE_LFLAGS_DEBUG += -g -ggdb
}
darwin:!minQtVersion(5, 7, 0) {
# Qt 5.6 still sets deployment target 10.7, which does not work
# with all C++11/14 features (e.g. std::future)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
}
osx {
} else {
}
defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
greaterThan(QT_MAJOR_VERSION, $$maj) {
return(true)
}
return(false)
}
macx: PLATFORM = "mac"
else:win32: PLATFORM = "windows"
else:linux-*: PLATFORM = "linux-$${ARCHITECTURE}"
else: PLATFORM = "unknown"
macx:INSTALLER_NAME = "o3d-studio-$${O3DSTUDIO_VERSION}"
else:INSTALLER_NAME = "$${BASENAME}"
TARGETPATH = $$shell_path($$_PRO_FILE_PWD_)
INCLUDEPATH += $$top_srcdir/common/include
!isEmpty(O3S_PLUGIN_DEPENDS) {
# LIBS *= -L$$STUDIO_PLUGIN_PATH # plugin path from output directory
# LIBS *= -L$$LINK_PLUGIN_PATH # when output path is different from build directory
}
LANGUAGES = en fr
TRANSLATIONS = $$files($$TARGETPATH/languages/*.ts)
TRANSLATION_TARGET_DIR = $$O3S_BIN_DIR/languages
TRANSLATIONS_FILES =
qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
qmfile = $$shadowed($$tsfile)
qmfile ~= s,.ts$,.qm,
qmdir = $$dirname(qmfile)
!exists($$qmdir) {
mkpath($$qmdir)|error("Aborting.")
}
command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
system($$command)|error("Failed to run: $$command")
TRANSLATIONS_FILES += $$qmfile
}
# Copies the given files to the destination directory
defineTest(copyToDestdir) {
files = $$1
PATH_TO = $$2
QMAKE_POST_LINK += $$QMAKE_MKDIR $$quote($$DESTDIR/$$PATH_TO/) $$escape_expand(\\n\\t)
for(FILE, files) {
DDIR = $$DESTDIR
# Replace slashes in paths with backslashes for Windows
win32:FILE ~= s,/,\\,g
win32:DDIR ~= s,/,\\,g
QMAKE_POST_LINK += $$QMAKE_COPY -r $$quote($$FILE) $$quote($$DDIR/$$PATH_TO/) $$escape_expand(\\n\\t)
}
export(QMAKE_POST_LINK)
}
# o3d in debug @todo for both
INCLUDEPATH += $$(PREFIX)/lib/objective3d-dbg/
DISTFILES += \
$$PWD/cmake/FindObjective3DStudio.cmake