-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
113 lines (94 loc) · 3.69 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
cmake_minimum_required(VERSION 2.8.3)
project(handle_detector)
## find catkin and required packages
find_package(catkin REQUIRED COMPONENTS
eigen_conversions
geometry_msgs
message_generation
roscpp
pcl_ros
pcl_conversions
std_msgs
tf
tf_conversions
visualization_msgs)
## find Lapack
find_package(LAPACK REQUIRED)
## find Eigen package
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})
## compiler optimization flags
set(CMAKE_CXX_FLAGS "-DNDEBUG -O3 -fopenmp -Wno-deprecated")
## add messages
add_message_files(
FILES
CylinderMsg.msg
CylinderArrayMsg.msg
HandleListMsg.msg
)
generate_messages(DEPENDENCIES geometry_msgs)
## Declare a catkin package
catkin_package(
INCLUDE_DIRS
include
CATKIN_DEPENDS
eigen_conversions
geometry_msgs
message_runtime
roscpp
pcl_ros
pcl_conversions
std_msgs
tf
tf_conversions
visualization_msgs
DEPENDS
Eigen
LAPACK)
include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} include)
## create executables
add_executable(${PROJECT_NAME}_localization src/localization.cpp)
add_executable(${PROJECT_NAME}_importance_sampling src/importance_sampling.cpp)
## create libraries
add_library(${PROJECT_NAME}_affordances src/affordances.cpp)
add_library(${PROJECT_NAME}_cylindrical_shell src/cylindrical_shell.cpp)
add_library(${PROJECT_NAME}_messages src/messages.cpp)
add_library(${PROJECT_NAME}_sampling src/sampling.cpp)
add_library(${PROJECT_NAME}_sampling_visualizer src/sampling_visualizer.cpp)
add_library(${PROJECT_NAME}_visualizer src/visualizer.cpp)
## add dependencies
add_dependencies(${PROJECT_NAME}_messages ${PROJECT_NAME}_gencpp)
## link libraries to localization executable
target_link_libraries(${PROJECT_NAME}_localization ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_localization ${PROJECT_NAME}_affordances)
target_link_libraries(${PROJECT_NAME}_localization ${PROJECT_NAME}_visualizer)
target_link_libraries(${PROJECT_NAME}_localization ${PROJECT_NAME}_messages)
## link libraries to importance_sampling executable
target_link_libraries(${PROJECT_NAME}_importance_sampling ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_importance_sampling ${PROJECT_NAME}_affordances)
target_link_libraries(${PROJECT_NAME}_importance_sampling ${PROJECT_NAME}_visualizer)
target_link_libraries(${PROJECT_NAME}_importance_sampling ${PROJECT_NAME}_messages)
target_link_libraries(${PROJECT_NAME}_importance_sampling ${PROJECT_NAME}_sampling)
## link libraries to affordances library
target_link_libraries(${PROJECT_NAME}_affordances ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_affordances ${PROJECT_NAME}_cylindrical_shell)
target_link_libraries(${PROJECT_NAME}_affordances lapack)
## link libraries to messages library
target_link_libraries(${PROJECT_NAME}_messages ${catkin_LIBRARIES})
## link libraries to sampling library
target_link_libraries(${PROJECT_NAME}_sampling ${PROJECT_NAME}_affordances)
target_link_libraries(${PROJECT_NAME}_sampling ${PROJECT_NAME}_sampling_visualizer)
## install targets
install(TARGETS ${PROJECT_NAME}_localization ${PROJECT_NAME}_importance_sampling
${PROJECT_NAME}_affordances ${PROJECT_NAME}_sampling ${PROJECT_NAME}_sampling_visualizer
${PROJECT_NAME}_visualizer ${PROJECT_NAME}_messages ${PROJECT_NAME}_cylindrical_shell
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## install launch files
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)
## install header files
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})