forked from roboime/pfc-jan-bramigk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
262 lines (231 loc) · 6.07 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
cmake_minimum_required(VERSION 2.8.8)
project(ai) # TODO: new name maybe?
# Super strict warnings =)
set(CMAKE_CXX_FLAGS "-Wall -Wextra ${CMAKE_CXX_FLAGS}")
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/.cmake/modules)
set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
if("${CMAKE_GENERATOR}" STREQUAL "Ninja" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions("-Xclang -fcolor-diagnostics")
endif()
#set(CMAKE_CXX_FLAGS "-lmat2cpp -llapack -llapacke -lblas -lm ${CMAKE_CXX_FLAGS}") # TODO: make clang add this
include_directories(src)
include_directories(vendor/imgui)
include_directories(vendor/cppzmq)
set(SRC
src/gui.cpp
src/draw.cpp
src/app.cpp
src/action.cpp
src/decision.cpp
src/optimization.cpp
src/vector.cpp
src/consts.cpp
src/state.cpp
src/filter.cpp
src/suggestion_table.cpp
src/suggestions.cpp
vendor/imgui/imgui.cpp
)
set(INC
src/action.h
#src/adaptive_control.h
src/app.h
src/array.h
src/colors.h
src/consts.h
src/decision.h
src/decision_source.h
src/decision_table.h
src/draw.h
src/filter.h
src/gui.h
src/id_table.h
src/minimax.h
src/optimization.h
src/player.h
src/segment.h
src/state.h
src/suggestion_table.h
src/suggestions.h
src/utils.h
src/valued_decision.h
src/vector.h
src/numerical_methods.h
src/lapacke.h
src/lapacke_config.h
src/lapacke_mangling.h
#src/weight.h
)
set(DOC
#doc/anexos.tex
doc/apendices.tex
doc/ssl.tex
doc/arquitetura.tex
doc/conclusao.tex
doc/definicoes.tex
doc/discretizacao.tex
doc/funcao_objetivo.tex
doc/gui.tex
doc/introducao.tex
doc/modelagem.tex
doc/dec_table.tex
doc/posicoes_chave.tex
doc/resultados.tex
doc/resumo.tex
doc/distr_move.tex
doc/estr_busca.tex
doc/_consideracoes.tex
doc/results/kick_pos_var.tex
doc/results/dist_total_mv.tex
doc/results/dist_max_mv.tex
doc/results/atack_cost.tex
doc/results/see_enemy_goal.tex
doc/results/block_goal.tex
doc/results/min_gap_kick.tex
)
set(IMG
img/arq_geral_prog.eps
img/arq_ssl.eps
img/cmra_campo.png
img/communication.eps
img/distr_mov.eps
img/ex_tatica.eps
img/gui.eps
img/gui_ball_move.png
img/gui_ball_stop.png
img/gui_field.png
img/gui_kick.png
img/gui_move.png
img/gui_params.png
img/gui_pass.png
img/gui_widgets.png
img/gui_zoom_in.png
img/gui_zoom_out.png
img/kick_pos_var_1.png
img/kick_pos_var_2.png
img/minimax-tictactoe.jpg
img/minimax-tree.ps
img/minimax_flow.eps
img/padroes_ssl.png
img/pos_chave_barreira.png
img/pos_chave_lateral.png
img/result/atack_atq_5000.png
img/result/atack_def_5000.png
img/result/block_goal_atq_0.png
img/result/block_goal_def_0.png
img/result/default_atq.png
img/result/default_def.png
img/result/kickpos_024_atq.png
img/result/kickpos_024_def.png
img/result/kickpos_0_atq.png
img/result/kickpos_0_def.png
img/result/min_gap_atq_5.png
img/result/min_gap_def_5.png
img/result/mov_dist_max_atq_10.png
img/result/mov_dist_max_def_10.png
img/result/mov_dist_total_atq_10.png
img/result/mov_dist_total_def_10.png
img/result/see_enemy_goal_atq_1000.png
img/result/see_enemy_goal_def_1000.png
img/result/total_max_gap_atq_0.png
img/result/total_max_gap_def_0.png
img/rob_data.png
img/robo.png
img/robocup2013.jpg
img/tab_dec.eps
img/threads.eps
img/xadrez.jpg
img/mod_comp.jpg
img/uml_comm.png
)
set(PROTO
proto/update.proto
proto/discrete.proto
)
#
# DEPS
#
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
protobuf_generate_cpp(PROTO_SRC PROTO_HDR ${PROTO})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
#find_package(Armadillo REQUIRED)
#include_directories(${ARMADILLO_INCLUDE_DIRS})
find_package(ZMQ REQUIRED)
include_directories(${ZMQ_INCLUDE_DIRS})
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
#find_package(Boost 1.54 COMPONENTS program_options REQUIRED)
#INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
#find_package(PkgConfig REQUIRED)
#pkg_search_module(GLFW REQUIRED glfw3)
#include_directories(${GLFW_INCLUDE_DIRS})
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "")
set(GLFW_INSTALL OFF CACHE BOOL "")
add_subdirectory(vendor/glfw)
include_directories(vendor/glfw/include)
find_package(Threads REQUIRED)
#
# BIN
#
add_library(core OBJECT ${PROTO_SRC} ${SRC})
set(COMMON_LIBRARIES
${PROTOBUF_LIBRARIES}
${ZMQ_LIBRARIES}
${OPENGL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
#add_executable(minimax_tests tests/main.cpp $<TARGET_OBJECTS:core>)
#target_link_libraries(minimax_tests ${COMMON_LIBRARIES})
#add_executable(minimax_cli src/main.cpp $<TARGET_OBJECTS:core>)
#target_link_libraries(minimax_cli ${COMMON_LIBRARIES})
#add_executable(ai-gui src/main-gui.cpp $<TARGET_OBJECTS:core>)
#target_link_libraries(ai-gui ${COMMON_LIBRARIES} ${GLFW_STATIC_LIBRARIES})
add_executable(ai src/main.cpp $<TARGET_OBJECTS:core>)
#target_link_libraries(ai ${COMMON_LIBRARIES} ${GLFW_STATIC_LIBRARIES})
#target_link_libraries(ai ${COMMON_LIBRARIES} ${Boost_LIBRARIES} glfw ${GLFW_LIBRARIES})
target_link_libraries(ai ${COMMON_LIBRARIES} glfw ${GLFW_LIBRARIES})
add_custom_target(run
COMMAND ai
DEPENDS ai
WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
)
find_package(LATEX)
if (PDFLATEX_COMPILER)
option(BUILD_REPORT "Build report?" ON)
endif()
if(BUILD_REPORT)
SET(LATEX_COMPILER_FLAGS
--enable-write18 -file-line-error -shell-escape
CACHE STRING "Flags passed to latex."
)
include(${CMAKE_SOURCE_DIR}/.cmake/UseLATEX.cmake)
add_latex_document(relatorio.tex
#INPUTS ${DOC} ${INC} ${PROTO}
INPUTS ${DOC}
CONFIGURE relatorio.tex
BIBFILES referencias.bib
IMAGES ${IMG}
USE_INDEX
NO_DEFAULT
)
add_latex_document(apresentacao.tex
#IMAGE_DIRS img
IMAGES ${IMG}
NO_DEFAULT
MANGLE_TARGET_NAMES
)
find_program(OPEN NAMES gnome-open xdg-open open)
add_custom_target(open
COMMAND ${OPEN} relatorio.pdf
DEPENDS pdf
WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
)
add_custom_target(pres
COMMAND ${OPEN} apresentacao.pdf
DEPENDS apresentacao_pdf
WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
)
endif()
# vim: et sw=2 ts=2 sts=2