forked from calderpg/uncertainty_planning_core
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt.ros2
119 lines (98 loc) · 3.93 KB
/
CMakeLists.txt.ros2
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
cmake_minimum_required(VERSION 3.5)
project(uncertainty_planning_core)
find_package(ament_cmake_ros REQUIRED)
find_package(common_robotics_utilities REQUIRED)
find_package(rclcpp REQUIRED)
find_package(visualization_msgs REQUIRED)
## System dependencies are found with CMake's conventions
find_package(Eigen3 REQUIRED)
set(Eigen3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
find_package(OpenMP)
## We don't depend on Drake, but we do use different build flags if present.
find_package(drake QUIET)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(include SYSTEM ${Eigen3_INCLUDE_DIRS})
## Build options
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
cmake_policy(SET CMP0069 NEW)
add_compile_options(-std=c++17)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Werror)
add_compile_options(-Wconversion)
add_compile_options(-Wshadow)
add_compile_options(-O3)
add_compile_options(-g)
add_compile_options(-Werror=non-virtual-dtor)
add_compile_options(-Wold-style-cast)
add_compile_options(-Wpessimizing-move)
add_compile_options(-Wuninitialized)
if(drake_FOUND)
message(STATUS "Drake found, disabling -march=native")
else()
message(STATUS "Drake NOT found, enabling -march=native")
add_compile_options(-march=native)
endif()
add_definitions(-DUNCERTAINTY_PLANNING_CORE__SUPPORTED_ROS_VERSION=2)
## It's not clear if add_compile_options does the right things for flags that
## may differ between languages and target type.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
set(UNCERTAINTY_PLANNING_CORE_SOURCES
include/${PROJECT_NAME}/simple_sampler_interface.hpp
include/${PROJECT_NAME}/simple_simulator_interface.hpp
include/${PROJECT_NAME}/simple_outcome_clustering_interface.hpp
include/${PROJECT_NAME}/uncertainty_planner_state.hpp
include/${PROJECT_NAME}/uncertainty_contact_planning.hpp
include/${PROJECT_NAME}/execution_policy.hpp
include/${PROJECT_NAME}/uncertainty_planning_core.hpp
include/${PROJECT_NAME}/task_planner_adapter.hpp
include/${PROJECT_NAME}/ros_integration.hpp
src/${PROJECT_NAME}/uncertainty_planning_core.cpp)
################
# CORE LIBRARY #
################
add_library(${PROJECT_NAME} ${UNCERTAINTY_PLANNING_CORE_SOURCES})
ament_target_dependencies(${PROJECT_NAME} common_robotics_utilities)
ament_target_dependencies(${PROJECT_NAME} SYSTEM rclcpp visualization_msgs)
####################################################
# Example of task-level planning using the adapter #
####################################################
add_executable(task_planner_adapter_example
src/task_planner_adapter_example.cpp)
ament_target_dependencies(task_planner_adapter_example
common_robotics_utilities)
ament_target_dependencies(task_planner_adapter_example
SYSTEM rclcpp visualization_msgs)
target_link_libraries(task_planner_adapter_example ${PROJECT_NAME})
#############
## Install ##
#############
## Mark library for installation
install(TARGETS ${PROJECT_NAME} task_planner_adapter_example
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
## Mark cpp header files for installation
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
)
ament_export_definitions(-DUNCERTAINTY_PLANNING_CORE__SUPPORTED_ROS_VERSION=2)
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_dependencies(common_robotics_utilities)
ament_export_dependencies(rclcpp)
ament_export_dependencies(visualization_msgs)
ament_package()