forked from philip-long/robot_collision_checking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
116 lines (91 loc) · 2.74 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
cmake_minimum_required(VERSION 3.1)
project(robot_collision_checking)
set(CMAKE_CXX_STANDARD 14)
set(MSG_DEPS
std_msgs
shape_msgs
geometry_msgs
)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
roslib
eigen_conversions
geometric_shapes
octomap_msgs
)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
find_package(CCD REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(octomap REQUIRED)
if(EXISTS "${CMAKE_SOURCE_DIR}/cmake/FindFCL.cmake")
find_package(FCL REQUIRED)
else()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/${PROJECT_NAME}/cmake/")
find_package(FCL REQUIRED)
endif()
find_library(EIGEN_CDDLIB_LIB eigen-cddlib)
###########
## Build ##
###########
catkin_package(
INCLUDE_DIRS include
LIBRARIES fcl_interface
CATKIN_DEPENDS roscpp rospy roslib ${MSG_DEPS} geometric_shapes
DEPENDS
EIGEN3
CCD
FCL
)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler. Suggested solution: update the pkg build-essential ")
endif()
include_directories(
include
/usr/include/eigen3/
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${PCL_LIBRARY_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${FCL_INCLUDE_DIRS}
${CCD_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS}
)
add_definitions(${PCL_DEFINITIONS})
add_library(fcl_interface
src/fcl_interface.cpp
src/static_fcl_interface.cpp
include/${PROJECT_NAME}/fcl_interface.h
)
add_executable(testing ./tests/test_file.cpp)
add_executable(test_fcl_inter ./tests/test_fcl.cpp)
add_executable(test_fcl_octo ./tests/test_octo.cpp)
target_link_libraries(test_fcl_inter ${catkin_LIBRARIES} fcl_interface)
target_link_libraries(test_fcl_octo ${catkin_LIBRARIES} fcl_interface)
target_link_libraries(testing ${catkin_LIBRARIES}
${FCL_LIBRARIES}
${CCD_LIBRARIES})
target_link_libraries(test_fcl_inter
${catkin_LIBRARIES}
${FCL_LIBRARIES}
${CCD_LIBRARIES}
${OCTOMAP_LIBRARIES})
target_link_libraries(test_fcl_octo
${catkin_LIBRARIES}
${FCL_LIBRARIES}
${CCD_LIBRARIES}
${OCTOMAP_LIBRARIES})
add_dependencies(fcl_interface
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
#${FCL_LIBRARIES}
${CCD_LIBRARIES})