forked from neurodebian/caret
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcaret_qmake_include.pro
executable file
·373 lines (335 loc) · 9.99 KB
/
caret_qmake_include.pro
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
CONFIG += qt thread
QT += network opengl xml
QT -= qt3support
#message("WINDOWS with MINGW")
#message("If you get link errors with MinGW on windows ")
#message("with OpenGL, you may to add the MinGW library ")
#message("path from Qt's SDK into the link path. ")
#message(" -L\C:\QtSDK\mingw\lib")
#message("")
#message("If you get a link error something like ")
#message("GetStockObject@4, you may need to add ")
#message("-mwindows into the link command")
#message("")
#
# when missing, it must be the GIFTI API library
#
DEFINES += CARET_FLAG
#=================================================================================
#
# Check for needed environment variables
#
!exists( $(VTK_INC_DIR)/vtkConfigure.h ) {
error("The environment variable for VTK includes \"VTK_INC_DIR\" not defined.")
}
!exists( $(QTDIR)/include/qt.h ) {
!exists( $(QTDIR)/include/Qt ) {
!exists( $(QTDIR)/include/qt4/qt.h ) {
!exists( $(QTDIR)/include/qt4/Qt ) {
!exists( $(QTDIR)/include ) {
error("The environment variable for QT \"QTDIR\" not defined.")
}
}
}
}
}
#=================================================================================
#
# Update include paths
#
INCLUDEPATH += \
../caret_brain_set \
../caret_command_operations \
../caret_common \
../caret_gifti \
../caret_gui \
../caret_statistics \
../caret_files \
../caret_uniformize \
../caret_widgets \
../caret_cifti
DEPENDPATH += \
../caret_brain_set \
../caret_command_operations \
../caret_common \
../caret_gifti \
../caret_gui \
../caret_statistics \
../caret_files \
../caret_uniformize \
../caret_widgets \
../caret_cifti
#=================================================================================
#
# Is NetCDF/Minc available ?
#
exists( $(NETCDF_INC_DIR)/minc.h ) {
DEFINES += HAVE_MINC
INCLUDEPATH += $$(NETCDF_INC_DIR)
NETCDF_LIBS = -L$$(NETCDF_LIB_DIR) \
-lminc \
-lnetcdf
exists( $(NETCDF_LIB_DIR)/libminc2.a ) {
NETCDF_LIBS += -lminc2
#
# Apparently, if libminc2 exists, libminc
# may not and is not necessary
#
!exists( $(NETCDF_LIB_DIR)/libminc.a ) {
NETCDF_LIBS -= -lminc
}
}
exists( $(NETCDF_LIB_DIR)/libminc2.so ) {
NETCDF_LIBS += -lminc2
}
message( "Building with MINC support" )
}
#
# Is NetCDF/Minc NOT available
#
!exists( $(NETCDF_INC_DIR)/minc.h ) {
message( "Building WITHOUT MINC support" )
}
#==============================================================================
#
# QWT settings
#
exists( $(QWT_INC_DIR)/qwt.h ) {
message("Building with QWT support")
DEFINES += HAVE_QWT
INCLUDEPATH += $$(QWT_INC_DIR)
}
!exists( $(QWT_INC_DIR)/qwt.h ) {
message("Building WITHOUT QWT support")
}
#==============================================================================
#
# VTK settings
#
!vs:!nmake:INCLUDEPATH += $$(VTK_INC_DIR) #visual studio has separate include dirs for debug and release
#
# have VTK compiler defines (primarily for GIFTI API)
#
DEFINES += HAVE_VTK
#
# VTK 5.x flag
#
DEFINES += HAVE_VTK5
message( "Building with VTK5 support" )
#
#
#
VTK_LIBS_TEMP = -lvtkFiltering \
-lvtkGenericFiltering \
-lvtkImaging \
-lvtkGraphics \
-lvtkIO \
-lvtkFiltering \
-lvtkCommon \
-lvtksys \
-lvtkjpeg \
-lvtkpng \
-lvtkexpat \
-lvtkzlib
#==============================================================================
#==============================================================================
#
# There are five major target platforms, Unix, OSX, Windows/Msys, Windows/VisualStudio, Debian/Ubuntu.
#
#
# Windows/Msys Specific
#
# qmake doesn't have an OR operator when checking conditionals, so I check for win32, then if it's not vs AND not nmake, assume msys,
# otherwise it's either vs or nmake.
win32 {
!vs:!nmake {
INCLUDEPATH += ../caret_vtk4_classes
INCLUDEPATH += $$(VTK_INC_DIR)/vtkmpeg2encode
VTK_LIBS = -L$$(VTK_LIB_DIR) $$VTK_LIBS_TEMP
exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
message( "Building WITH MPEG support" )
DEFINES += HAVE_MPEG
VTK_LIBS += -lvtkMPEG2Encode
}
#
# We need to include zlib on windows
#
!exists( $(ZLIB_INC_DIR)/zlib.h ) {
error( "You must define ZLIB_INC_DIR to the ZLIB include files directory.")
}
CONFIG += rtti exceptions console
INCLUDEPATH += $$(ZLIB_INC_DIR)
LIBS += -L$$(ZLIB_LIB_DIR) -lz
contains (DEFINES, HAVE_QWT) {
QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwt
}
}
#
# Windows/Visual Studio Specific
#
else {
CONFIG(debug,release|debug):INCLUDEPATH += $$(VTK_INC_DIR)
CONFIG(release,release|debug):INCLUDEPATH += $$(VTK_RELEASE_INC_DIR)
INCLUDEPATH += ../caret_vtk4_classes
CONFIG(debug,release|debug):INCLUDEPATH += $$(VTK_INC_DIR)/vtkmpeg2encode
CONFIG(release,release|debug):INCLUDEPATH += $$(VTK_RELEASE_INC_DIR)/vtkmpeg2encode
VTK_LIBS = -L$$(VTK_LIB_DIR) $$VTK_LIBS_TEMP
VTK_RELEASE_LIBS = -L$$(VTK_RELEASE_LIB_DIR) $$VTK_LIBS_TEMP
exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
message( "Building WITH MPEG support" )
DEFINES += HAVE_MPEG
VTK_LIBS += -lvtkMPEG2Encode
VTK_REELEASE_LIBS += -lvtkMPEG2Encode
}
#
# We need to include zlib on windows
#
!exists( $(ZLIB_INC_DIR)/zlib.h ) {
error( "You must define ZLIB_INC_DIR to the ZLIB include files directory.")
}
CONFIG += rtti exceptions console
INCLUDEPATH += $$(ZLIB_INC_DIR)
LIBS += -L$$(ZLIB_LIB_DIR) -lzlib
contains (DEFINES, HAVE_QWT) {
CONFIG(release,release|debug):QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwt
CONFIG(debug,release|debug):QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwtd
}
}
}
#
# OsX Specific
#
macx {
QMAKE_CXXFLAGS += -fopenmp -DCARET_OS_MACOSX
QMAKE_LFLAGS += -fopenmp
INCLUDEPATH += ../caret_vtk4_classes
INCLUDEPATH += $$(VTK_INC_DIR)/vtkmpeg2encode
!dll:VTK_LIBS = ../caret_vtk4_classes/libCaretVtk4Classes.a
VTK_LIBS += -L$$(VTK_LIB_DIR) $$VTK_LIBS_TEMP
exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ):!ubuntu {
message( "Building WITH MPEG support" )
DEFINES += HAVE_MPEG
VTK_LIBS += -lvtkMPEG2Encode
}
contains (DEFINES, HAVE_QWT) {
QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwt
}
#
# Target 10.5 if it is available, else 10.6
#
exists( /Developer/SDKs/MacOSX10.5.sdk ) {
QMAKE_CXXFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
QMAKE_LFLAGS_RELEASE += -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk
}
!exists( /Developer/SDKs/MacOSX10.5.sdk ) {
exists( /Developer/SDKs/MacOSX10.6.sdk ) {
QMAKE_CXXFLAGS += -isysroot /Developer/SDKs/MacOSX10.6.sdk
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
QMAKE_LFLAGS_RELEASE += -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk
}
}
QMAKE_LFLAGS_APP += -w
LIBS += -lz
}
#
# Debian/Ubuntu Specific
#
ubuntu {
message ("Building for Ubuntu")
QMAKE_CXXFLAGS += -fopenmp -DUBUNTU
QMAKE_LFLAGS += -fopenmp
VTK_LIBS += -L$$(VTK_LIB_DIR) -lvtkFiltering \
-lvtkGenericFiltering \
-lvtkImaging \
-lvtkGraphics \
-lvtkIO \
-lvtkFiltering \
-lvtkCommon \
-lvtksys
LIBS += -lpng
contains (DEFINES, HAVE_QWT) {
QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwt-qt4
}
DEFINES -= HAVE_MPEG
VTK_LIBS -= -lvtkMPEG2Encode
exists( $(NETCDF_INC_DIR)/minc.h ) {
DEFINES += HAVE_MINC
INCLUDEPATH += $$(NETCDF_INC_DIR)
NETCDF_LIBS = -L$$(NETCDF_LIB_DIR) \
-lminc2 \
-lnetcdf
NETCDF_LIBS -= -lminc
}
}
#
# All other Unix variants
#
unix:!macx:!ubuntu {
contains(QMAKE_CXX, icpc) {
#QMAKE_CXXFLAGS += -openmp -ipo
#QMAKE_LFLAGS += -openmp -openmp-link static -ipo
QMAKE_CXXFLAGS += -openmp
QMAKE_LFLAGS += -openmp -openmp-link static
}
!contains(QMAKE_CXX, icpc) {
QMAKE_CXXFLAGS += -fopenmp
QMAKE_LFLAGS += -fopenmp
}
INCLUDEPATH += ../caret_vtk4_classes
INCLUDEPATH += $$(VTK_INC_DIR)/vtkmpeg2encode
!dll:VTK_LIBS = ../caret_vtk4_classes/libCaretVtk4Classes.a
VTK_LIBS += -L$$(VTK_LIB_DIR) $$VTK_LIBS_TEMP
exists( $(VTK_INC_DIR)/vtkMPEG2Writer.h ) {
message( "Building WITH MPEG support" )
DEFINES += HAVE_MPEG
VTK_LIBS += -lvtkMPEG2Encode
}
contains (DEFINES, HAVE_QWT) {
QWT_LIBS = -L$$(QWT_LIB_DIR) -lqwt
}
}
#==============================================================================
#==============================================================================
#
# For build flags, there are two major platforms, Unix and Visual Studio
#
#
# Unix (including msys win32) Build Flags
#
!vs:!nmake {
release {
QMAKE_CXXFLAGS -= -g -O1 -Wl,-O1
QMAKE_LFLAGS -= -g -O1 -Wl,-O1
QMAKE_CXXFLAGS += -O2 -Wno-deprecated
QMAKE_LFLAGS += -O2
!debug:!profile:QMAKE_POST_LINK=strip -S $(TARGET)
}
debug {
QMAKE_CXXFLAGS += -g -Wno-deprecated
QMAKE_LFLAGS += -g
QMAKE_CXXFLAGS -= -O2
QMAKE_LFLAGS -= -O2
}
profile {
QMAKE_CXXFLAGS += -pg -O0
QMAKE_LFLAGS += -pg
}
}
#
# Visual Studio specific build flags
#
else:win32 {
CONFIG(release,release|debug) {
QMAKE_CXXFLAGS_RELEASE -= -O1 -Wl,-O2
QMAKE_LFLAGS_RELEASE -= -O1 -Wl,-O2
QMAKE_CXXFLAGS_RELEASE += -O2 -D_USE_MATH_DEFINES -wd"4290" -wd"4244" -wd"4267" -wd"4305" -wd"4100" -wd"4005" -MP -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -DCARET_OS_WINDOWS
QMAKE_LFLAGS_RELEASE += -O2 -D_USE_MATH_DEFINES -STACK:10000000
}
CONFIG(debug,release|debug) {
QMAKE_CXXFLAGS_DEBUG -= -O2
QMAKE_LFLAGS_DEBUG -= -O2
QMAKE_CXXFLAGS_DEBUG += -D_DEBUG -D_USE_MATH_DEFINES -wd"4290" -wd"4244" -wd"4267" -wd"4305" -wd"4100" -wd"4005" -MP -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -DCARET_OS_WINDOWS
QMAKE_LFLAGS_DEBUG += -DEBUG -STACK:10000000
}
}