-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
146 lines (135 loc) · 3.87 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
cmake_minimum_required(VERSION 3.26)
project(DooT2)
# Custom CMake modules
include(cmake/GitVersion.cmake)
# Fetch the software version hash from git
git_version()
# Add external dependencies
add_subdirectory(ext)
find_package(SDL2 REQUIRED)
find_package(Eigen3 3.4 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenMP REQUIRED)
# Source files
set(DOOT2_GUI_SOURCES
src/gui/GameWindow.cpp
src/gui/Gui.cpp
src/gui/ImageRelay.cpp
src/gui/ImagesWindow.cpp
src/gui/PlotWindow.cpp
src/gui/TrainingWindow.cpp
src/gui/Window.cpp
)
set(DOOT2_ML_SOURCES
src/ml/Model.cpp
src/ml/Trainer.cpp
src/ml/models/AutoEncoderModel.cpp
src/ml/models/EncoderModel.cpp
src/ml/models/MultiLevelAutoEncoderModel.cpp
src/ml/models/RandomWalkerModel.cpp
src/ml/modules/AdaptiveConv2d.cpp
src/ml/modules/AdaptiveConvTranspose2d.cpp
src/ml/modules/AdaptiveFourierConv2d.cpp
src/ml/modules/AdaptiveResNetConvBlock.cpp
src/ml/modules/AdaptiveResNetFourierConvBlock.cpp
src/ml/modules/AdaptiveSqueezeExcitation.cpp
src/ml/modules/Attention.cpp
src/ml/modules/Attention2D.cpp
src/ml/modules/Discriminator.cpp
src/ml/modules/EncodingDiscriminator.cpp
src/ml/modules/FlowDecoder.cpp
src/ml/modules/FourierConv2d.cpp
src/ml/modules/FrameDecoder.cpp
src/ml/modules/FrameEncoder.cpp
src/ml/modules/LinearResidualModule.cpp
src/ml/modules/MultiLevelDecoderModule.cpp
src/ml/modules/MultiLevelEncoderModule.cpp
src/ml/modules/MultiLevelFrameDecoder.cpp
src/ml/modules/MultiLevelFrameEncoder.cpp
src/ml/modules/ResNetConvBlock.cpp
src/ml/modules/ResNetDownscaleConvBlock.cpp
src/ml/modules/ResNetFourierConvBlock.cpp
src/ml/modules/ResNetLinearBlock.cpp
src/ml/modules/ResNeXtModule.cpp
src/ml/modules/SqueezeExcitation.cpp
src/ml/modules/TransformerBlock.cpp
src/ml/modules/ViTBlock.cpp
)
set(DOOT2_UTIL_SOURCES
src/util/ExperimentUtils.cpp
src/util/Image.cpp
src/util/SequenceCache.cpp
src/util/SequenceStorage.cpp
src/util/TensorUtils.cpp
src/util/TimeSeries.cpp
)
set(DOOT2_SOURCES
${DOOT2_GUI_SOURCES}
${DOOT2_ML_SOURCES}
${DOOT2_UTIL_SOURCES}
src/main.cpp
src/ActionManager.cpp
src/App.cpp
src/DoorTraversalActionModule.cpp
src/Heatmap.cpp
)
# Add the main executable
add_executable(doot2 ${DOOT2_SOURCES})
target_include_directories(doot2
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
PUBLIC ${SDL2_INCLUDE_DIRS}
PUBLIC ext/CLI11/include
PUBLIC ext/GraphicsUtils/ext/stb
)
target_link_libraries(doot2
PUBLIC gvizdoom
PUBLIC gut_opengl
PUBLIC ImPlot
PUBLIC ${SDL2_LIBRARIES}
PUBLIC Eigen3::Eigen
PUBLIC opencv_highgui
PUBLIC torch_interface
PUBLIC nlohmann_json
PUBLIC pthread
PUBLIC OpenMP::OpenMP_CXX
)
target_compile_definitions(doot2
PUBLIC ASSETS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/assets\"
PUBLIC GIT_VERSION=\"${GIT_VERSION}\"
)
set_target_properties(doot2 PROPERTIES
CXX_STANDARD 20
CUDA_ARCHITECTURES native
)
# Add tests
set(DOOT2_TEST_SOURCES
src/util/TimeSeries.cpp
src/util/SequenceStorage.cpp
src/tests/TestTimeSeries.cpp
src/tests/TestSequence.cpp
src/tests/TestSequenceStorage.cpp
)
include(GoogleTest)
add_executable(doot2_tests ${DOOT2_TEST_SOURCES})
target_include_directories(doot2_tests
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
)
set_target_properties(doot2_tests PROPERTIES
CXX_STANDARD 20
CUDA_ARCHITECTURES native
)
target_link_libraries(doot2_tests
PUBLIC GTest::gtest_main
PUBLIC gtest
PUBLIC pthread
PUBLIC nlohmann_json
PUBLIC torch_interface
)
target_compile_definitions(doot2_tests
PUBLIC ASSETS_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/assets\"
)
gtest_add_tests(TARGET doot2_tests
TEST_SUFFIX .noArgs
TEST_LIST noArgsTests
)
gtest_discover_tests(doot2_tests)