-
Notifications
You must be signed in to change notification settings - Fork 105
/
CMakeLists.txt
272 lines (255 loc) · 6.28 KB
/
CMakeLists.txt
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
project(SUMA)
# SUMA library
add_afni_library(
SUMA
MarchingCubes/MarchingCubes.c
PLY/obj_io.c
PLY/plyfile.c
SUMA_BrainWrap.c
SUMA_Color.c
SUMA_CreateDO.c
SUMA_DataSets.c
SUMA_display.c
SUMA_display_b.c
SUMA_DOmanip.c
SUMA_dot.c
SUMA_driver.c
SUMA_Engine.c
SUMA_ExpEval.c
SUMA_GeomComp.c
SUMA_global.c
SUMA_help.c
SUMA_HomerFunc.c
SUMA_input.c
SUMA_IsoSurfaceFunc.c
SUMA_IV_FaceSetsextract.c
SUMA_IV_XYZextract.c
SUMA_Load_Surface_Object.c
SUMA_LocalStat.c
SUMA_MiscFunc.c
SUMA_niml.c
SUMA_ParseCommands.c
SUMA_plot.c
SUMA_SegFunc.c
SUMA_SegOpts.c
SUMA_spharm.c
SUMA_SphericalMapping.c
SUMA_Surface_IO.c
SUMA_SurfaceToSurface.c
SUMA_SurfNorm.c
SUMA_SVmanip.c
SUMA_trackball.c
SUMA_VolData.c
SUMA_volume_render.c
SUMA_xColBar.c
)
target_include_directories(
SUMA PUBLIC PLY ${CMAKE_CURRENT_SOURCE_DIR}
)
target_compile_definitions(SUMA PUBLIC SUMA_COMPILED)
# if system GLw is used it is linked against (may require a patch. See
# afni/src/other_builds/OS_notes.linux_fedora_25_64.txt). Otherwise
# the c files are included directly in the library
if(NOT (USE_SYSTEM_GLW))
target_sources(SUMA PRIVATE GLw_local/GL/GLwDrawA.c)
target_include_directories(
SUMA PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/GLw_local
)
endif()
target_link_libraries(
SUMA
PUBLIC $<TARGET_NAME_IF_EXISTS:GLw::GLw>
PRIVATE AFNI::mrix
Motif::Motif
${X11_Xt_LIB}
${X11_LIBRARIES}
${X11_Xmu_LIB}
AFNI::mri
$<TARGET_NAME_IF_EXISTS:AFNI::GLUT>
$<TARGET_NAME_IF_EXISTS:GLUT::GLUT>
$<TARGET_NAME_IF_EXISTS:XQuartzGL::GLUT>
$<TARGET_NAME_IF_EXISTS:OpenGL::GLU>
$<TARGET_NAME_IF_EXISTS:XQuartzGL::GLU>
${X11_Xi_LIB}
track_tools
segtools
AFNI::3DEdge
NIFTI::nifti2
NIFTI::nifticdf
)
# suma GUI:
add_afni_executable(suma SUMA_suma.c)
target_link_libraries(
suma
PRIVATE SUMA
AFNI::mrix
Motif::Motif
${X11_Xt_LIB}
${X11_LIBRARIES}
AFNI::track_tools
AFNI::segtools
$<TARGET_NAME_IF_EXISTS:OpenGL::GLU>
$<TARGET_NAME_IF_EXISTS:XQuartzGL::GLU>
)
# Programs (for which the source files have SUMA_ prepended)
set(PROGRAMS
prompt_user
MakeColorMap
ScaleToMap
inflate_compare
ConvertDset
ROI2dataset
SurfSmooth
SurfPatch
SurfQual
SurfClust
ConvexHull
3dSkullStrip
3dSeg
3dCRUISEtoAFNI
3dGenPriors
3dGenFeatureDist
3dBRAIN_VOYAGERtoAFNI
3dVol2Surf
SurfMeasures
FSread_annot
SampBias
3dSurfMask
SurfToSurf
ROIgrow
AnalyzeTrace
DriveSuma
SurfDist
SpharmReco
SpharmDeco
SurfDsetInfo
SurfLocalStat
SurfFWHM
NikoMap
SurfInfo
3dSurf2Vol
SurfRetinoMap
ParseName
RestSym
SurfExtrema
3dinfill
HalloSuma
InstaTract
niprobe
inspec
quickspec
CreateIcosahedron
MapIcosahedron
3dHist
SurfaceMetrics
ConvertSurface
ProgramTemplate
# Load_Surface_Object Homer
)
foreach(program ${PROGRAMS})
add_afni_executable(${program} SUMA_${program}.c)
target_link_libraries(
${program}
PRIVATE SUMA
AFNI::mrix
AFNI::track_tools
AFNI::segtools
${X11_Xt_LIB}
${X11_LIBRARIES}
NIFTI::nifti2
NIFTI::nifticdf
)
endforeach(program)
add_afni_executable(volume_render SUMA_volume_render.c)
target_link_libraries(
volume_render
PRIVATE SUMA AFNI::mrix $<TARGET_NAME_IF_EXISTS:XQuartzGL::GLU>
$<TARGET_NAME_IF_EXISTS:OpenGL::GLU> NIFTI::nifti2
NIFTI::nifticdf
)
set_target_properties(
volume_render PROPERTIES COMPILE_FLAGS -DDO_VOLUME_MAIN
)
# Targets where name matches source file name
foreach(prog_with_name_as_source prompt_popup)
add_afni_executable(
${prog_with_name_as_source} ${prog_with_name_as_source}.c
)
target_link_libraries(
${prog_with_name_as_source}
PRIVATE SUMA
AFNI::mrix
Motif::Motif
${X11_Xt_LIB}
${X11_LIBRARIES}
NIFTI::nifti2
NIFTI::nifticdf
)
endforeach()
# targets with suma prepended
foreach(suma_target pixmap2eps;glxdino;paperplane)
# the following might be desired for paperplane:
# add_definitions(-DSUMA_COMPILED -DnoGLwidget)
set(target_with_suma SUMA_${suma_target})
add_afni_executable(${target_with_suma} ${target_with_suma}.c)
target_link_libraries(
${target_with_suma}
PRIVATE SUMA
AFNI::mrix
Motif::Motif
${X11_Xt_LIB}
${X11_LIBRARIES}
${X11_Xmu_LIB}
NIFTI::nifti2
NIFTI::nifticdf
$<TARGET_NAME_IF_EXISTS:OpenGL::GLU>
$<TARGET_NAME_IF_EXISTS:XQuartzGL::GLU>
)
endforeach()
# Some other programs:
add_afni_executable(SUMA_Read_SpecFile SUMA_Load_Surface_Object.c)
target_link_libraries(
SUMA_Read_SpecFile PRIVATE SUMA AFNI::mri NIFTI::nifti2
NIFTI::nifticdf
)
add_afni_executable(CompareSurfaces SUMA_compare_surfaces.c)
target_link_libraries(
CompareSurfaces PRIVATE SUMA AFNI::mri NIFTI::nifti2
NIFTI::nifticdf
)
add_afni_executable(Surf2VolCoord SUMA_Surf2VolCoord_demo.c)
target_link_libraries(
Surf2VolCoord PRIVATE SUMA AFNI::mri NIFTI::nifti2 NIFTI::nifticdf
)
add_afni_executable(
path_optimize SUMA_path_optimize.c SUMA_SurfWarp.c
)
target_link_libraries(
path_optimize PRIVATE SUMA AFNI::mri ${X11_Xt_LIB} NIFTI::nifti2
NIFTI::nifticdf
)
# gts dependent programs
if(TARGET gts)
add_afni_library(suma_gts SUMA_gts.c SUMA_gts_insert.c)
target_link_libraries(
suma_gts
PUBLIC SUMA gts GLib2::glib
PRIVATE AFNI::mri NIFTI::nifti2 NIFTI::nifticdf
)
add_afni_executable(SurfMesh SUMA_coarsen.c)
target_link_libraries(
SurfMesh PRIVATE suma_gts AFNI::mri NIFTI::nifti2 NIFTI::nifticdf
)
foreach(program BrainSkin IsoSurface)
add_afni_executable(${program} SUMA_${program}.c)
target_link_libraries(
${program} PRIVATE suma_gts AFNI::mri NIFTI::nifti2
NIFTI::nifticdf
)
endforeach()
else()
message(
STATUS
"GTS library not found - not compiling SurfMesh, BrainSkin, and IsoSurface"
)
endif()