-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
230 lines (192 loc) · 5.58 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
cmake_minimum_required(VERSION 2.8)
project(ssl-vision)
#defines
if(MSVC)
add_definitions(-DHAVE_WINDOWS)
set(gui_option WIN32)
else()
# we are defining UNIX for mac too, is that ok?
add_definitions(-DUNIX)
if(APPLE)
add_definitions(-DHAVE_MACOSX)
set(gui_option MACOSX_BUNDLE)
else()
add_definitions(-DHAVE_LINUX)
add_definitions(-DUSE_AFFINITY_MANAGER)
add_definitions(-DLINUX)
# why this? can't other compilers be used on linux?
add_definitions(-D_GNU_SOURCE)
set(gui_option)
endif()
endif()
# Normilizing standard directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
endforeach()
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_MINSIZEREL_POSTFIX min)
set(QT_USE_QTNETWORK true)
set(QT_USE_QTOPENGL true)
find_package(Qt4 REQUIRED)
include_directories(${PROJECT_BINARY_DIR})
include(${QT_USE_FILE})
include(src/shared/CMakeLists.txt.in)
include_directories(${PROJECT_SOURCE_DIR}/src/app)
include_directories(${PROJECT_SOURCE_DIR}/src/app/gui)
include_directories(${PROJECT_SOURCE_DIR}/src/app/plugins)
include_directories(${PROJECT_SOURCE_DIR}/src/app/stacks)
set(SRCS
src/app/capture_thread.cpp
src/app/framedata.cpp
src/app/main.cpp
src/app/gui/cameracalibwidget.cpp
src/app/gui/colorpicker.cpp
src/app/gui/glLUTwidget.cpp
src/app/gui/glwidget.cpp
src/app/gui/lutwidget.cpp
src/app/gui/mainwindow.cpp
src/app/gui/realtimedisplaywidget.cpp
src/app/gui/renderoptions.cpp
src/app/gui/videowidget.cpp
src/app/gui/jog_dial.cpp
src/app/plugins/plugin_cameracalib.cpp
src/app/plugins/plugin_colorcalib.cpp
src/app/plugins/plugin_colorthreshold.cpp
src/app/plugins/plugin_detect_balls.cpp
src/app/plugins/plugin_detect_robots.cpp
src/app/plugins/plugin_find_blobs.cpp
src/app/plugins/plugin_publishgeometry.cpp
src/app/plugins/plugin_runlength_encode.cpp
src/app/plugins/plugin_sslnetworkoutput.cpp
src/app/plugins/plugin_visualize.cpp
src/app/plugins/plugin_dvr.cpp
src/app/plugins/visionplugin.cpp
src/app/stacks/multistack_robocup_ssl.cpp
src/app/stacks/multivisionstack.cpp
src/app/stacks/stack_robocup_ssl.cpp
src/app/stacks/visionstack.cpp
)
qt4_wrap_cpp(MOC_SRCS
src/app/capture_thread.h
src/app/gui/cameracalibwidget.h
src/app/gui/glLUTwidget.h
src/app/gui/glwidget.h
src/app/gui/lutwidget.h
src/app/gui/mainwindow.h
src/app/gui/videowidget.h
src/app/gui/jog_dial.h
src/shared/util/lut3d.h
src/app/plugins/plugin_dvr.h
src/app/plugins/plugin_publishgeometry.h
src/app/plugins/visionplugin.h
src/app/stacks/multistack_robocup_ssl.h
)
qt4_wrap_ui(UI_SRCS
src/app/gui/mainwindow.ui
src/app/gui/videowidget.ui
)
qt4_add_resources(RC_SRCS
src/app/gui/icons/icons_gui.qrc
${SHARED_RC}
)
## generate moc files for graphicalClient
qt4_wrap_cpp(LCLIENT_MOC_SRCS
src/logClient/CentralWindow.h
src/logClient/ClientThreading.h
src/logClient/GraphicsPrimitives.h
src/logClient/LogControl.h
)
## generate moc files for graphicalClient2
qt4_wrap_cpp(GRAPHICALCLIENT_MOC_SRCS
src/graphicalClient/soccerview.h
)
## shared qt wrappings
qt4_wrap_cpp(SHARED_MOC_SRCS
${SHARED_HEADERS}
)
qt4_add_resources(SHARED_RC_SRCS
${SHARED_RC}
)
if(MSVC)
# TODO: custom visual studio flags?
message(STATUS "CC Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
else()
set(arch ${CMAKE_SYSTEM_PROCESSOR})
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Arch: ${arch}")
if(${arch} MATCHES "x86_64")
#set compiler flags here for x86_64
set (cc_flags "")
elseif(${arch} MATCHES "x86")
#set compiler flags here for x86
set (cc_flags "")
endif()
#flags to set in debug mode
#set(CMAKE_CXX_FLAGS_DEBUG "-g -Wl,--no-as-needed")
#flags to set in release mode
#set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -march=native -Wl,--no-as-needed")
message(STATUS "CC Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
message(STATUS "Custom CC Flags: ${cc_flags}")
add_definitions(${cc_flags})
endif()
#TODO: add PNG and JPEG libraries
set(libs
${QT_LIBRARIES}
${shared_libs}
sslvision
)
## build the common code
add_library(sslvision
${SHARED_MOC_SRCS}
${SHARED_RC_SRCS}
${CC_PROTO}
${SHARED_SRCS}
)
target_link_libraries(sslvision ${libs})
## build the main app
set(target vision)
add_executable(${target}
${UI_SRCS}
${MOC_SRCS}
${RC_SRCS}
${SRCS}
)
target_link_libraries(${target} ${libs})
##build non graphical client
set(client client)
add_executable(${client}
src/client/main.cpp
)
target_link_libraries(${client} ${libs})
##build logging client
set(lclient logClient)
add_executable(${lclient} ${LCLIENT_MOC_SRCS}
src/logClient/main.cpp
src/logClient/CentralWindow.cpp
src/logClient/ClientThreading.cpp
src/logClient/GraphicsPrimitives.cpp
src/logClient/LogControl.cpp
)
target_link_libraries(${lclient} ${libs})
##build graphical client
set(graphicalclient graphicalClient)
add_executable(${graphicalclient} ${gui_option}
${GRAPHICALCLIENT_MOC_SRCS}
src/graphicalClient/main.cpp
src/graphicalClient/soccerview.cpp
src/graphicalClient/gltext.cpp
)
target_link_libraries(${graphicalclient} ${libs})
##build new client
set (gclient gClient)
add_executable(${gclient} ${gui_option}
src/gClient/main.cpp
src/gClient/sslField.cpp
)
target_link_libraries(${gclient} ${libs})