forked from personalrobotics/or_ompl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrosbuild.cmake
61 lines (51 loc) · 1.84 KB
/
rosbuild.cmake
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
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
include_directories(
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}
${OMPL_INCLUDE_DIRS}
${TinyXML_INCLUDE_DIRS}
)
find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(${EIGEN_DEFINITIONS})
find_package(PkgConfig)
pkg_check_modules(OMPL QUIET ompl)
pkg_check_modules(TinyXML QUIET tinyxml)
# Generate the OMPL planner wrappers.
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src")
execute_process(COMMAND pkg-config ompl --modversion
OUTPUT_VARIABLE OMPL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/planners.yaml"
DEPENDS "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
COMMAND "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
--version="${OMPL_VERSION}"
< "${PROJECT_SOURCE_DIR}/planners.yaml"
> "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
)
rosbuild_add_library(${PROJECT_NAME} SHARED
src/OMPLMain.cpp
src/OMPLPlanner.cpp
src/OMPLSimplifier.cpp
src/OMPLConversions.cpp
src/TSR.cpp
src/TSRChain.cpp
src/TSRGoal.cpp
"${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
)
target_link_libraries(${PROJECT_NAME}
${OMPL_LIBRARIES}
${TinyXML_LIBRARIES}
)