-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
125 lines (96 loc) · 3.33 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
cmake_minimum_required(VERSION 2.8.3)
project(piper)
# version indicator
set(PIPER_VERSION_MAJOR 0)
set(PIPER_VERSION_MINOR 1)
set(PIPER_VERSION_PATCH 0)
set(PIPER_VERSION_STRING "${PIPER_VERSION_MAJOR}.${PIPER_VERSION_MINOR}.${PIPER_VERSION_PATCH}")
# Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
control_msgs
actionlib
roslib
sensor_msgs
geometry_msgs
trajectory_msgs
)
# C++11 flags for GTSAM 4.0
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
# find GTSAM
find_package(GTSAM REQUIRED)
include_directories(${GTSAM_INCLUDE_DIR})
set(GTSAM_LIBRARIES gtsam)
# find GPMP2
find_package(gpmp2 REQUIRED)
include_directories(${gpmp2_INCLUDE_DIR})
set(gpmp2_LIBRARIES gpmp2)
catkin_package()
# Specify additional locations of header files
include_directories(${catkin_INCLUDE_DIRS})
################################################
## base ##
################################################
include_directories(piper/base/)
file(GLOB BASE_SRC "piper/base/*.cpp")
add_library(piperbase ${BASE_SRC})
target_link_libraries(piperbase
${catkin_LIBRARIES}
${GTSAM_LIBRARIES}
${gpmp2_LIBRARIES}
)
install(DIRECTORY piper/base/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
)
# options for which interfaces need to be built and installed
option(BUILD_ALL_INTERFACE "whether to build all interfaces" OFF)
option(BUILD_GPMP2_INTERFACE "whether to build interface for batch GPMP2" OFF)
option(BUILD_STEAP_INTERFACE "whether to build interface for STEAP" OFF)
################################################
## all ##
################################################
if(BUILD_ALL_INTERFACE)
set(BUILD_GPMP2_INTERFACE ON)
set(BUILD_STEAP_INTERFACE ON)
endif()
################################################
## gpmp2_interface ##
################################################
if(BUILD_GPMP2_INTERFACE)
include_directories(piper/gpmp2_interface/)
file(GLOB GPMP2_INTERFACE_SRC "piper/gpmp2_interface/*.cpp")
add_executable(gpmp2_interface ${GPMP2_INTERFACE_SRC})
target_link_libraries(gpmp2_interface piperbase)
install(TARGETS gpmp2_interface
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY piper/gpmp2_interface/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
)
endif()
################################################
## steap_interface ##
################################################
if(BUILD_STEAP_INTERFACE)
include_directories(piper/steap_interface/)
file(GLOB STEAP_INTERFACE_SRC "piper/steap_interface/*.cpp")
add_executable(steap_interface ${STEAP_INTERFACE_SRC})
target_link_libraries(steap_interface piperbase)
install(TARGETS steap_interface
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY piper/steap_interface/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
)
endif()
################################################
## launch ##
################################################
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)