-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
176 lines (145 loc) · 6.17 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_policy(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS_SYNTAX "-x c++ -fsyntax-only")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Werror -O0 -ggdb")
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -lprofiler")
###################################################################################
# Find dependencies via installed packages
find_package(GTSAM REQUIRED NO_MODULE)
include_directories(${GTSAM_INCLUDE_DIR})
find_package( OpenCV 2.4 REQUIRED core imgproc highgui)
include_directories(${OpenCV_INCLUDE_DIR})
SET(OpenCV_USED_LIBS opencv_core opencv_imgproc opencv_highgui)
find_package( Boost 1.48 COMPONENTS date_time serialization-mt filesystem
system program_options REQUIRED)
include_directories( ${Boost_INCLUDE_DIR} )
###################################################################################
# Brian's code
# run in toplevel dir, for example "bin/SICKSlowMetropolis 18 18 0.18"
# after that, DisplayMarginals should display ?? But source is missing
include_directories(include/)
add_library(occupancy_grid_graph SHARED
src/OccupancyGrid.cpp
src/LaserFactor.cpp
src/utility.cpp
)
target_link_libraries (occupancy_grid_graph gtsam-shared ${OpenCV_USED_LIBS})
add_library(occupancy_grid_io SHARED
src/cvmat_serialization.cpp
src/loadData.cpp
src/loadOccupancyGrid.cpp)
target_link_libraries(occupancy_grid_io occupancy_grid_graph gtsam-shared ${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(SICKSlowMetropolis
src/MCMC/Metropolis.cpp
src/TwoAssumptionAlgorithm.cpp
tests/testSICKSlowMetropolis.cpp
)
target_link_libraries (SICKSlowMetropolis occupancy_grid_graph occupancy_grid_io
${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(SICK_DDMCMC
src/MCMC/DDMCMC.cpp
src/TwoAssumptionAlgorithm.cpp
tests/testSICKDDMCMC.cpp
)
target_link_libraries (SICK_DDMCMC occupancy_grid_graph gtsam-shared
occupancy_grid_io ${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
###################################################################################
# Vikas' code with merali13icra implementation
# run anywhere, for example in Data/player_sim dir:
# ../../bin/inference_gibbs_sampling laser_pose_all.bin laser_range_all.bin scan_angles_all.bin
# ../../bin/two_assumption_alg laser_pose_all.bin laser_range_all.bin scan_angles_all.bin
find_package(Threads REQUIRED)
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIR})
add_library(merali13icra SHARED
src/occgrid.cpp
src/forward_sensor_model.cpp)
target_link_libraries(merali13icra ${OpenCV_USED_LIBS} ${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(convert_albert_log
src/convert_albert_log.cpp)
target_link_libraries(convert_albert_log
occupancy_grid_graph occupancy_grid_io ${OpenCV_USED_LIBS})
add_executable(convert_stanford_log
src/convert_stanford_log.cpp)
target_link_libraries(convert_stanford_log
occupancy_grid_graph occupancy_grid_io ${OpenCV_USED_LIBS})
add_executable(TwoAssumptionAlgorithm
src/TwoAssumptionAlgorithm.cpp
src/run_TwoAssumptionAlgorithm.cpp)
target_link_libraries(TwoAssumptionAlgorithm occupancy_grid_graph
occupancy_grid_io
${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(simulateddata
src/simulateddata.cpp)
target_link_libraries(simulateddata merali13icra occupancy_grid_io
${OpenCV_USED_LIBS} ${Boost_LIBRARIES})
add_executable(test_raytrace
tests/test_raytrace.cpp)
target_link_libraries(test_raytrace
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(dualdecomposition
src/dualdecomposition.cpp)
target_link_libraries(dualdecomposition occupancy_grid_graph
occupancy_grid_io ${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(test_slaveminimizer
tests/test_slaveminimizer.cpp)
target_link_libraries(test_slaveminimizer occupancy_grid_graph ${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(run_belief_propagation
src/TwoAssumptionAlgorithm.cpp
src/run_belief_propagation.cpp)
target_link_libraries(run_belief_propagation occupancy_grid_graph
occupancy_grid_io ${Boost_LIBRARIES} ${OpenCV_USED_LIBS})
add_executable(test_utility
src/utility.cpp
tests/test_utility.cpp)
target_link_libraries(test_utility
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(test_sumproduct
src/utility.cpp
tests/test_sumproduct.cpp)
target_link_libraries(test_sumproduct
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(test_cartesian_product
src/utility.cpp
tests/test_cartesian_product.cpp)
target_link_libraries(test_cartesian_product
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(test_occgrid
src/forward_sensor_model.cpp
tests/test_occgrid.cpp)
target_link_libraries(test_occgrid merali13icra
${CMAKE_THREAD_LIBS_INIT} ${GTEST_BOTH_LIBRARIES})
add_executable(inference_gibbs_sampling
src/inference_gibbs_sampling.cpp)
target_link_libraries(inference_gibbs_sampling occupancy_grid_io merali13icra ${OpenCV_USED_LIBS})
add_executable(visualize_ground_truth
src/visualize_ground_truth.cpp)
target_link_libraries(visualize_ground_truth occupancy_grid_io merali13icra ${OpenCV_USED_LIBS})
add_executable(two_assumption_alg
src/two_assumption_alg.cpp)
target_link_libraries(two_assumption_alg merali13icra occupancy_grid_io ${OpenCV_USED_LIBS} ${Boost_LIBRARIES})
add_executable(displayMarginals
src/displayMarginals.cpp)
target_link_libraries(displayMarginals ${OpenCV_USED_LIBS})
# find pkgconfig modules
include(FindPkgConfig)
pkg_search_module( PLAYER playerc++>=2.1.0 )
IF( PLAYER_FOUND )
MESSAGE( STATUS ${INDENT} "Player version ${PLAYER_VERSION} detected at ${PLAYER_LIBRARIES}" )
link_directories( ${PLAYER_LIBRARY_DIRS} )
include_directories( ${PLAYER_INCLUDE_DIRS} )
add_executable(captureplayerdata
src/captureplayerdata.cpp
src/cvmat_serialization.cpp)
target_link_libraries(captureplayerdata ${OpenCV_USED_LIBS} ${PLAYER_LIBRARIES}
${Boost_LIBRARIES})
ELSE( PLAYER_FOUND )
MESSAGE( ${INDENT} "Player not detected. If Player is installed but not detected, check your PKG_CONFIG_PATH." )
ENDIF( PLAYER_FOUND )