This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
forked from MrKepzie/Natron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.pri
290 lines (257 loc) · 10.7 KB
/
global.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Natron <http://www.natron.fr/>,
# Copyright (C) 2015 INRIA and Alexandre Gauthier
#
# Natron is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Natron is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Natron. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>
# ***** END LICENSE BLOCK *****
CONFIG += warn_on no_keywords
DEFINES += OFX_EXTENSIONS_NUKE OFX_EXTENSIONS_TUTTLE OFX_EXTENSIONS_VEGAS OFX_SUPPORTS_PARAMETRIC OFX_EXTENSIONS_TUTTLE OFX_EXTENSIONS_NATRON OFX_SUPPORTS_OPENGLRENDER OFX_SUPPORTS_DIALOG
DEFINES += OFX_SUPPORTS_MULTITHREAD
trace_ofx_actions{
DEFINES += OFX_DEBUG_ACTIONS
}
trace_ofx_params{
DEFINES += OFX_DEBUG_PARAMETERS
}
trace_ofx_properties{
DEFINES += OFX_DEBUG_PROPERTIES
}
log{
DEFINES += NATRON_LOG
}
CONFIG(debug, debug|release){
DEFINES *= DEBUG
} else {
DEFINES *= NDEBUG
}
CONFIG(noassertions) {
DEFINES *= NDEBUG QT_NO_DEBUG
}
CONFIG(snapshot) {
#message("Compiling an official snapshot (should only be done on the Natron build farm)")
DEFINES += NATRON_SNAPSHOT
}
# https://qt.gitorious.org/qt-creator/qt-creator/commit/b48ba2c25da4d785160df4fd0d69420b99b85152
unix:LIBS += $$QMAKE_LIBS_DYNLOAD
*g++* {
QMAKE_CXXFLAGS += -ftemplate-depth-1024
QMAKE_CXXFLAGS_WARN_ON += -Wextra -Wmissing-prototypes -Wmissing-declarations -Wno-multichar
GCCVer = $$system($$QMAKE_CXX --version)
contains(GCCVer,[0-3]\\.[0-9]+.*) {
} else {
contains(GCCVer,4\\.7.*) {
QMAKE_CXXFLAGS += -Wno-c++11-extensions
}
}
c++11 {
# check for at least version 4.7
contains(GCCVer,[0-3]\\.[0-9]+.*) {
error("At least GCC 4.6 is required.")
} else {
contains(GCCVer,4\\.[0-5].*) {
error("At least GCC 4.6 is required.")
} else {
contains(GCCVer,4\\.6.*) {
QMAKE_CXXFLAGS += -std=c++0x
} else {
QMAKE_CXXFLAGS += -std=c++11
}
}
}
}
}
macx {
# Set the pbuilder version to 46, which corresponds to Xcode >= 3.x
# (else qmake generates an old pbproj on Snow Leopard)
QMAKE_PBUILDER_VERSION = 46
QMAKE_MACOSX_DEPLOYMENT_VERSION = $$split(QMAKE_MACOSX_DEPLOYMENT_TARGET, ".")
QMAKE_MACOSX_DEPLOYMENT_MAJOR_VERSION = $$first(QMAKE_MACOSX_DEPLOYMENT_VERSION)
QMAKE_MACOSX_DEPLOYMENT_MINOR_VERSION = $$last(QMAKE_MACOSX_DEPLOYMENT_VERSION)
universal {
message("Compiling for universal OSX $${QMAKE_MACOSX_DEPLOYMENT_MAJOR_VERSION}.$$QMAKE_MACOSX_DEPLOYMENT_MINOR_VERSION")
contains(QMAKE_MACOSX_DEPLOYMENT_MAJOR_VERSION, 10) {
contains(QMAKE_MACOSX_DEPLOYMENT_TARGET, 4)|contains(QMAKE_MACOSX_DEPLOYMENT_MINOR_VERSION, 5) {
# OSX 10.4 (Tiger) and 10.5 (Leopard) are x86/ppc
message("Compiling for universal ppc/i386")
CONFIG += x86 ppc
}
contains(QMAKE_MACOSX_DEPLOYMENT_MINOR_VERSION, 6) {
message("Compiling for universal i386/x86_64")
# OSX 10.6 (Snow Leopard) may run on Intel 32 or 64 bits architectures
CONFIG += x86 x86_64
}
# later OSX instances only run on x86_64, universal builds are useless
# (unless a later OSX supports ARM)
}
}
#link against the CoreFoundation framework for the StandardPaths functionnality
LIBS += -framework CoreServices
}
!macx|!universal {
# precompiled headers don't work with multiple archs
CONFIG += precompile_header
}
!macx {
# c++11 build fails on Snow Leopard 10.6 (see the macx section below)
#CONFIG += c++11
}
win32 {
#ofx needs WINDOWS def
#microsoft compiler needs _MBCS to compile with the multi-byte character set.
DEFINES += WINDOWS _MBCS COMPILED_FROM_DSP XML_STATIC NOMINMAX
DEFINES -= _UNICODE UNICODE
}
win32-msvc* {
CONFIG(64bit){
message("Compiling for architecture x86 64 bits")
Release:DESTDIR = x64/release
Release:OBJECTS_DIR = x64/release/.obj
Release:MOC_DIR = x64/release/.moc
Release:RCC_DIR = x64/release/.rcc
Release:UI_DIR = x64/release/.ui
Debug:DESTDIR = x64/debug
Debug:OBJECTS_DIR = x64/debug/.obj
Debug:MOC_DIR = x64/debug/.moc
Debug:RCC_DIR = x64/debug/.rcc
Debug:UI_DIR = x64/debug/.ui
} else {
message("Compiling for architecture x86 32 bits")
Release:DESTDIR = win32/release
Release:OBJECTS_DIR = win32/release/.obj
Release:MOC_DIR = win32/release/.moc
Release:RCC_DIR = win32/release/.rcc
Release:UI_DIR = win32/release/.ui
Debug:DESTDIR = win32/debug
Debug:OBJECTS_DIR = win32/debug/.obj
Debug:MOC_DIR = win32/debug/.moc
Debug:RCC_DIR = win32/debug/.rcc
Debug:UI_DIR = win32/debug/.ui
}
}
win32-g++ {
# On MingW everything is defined with pkgconfig except boost
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
glew: PKGCONFIG += glew
expat: PKGCONFIG += expat
cairo: PKGCONFIG += cairo
shiboken: PKGCONFIG += shiboken-py2
pyside: PKGCONFIG += pyside-py2
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside-py2)/QtCore
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside-py2)/QtGui
python: PKGCONFIG += python-2.7
boost: LIBS += -lboost_serialization-mt
boost: LIBS += -lboost_serialization-mt
#See http://stackoverflow.com/questions/16596876/object-file-has-too-many-sections
Debug: QMAKE_CXXFLAGS += -Wa,-mbig-obj
}
unix {
# on Unix systems, only the "boost" option needs to be defined in config.pri
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
glew: PKGCONFIG += glew
expat: PKGCONFIG += expat
linux-* {
# link with static cairo on linux, to avoid linking to X11 libraries in NatronRenderer
cairo {
PKGCONFIG += pixman-1 freetype2 fontconfig
LIBS += $$system(pkg-config --variable=libdir cairo)/libcairo.a
}
LIBS += -ldl
} else {
cairo: PKGCONFIG += cairo
}
# User may specify an alternate python2-config from the command-line,
# as in "qmake PYTHON_CONFIG=python2.7-config"
isEmpty(PYTHON_CONFIG) {
PYTHON_CONFIG = python2-config
}
#message(PYTHON_CONFIG = $$PYTHON_CONFIG)
python {
LIBS += $$system($$PYTHON_CONFIG --ldflags)
QMAKE_CXXFLAGS += $$system($$PYTHON_CONFIG --includes)
}
# There may be different pyside.pc/shiboken.pc for different versions of python.
# pkg-config will probably give a bad answer, unless python2 is the system default.
# See for example tools/travis/install_dependencies.sh for a solution that works on Linux,
# using a custom config.pri
shiboken: PKGCONFIG += shiboken
pyside: PKGCONFIG += pyside
# The following hack also works with Homebrew if pyside is installed with option --with-python3
macx {
shiboken {
PKGCONFIG -= shiboken
PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir shiboken)
# the sed stuff is to work around an Xcode generator bug
LIBS += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --libs shiboken | sed -e s/-undefined\\ dynamic_lookup//)
}
pyside {
PKGCONFIG -= pyside
PYSIDE_PKG_CONFIG_PATH = $$system($$PYTHON_CONFIG --prefix)/lib/pkgconfig
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtCore
# QtGui include are needed because it looks for Qt::convertFromPlainText which is defined in
# qtextdocument.h in the QtGui module.
INCLUDEPATH += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --variable=includedir pyside)/QtGui
INCLUDEPATH += $$system(pkg-config --variable=includedir QtGui)
LIBS += $$system(env PKG_CONFIG_PATH=$$PYSIDE_PKG_CONFIG_PATH pkg-config --libs pyside)
}
}
} #unix
*-xcode {
# redefine cxx flags as qmake tends to automatically add -O2 to xcode projects
QMAKE_CFLAGS -= -O2
QMAKE_CXXFLAGS -= -O2
QMAKE_CXXFLAGS += -ftemplate-depth-1024
}
*clang* {
QMAKE_CXXFLAGS += -ftemplate-depth-1024 -Wno-c++11-extensions
QMAKE_CXXFLAGS_WARN_ON += -Wextra
c++11 {
QMAKE_CXXFLAGS += -std=c++11
}
}
# see http://clang.llvm.org/docs/AddressSanitizer.html and http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
addresssanitizer {
message("Compiling with AddressSanitizer (for gcc >= 4.8 and clang). Set the ASAN_SYMBOLIZER_PATH environment variable to point to the llvm-symbolizer binary, or make sure llvm-symbolizer in in your PATH.")
message("To compile with clang, use a clang-specific spec, such as unsupported/linux-clang, unsupported/macx-clang, linux-clang or macx-clang.")
message("For example, with Qt4 on OS X:")
message(" sudo port install clang-3.4")
message(" sudo port select clang mp-clang-3.4")
message(" export ASAN_SYMBOLIZER_PATH=/opt/local/bin/llvm-symbolizer-mp-3.4")
message(" qmake -spec unsupported/macx-clang CONFIG+=addresssanitizer ...")
message("see http://clang.llvm.org/docs/AddressSanitizer.html")
CONFIG += debug
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1
QMAKE_LFLAGS += -fsanitize=address -g
# QMAKE_LFLAGS += -fsanitize-blacklist=../asan_blacklist.ignore
# QMAKE_CXXFLAGS += -fsanitize-blacklist=../asan_blacklist.ignore
# QMAKE_CFLAGS += -fsanitize-blacklist=../asan_blacklist.ignore
}
# see http://clang.llvm.org/docs/ThreadSanitizer.html
threadsanitizer {
message("Compiling with ThreadSanitizer (for clang).")
message("see http://clang.llvm.org/docs/ThreadSanitizer.html")
CONFIG += debug
QMAKE_CXXFLAGS += -fsanitize=thread -O1
QMAKE_CFLAGS += -fsanitize=thread -O1
QMAKE_LFLAGS += -fsanitize=thread -g
}
coverage {
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0
QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CLEAN += $(OBJECTS_DIR)/*.gcda $(OBJECTS_DIR)/*.gcno
}