-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
167 lines (147 loc) · 3.96 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
cmake_minimum_required(VERSION 2.8.3)
project(slam_karto_gtsam_landmark)
add_compile_options(-std=c++14)
find_package(catkin REQUIRED COMPONENTS
cmake_modules
message_filters
nav_msgs
open_karto
rosconsole
roscpp
sensor_msgs
geometry_msgs
tf
visualization_msgs
cpp_common
gencpp
geneus
genlisp
genmsg
gennodejs
genpy
message_generation
message_runtime
ros_environment
rosbuild
roscpp_serialization
roscpp_traits
rosgraph
rosgraph_msgs
roslib
rospack
rospy
rostime
std_msgs
xmlrpcpp
actionlib
actionlib_msgs
map_msgs
move_base_msgs
# cmake_modules
# message_filters
# nav_msgs
# open_karto
# rosconsole
# roscpp
# sensor_msgs
# geometry_msgs
# tf
# visualization_msgs
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules/")
# set(MKL_INCLUDE_DIR "/opt/intel/oneapi/mkl/2023.1.0/include")
# set(MKL_LIBRARIES "/opt/intel/oneapi/mkl/2023.1.0/lib/intel64/mkl_rt.lib") #/opt/intel/oneapi/mkl/2023.1.0/lib/cmake/mkl
# set(MKL_LIBRARIES "/opt/intel/oneapi/mkl/2023.1.0/lib/intel64/libmkl_rt.so")
# set(MKL_LIBRARIES "/opt/intel/oneapi/mkl/2023.1.0/lib/cmake/mkl")
add_message_files(
FILES
OptimizationOutput.msg
)
generate_messages(
DEPENDENCIES
rosgraph_msgs # std_msgs
std_msgs
visualization_msgs
)
find_package(MKL REQUIRED)
if(MKL_FOUND)
message(WARNING "MKL FOUND!!!")
include_directories(${MKL_INCLUDE_DIR})
else()
message(WARNING "MKL libs not found")
endif()
find_package(PkgConfig REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(GTSAM REQUIRED)
if(GTSAM_FOUND)
message(STATUS "Found GTSAM ${GTSAM_VERSION}")
else()
message(STATUS "GTSAM Not Found")
endif()
find_package(Boost REQUIRED COMPONENTS timer thread serialization chrono)
# SSG: MAKE SURE TO SET THESE PATHS ACCORDING TO YOUR FILE SYSTEM. THIS IS SPECIFIC TO
# SSG kartoslam_sandbox WORSKPACE USED WHILE DEVELOPING THE PROGRAM
# set(falkolib_DIR "/home/sgari/iral_research/kartoslam_ws/src/openslam_falkolib/cmake_modules")
# set(falkolib_INCLUDE_DIR "/home/sgari/iral_research/kartoslam_ws/src/openslam_falkolib/include")
find_package(falkolib REQUIRED)
if(${falkolib_FOUND})
include_directories(${falkolib_INCLUDE_DIRS})
link_directories(${falkolib_LIBRARY_DIRS})
endif()
include_directories(
include/${PROJECT_NAME}
${catkin_INCLUDE_DIRS}
${EIGEN_INCLUDE_DIRS}
${MKL_INCLUDE_DIR}
${GTSAM_INCLUDE_DIRS}
${falkolib_INCLUDE_DIRS}
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp message_filters nav_msgs open_karto rosconsole roscpp sensor_msgs geometry_msgs tf visualization_msgs
# CATKIN_DEPENDS roscpp
# message_filters
# nav_msgs open_karto
# rosconsole
# sensor_msgs
# geometry_msgs
# tf
# visualization_msgs
# cpp_common
# gencpp
# geneus
# genlisp
# genmsg
# gennodejs
# genpy
# message_generation
# message_runtime
# ros_environment
# rosbuild
# roscpp_serialization
# roscpp_traits
# rosgraph
# rosgraph_msgs
# roslib
# rospack
# rospy
# rostime
# std_msgs
# xmlrpcpp
# actionlib
# actionlib_msgs
# costmap_2d
# map_msgs
# move_base_msgs
DEPENDS Eigen3
)
add_executable(slam_karto_gtsam_landmark src/slam_karto_gtsam_landmark.cpp src/GTSAMSolver.cpp)
get_target_property(gtsam_link_lib gtsam INTERFACE_LINK_LIBRARIES)
message("${gtsam_link_lib}")
target_link_libraries(slam_karto_gtsam_landmark gtsam ${catkin_LIBRARIES} ${MKL_LIBRARIES} ${falkolib_LIBRARIES})
# target_link_libraries(slam_karto_gtsam_landmark "-Wl,--start-group" gtsam ${catkin_LIBRARIES} ${MKL_LIBRARIES} ${falkolib_LIBRARIES} "-Wl,--end-group -lpthread -lm -ldl")
add_executable(laserscan_feature_detector src/laserscan_feature_detection.cpp)
target_link_libraries(laserscan_feature_detector ${catkin_LIBRARIES} ${falkolib_LIBRARIES})
#install(TARGETS slam_karto_gtsam_landmark
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
#)