forked from calderpg/uncertainty_planning_core
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt.ros1
130 lines (112 loc) · 4.61 KB
/
CMakeLists.txt.ros1
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
cmake_minimum_required(VERSION 2.8.3)
project(uncertainty_planning_core)
## 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 visualization_msgs common_robotics_utilities)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
find_package(cmake_modules REQUIRED)
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)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## LIBRARIES: libraries you create in this project
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project
catkin_package(INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
roscpp
visualization_msgs
common_robotics_utilities
DEPENDS
Eigen3
CFG_EXTRAS ${PROJECT_NAME}-extras.cmake)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(include SYSTEM ${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS})
## Build options
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
cmake_policy(SET CMP0069 NEW)
add_compile_options(-std=c++11)
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=1)
## 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})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
####################################################
# Example of task-level planning using the adapter #
####################################################
add_executable(task_planner_adapter_example
src/task_planner_adapter_example.cpp)
add_dependencies(task_planner_adapter_example ${catkin_EXPORTED_TARGETS})
target_link_libraries(task_planner_adapter_example ${PROJECT_NAME}
${catkin_LIBRARIES})
#############
## Install ##
#############
## Mark library for installation
install(TARGETS ${PROJECT_NAME} task_planner_adapter_example
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
)