-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
308 lines (261 loc) · 9.12 KB
/
Copy pathCMakeLists.txt
File metadata and controls
308 lines (261 loc) · 9.12 KB
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
cmake_minimum_required(VERSION 3.15)
project(RetinalAnalysis VERSION 1.0.0 LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Compiler flags
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/src)
# ============================================================================
# SOURCE FILES
# ============================================================================
# Math module sources
set(MATH_SOURCES
src/math/Vector3.cpp
src/math/Matrix4.cpp
src/math/Ray.cpp
src/math/BoundingBox.cpp
)
# Core module sources
set(CORE_SOURCES
src/core/Event.h
src/core/EventBus.h
src/core/EventBus.cpp
src/core/ApplicationController.h
src/core/ApplicationController.cpp
)
# Data module sources
set(DATA_SOURCES
src/data/ImageVolume.cpp
src/data/Channel.cpp
src/data/TimePoint.cpp
src/data/Dataset.cpp
)
# Camera module sources
set(CAMERA_SOURCES
src/camera/Camera.cpp
src/camera/CameraController.cpp
)
# Rendering module sources
set(RENDERING_SOURCES
src/rendering/Framebuffer.cpp
src/rendering/TransferFunction.cpp
src/rendering/RayMarcher.cpp
src/rendering/VolumeRenderer.cpp
)
# Animation module sources
set(ANIMATION_SOURCES
src/animation/TimeController.cpp
)
# UI module sources
set(UI_SOURCES
src/ui/UIManager.h
src/ui/UIManager.cpp
src/ui/TimelineWidget.h
src/ui/ChannelPanel.h
src/ui/ChannelPanel.cpp
src/ui/ContrastPanel.h
src/ui/ContrastPanel.cpp
)
# Window module sources
set(WINDOW_SOURCES
src/window/Window.h
src/window/Window.cpp
src/window/InputManager.h
src/window/InputManager.cpp
src/window/RenderLoop.h
src/window/RenderLoop.cpp
)
# ============================================================================
# LIBRARIES (in dependency order)
# ============================================================================
# Create a library from math sources
add_library(retinal_math ${MATH_SOURCES})
target_include_directories(retinal_math PUBLIC ${PROJECT_SOURCE_DIR}/src)
# Create a library from core sources
add_library(retinal_core ${CORE_SOURCES})
target_include_directories(retinal_core PUBLIC ${PROJECT_SOURCE_DIR}/src)
# Create a library from camera sources
add_library(retinal_camera ${CAMERA_SOURCES})
target_include_directories(retinal_camera PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_camera retinal_math)
# Create a library from data sources
add_library(retinal_data ${DATA_SOURCES})
target_include_directories(retinal_data PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_data retinal_math)
# Create a library from rendering sources
add_library(retinal_rendering ${RENDERING_SOURCES})
target_include_directories(retinal_rendering PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_rendering retinal_math retinal_data retinal_camera)
# Create a library from animation sources
add_library(retinal_animation ${ANIMATION_SOURCES})
target_include_directories(retinal_animation PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_animation retinal_data retinal_math)
# Create a library from UI sources
add_library(retinal_ui ${UI_SOURCES})
target_include_directories(retinal_ui PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_ui retinal_core)
# Create a library from window sources
add_library(retinal_window ${WINDOW_SOURCES})
target_include_directories(retinal_window PUBLIC ${PROJECT_SOURCE_DIR}/src)
target_link_libraries(retinal_window retinal_core retinal_rendering retinal_data)
# ============================================================================
# TESTING (requires Google Test)
# ============================================================================
# Option to build tests
option(BUILD_TESTS "Build the test suite" ON)
if(BUILD_TESTS)
# Find Google Test
find_package(GTest QUIET)
if(GTest_FOUND)
enable_testing()
# Math test sources
set(MATH_TEST_SOURCES
tests/math/test_Vector3.cpp
tests/math/test_Matrix4.cpp
tests/math/test_Ray.cpp
tests/math/test_BoundingBox.cpp
)
# Core test sources
set(CORE_TEST_SOURCES
tests/core/test_EventBus.cpp
tests/core/test_ApplicationController.cpp
)
# Data test sources
set(DATA_TEST_SOURCES
tests/data/test_ImageVolume.cpp
tests/data/test_Channel.cpp
tests/data/test_TimePoint.cpp
tests/data/test_Dataset.cpp
)
# Camera test sources
set(CAMERA_TEST_SOURCES
tests/camera/test_Camera.cpp
tests/camera/test_CameraController.cpp
)
# Rendering test sources
set(RENDERING_TEST_SOURCES
tests/rendering/test_Framebuffer.cpp
tests/rendering/test_TransferFunction.cpp
tests/rendering/test_RayMarcher.cpp
tests/rendering/test_VolumeRenderer.cpp
)
# Animation test sources
set(ANIMATION_TEST_SOURCES
tests/animation/test_TimeController.cpp
)
# UI test sources
set(UI_TEST_SOURCES
tests/ui/test_UIManager.cpp
tests/ui/test_TimelineWidget.cpp
tests/ui/test_ChannelPanel.cpp
tests/ui/test_ContrastPanel.cpp
)
# Window test sources
set(WINDOW_TEST_SOURCES
tests/window/test_Window.cpp
tests/window/test_InputManager.cpp
tests/window/test_RenderLoop.cpp
)
# Create math test executable
add_executable(math_tests ${MATH_TEST_SOURCES})
target_link_libraries(math_tests
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create core test executable
add_executable(core_tests ${CORE_TEST_SOURCES})
target_link_libraries(core_tests
retinal_core
GTest::gtest
GTest::gtest_main
)
# Create camera test executable
add_executable(camera_tests ${CAMERA_TEST_SOURCES})
target_link_libraries(camera_tests
retinal_camera
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create data test executable
add_executable(data_tests ${DATA_TEST_SOURCES})
target_link_libraries(data_tests
retinal_data
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create rendering test executable
add_executable(rendering_tests ${RENDERING_TEST_SOURCES})
target_link_libraries(rendering_tests
retinal_rendering
retinal_data
retinal_camera
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create animation test executable
add_executable(animation_tests ${ANIMATION_TEST_SOURCES})
target_link_libraries(animation_tests
retinal_animation
retinal_data
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create UI test executable
add_executable(ui_tests ${UI_TEST_SOURCES})
target_link_libraries(ui_tests
retinal_ui
retinal_core
retinal_data
retinal_math
GTest::gtest
GTest::gtest_main
)
# Create window test executable
add_executable(window_tests ${WINDOW_TEST_SOURCES})
target_link_libraries(window_tests
retinal_window
retinal_rendering
retinal_core
retinal_data
retinal_camera
retinal_math
GTest::gtest
GTest::gtest_main
)
# Add tests to CTest
include(GoogleTest)
gtest_discover_tests(math_tests)
gtest_discover_tests(core_tests)
gtest_discover_tests(camera_tests)
gtest_discover_tests(data_tests)
gtest_discover_tests(rendering_tests)
gtest_discover_tests(animation_tests)
gtest_discover_tests(ui_tests)
gtest_discover_tests(window_tests)
message(STATUS "Tests will be built with Google Test")
else()
message(WARNING "Google Test not found. Tests will not be built.")
message(WARNING "Install with: brew install googletest")
endif()
endif()
# ============================================================================
# MAIN EXECUTABLE (placeholder for now)
# ============================================================================
# Uncomment when ready to build main application
# add_executable(retinal_analysis src/main.cpp)
# target_link_libraries(retinal_analysis retinal_math)
# ============================================================================
# INSTALLATION (optional)
# ============================================================================
# install(TARGETS retinal_math DESTINATION lib)
# install(DIRECTORY src/math DESTINATION include FILES_MATCHING PATTERN "*.h")