forked from frankyeh/DSI-Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
226 lines (208 loc) · 6.32 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
cmake_minimum_required(VERSION 3.19)
project(DSI_Studio VERSION "2022.01.17" LANGUAGES CXX;C)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 COMPONENTS Core Gui OpenGL Charts Network Widgets REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenGL REQUIRED)
find_package(CUDA)
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
if (MSVC)
add_compile_options(/bigobj)
else ()
add_compile_options(-Wa,-mbig-obj)
endif ()
endif()
if(CUDA_FOUND)
project(DSI_Studio VERSION "2022.01.17" LANGUAGES CUDA CXX;C)
endif()
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/tracking
${CMAKE_SOURCE_DIR}/reconstruction
${CMAKE_SOURCE_DIR}/dicom
${CMAKE_SOURCE_DIR}/connectometry)
set(DSI_STUDIO_HEADERS mainwindow.h
dicom/dicom_parser.h
dicom/dwi_header.hpp
libs/dsi/tessellated_icosahedron.hpp
libs/dsi/odf_process.hpp
libs/dsi/image_model.hpp
libs/dsi/gqi_process.hpp
libs/dsi/gqi_mni_reconstruction.hpp
libs/dsi/dti_process.hpp
libs/dsi/basic_voxel.hpp
SliceModel.h
tracking/tracking_window.h
reconstruction/reconstruction_window.h
tracking/slice_view_scene.h
opengl/glwidget.h
opengl/renderingtablewidget.h
opengl/tract_render.hpp
opengl/region_render.hpp
libs/tracking/tracking_method.hpp
libs/tracking/roi.hpp
libs/tracking/fib_data.hpp
libs/tracking/basic_process.hpp
libs/tracking/tract_cluster.hpp
tracking/region/regiontablewidget.h
tracking/region/Regions.h
libs/tracking/tract_model.hpp
tracking/tract/tracttablewidget.h
qcolorcombobox.h
libs/tracking/tracking_thread.hpp
libs/prog_interface_static_link.h
libs/mapping/atlas.hpp
view_image.h
libs/gzip_interface.hpp
manual_alignment.h
tracking/tract_report.hpp
tracking/color_bar_dialog.hpp
tracking/connectivity_matrix_dialog.h
tracking/atlasdialog.h
filebrowser.h
program_option.hpp
qcompletelineedit.h
libs/mapping/connectometry_db.hpp
connectometry/createdbdialog.h
connectometry/match_db.h
connectometry/db_window.h
connectometry/group_connectometry.hpp
connectometry/group_connectometry_analysis.h
regtoolbox.h
auto_track.h
tracking/device.h
tracking/devicetablewidget.h
libs/dsi/hist_process.hpp
xnat_dialog.h
console.h
reg.hpp)
set(DSI_STUDIO_FORMS mainwindow.ui
tracking/tracking_window.ui
reconstruction/reconstruction_window.ui
dicom/dicom_parser.ui
view_image.ui
manual_alignment.ui
tracking/tract_report.ui
tracking/color_bar_dialog.ui
tracking/connectivity_matrix_dialog.ui
tracking/atlasdialog.ui
filebrowser.ui
connectometry/createdbdialog.ui
connectometry/match_db.ui
connectometry/db_window.ui
connectometry/group_connectometry.ui
regtoolbox.ui
auto_track.ui
console.ui
xnat_dialog.ui)
set(DSI_STUDIO_RESOURCES icons.qrc)
set(DSI_STUDIO_SOURCES
main.cpp
mainwindow.cpp
dicom/dicom_parser.cpp
dicom/dwi_header.cpp
libs/utility/prog_interface.cpp
libs/dsi/dsi_interface_imp.cpp
libs/dsi/gqi_process.cpp
libs/tracking/tract_cluster.cpp
SliceModel.cpp
tracking/tracking_window.cpp
reconstruction/reconstruction_window.cpp
tracking/slice_view_scene.cpp
opengl/glwidget.cpp
opengl/tract_render.cpp
opengl/renderingtablewidget.cpp
opengl/region_render.cpp
tracking/region/regiontablewidget.cpp
tracking/region/Regions.cpp
libs/tracking/tract_model.cpp
tracking/tract/tracttablewidget.cpp
qcolorcombobox.cpp
cmd/trk.cpp
cmd/rec.cpp
cmd/src.cpp
libs/mapping/atlas.cpp
cmd/ana.cpp
view_image.cpp
manual_alignment.cpp
tracking/tract_report.cpp
tracking/color_bar_dialog.cpp
cmd/exp.cpp
tracking/connectivity_matrix_dialog.cpp
libs/dsi/tessellated_icosahedron.cpp
cmd/atl.cpp
tracking/atlasdialog.cpp
cmd/vis.cpp
filebrowser.cpp
qcompletelineedit.cpp
libs/tracking/fib_data.cpp
libs/tracking/tracking_thread.cpp
cmd/ren.cpp
libs/mapping/connectometry_db.cpp
connectometry/createdbdialog.cpp
connectometry/match_db.cpp
connectometry/db_window.cpp
connectometry/group_connectometry.cpp
connectometry/group_connectometry_analysis.cpp
regtoolbox.cpp
cmd/cnn.cpp
cmd/cnt.cpp
cmd/qc.cpp
libs/dsi/basic_voxel.cpp
libs/dsi/image_model.cpp
cmd/reg.cpp
auto_track.cpp
cmd/atk.cpp
tracking/device.cpp
tracking/devicetablewidget.cpp
libs/gzip_interface.cpp
cmd/xnat.cpp
xnat_dialog.cpp
console.cpp)
set(DSI_STUDIO_OTHER_FILES options.txt
dicom_tag.txt
FreeSurferColorLUT.txt)
if(WIN32)
set(DSI_STUDIO_EXEC
WIN32
dsi_studio.rc)
endif()
if(APPLE)
set(DSI_STUDIO_EXEC
MACOSX_BUNDLE)
endif()
if(CUDA_FOUND)
set(DSI_STUDIO_CUDA
cuda/reg.cu)
endif()
add_executable(dsi_studio ${DSI_STUDIO_EXEC} ${DSI_STUDIO_SOURCES} ${DSI_STUDIO_CUDA} ${DSI_STUDIO_FORMS} ${DSI_STUDIO_HEADERS} ${DSI_STUDIO_RESOURCES})
set_target_properties(dsi_studio PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS NONE)
target_compile_definitions(dsi_studio PUBLIC DSISTUDIO_RELEASE_NAME="Chen")
target_compile_definitions(dsi_studio PUBLIC DSISTUDIO_RELEASE_CODE=11770345)
target_compile_definitions(dsi_studio PUBLIC QT6_PATCH)
if(CUDA_FOUND)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -allow-unsupported-compiler --extended-lambda")
set(CMAKE_CUDA_RUNTIME_LIBRARY "Static")
target_compile_definitions(dsi_studio PUBLIC TIPL_USE_CUDA)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.23.0")
set_property(TARGET dsi_studio PROPERTY CUDA_ARCHITECTURES all)
else()
set_property(TARGET dsi_studio PROPERTY CUDA_ARCHITECTURES "50;52;53;60;61;62;70;72;75;80;86")
endif()
endif(CUDA_FOUND)
target_include_directories(dsi_studio PUBLIC
${CMAKE_SOURCE_DIR}/libs
${CMAKE_SOURCE_DIR}/libs/dsi
${CMAKE_SOURCE_DIR}/libs/tracking
${CMAKE_SOURCE_DIR}/libs/mapping
${CMAKE_SOURCE_DIR}/dicom
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${TIPL_DIR})
target_link_libraries(dsi_studio Qt6::Core Qt6::Gui Qt6::OpenGL Qt6::Charts Qt6::Network Qt6::Widgets ZLIB::ZLIB OpenGL::GL OpenGL::GLU)
if(CUDA_FOUND)
target_link_libraries(dsi_studio ${CUDA_LIBRARIES})
endif(CUDA_FOUND)