-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
85 lines (70 loc) · 2.9 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
cmake_minimum_required(VERSION 3.11)
project(motion_primitives)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# import nlohmann json library, must be first pulled with vcs tool
set(JSON_BuildTests OFF CACHE INTERNAL "")
set(JSON_MultipleHeaders ON CACHE INTERNAL "")
add_subdirectory(external/json)
set(BUILD_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_TESTS OFF CACHE INTERNAL "")
add_subdirectory(external/ruckig)
# Find catkin macros and libraries if COMPONENTS list like find_package(catkin
# REQUIRED COMPONENTS xyz) is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp kr_planning_msgs rosbag actionlib mav_trajectory_generation pybind11_catkin cmake_modules)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS timer)
find_package(TBB REQUIRED)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
DEPENDS TBB
CATKIN_DEPENDS roscpp kr_planning_msgs rosbag actionlib mav_trajectory_generation
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
# ##############################################################################
# Build ##
# ##############################################################################
# Specify libraries to link a library or executable target against
add_library(${PROJECT_NAME} src/motion_primitive_graph.cpp src/graph_search.cpp src/utils.cpp)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(
${PROJECT_NAME}
${catkin_LIBRARIES}
nlohmann_json::nlohmann_json
${Boost_LIBRARIES}
${TBB_LIBRARIES}
ruckig
)
add_executable(${PROJECT_NAME}_graph_search src/graph_search_node.cpp)
target_link_libraries(${PROJECT_NAME}_graph_search PRIVATE ${PROJECT_NAME})
add_executable(${PROJECT_NAME}_action_server src/graph_search_action_server.cpp)
target_link_libraries(${PROJECT_NAME}_action_server PRIVATE ${PROJECT_NAME})
# Mark executables for installation See
# http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
install(TARGETS ${PROJECT_NAME}_graph_search
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
# Mark libraries for installation See
# http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
# Mark cpp header files for installation
install(
DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING
PATTERN "*.h"
PATTERN ".svn" EXCLUDE)
add_subdirectory(tests)
pybind_add_module(motion_primitives_cpp MODULE src/python.cpp)
target_link_libraries(motion_primitives_cpp PUBLIC ${PROJECT_NAME})
install(TARGETS motion_primitives_cpp
LIBRARY DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)