-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
100 lines (78 loc) · 2.98 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
cmake_minimum_required(VERSION 3.0.2)
project(robin_behavior_tree)
## Compile as C++14, supported in ROS Melodic and newer
add_compile_options(-std=c++14)
## 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
behaviortree_cpp_v3
robin_bridge_generated
)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
catkin_package(
INCLUDE_DIRS include
# LIBRARIES robin_behavior_tree
CATKIN_DEPENDS
roscpp
behaviortree_cpp_v3
robin_bridge_generated
DEPENDS Boost
)
###########
## Build ##
###########
## Specify additional locations of header files
include_directories(
include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/robin_behavior_tree.cpp
# )
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
add_executable(${PROJECT_NAME}_node src/behavior_tree_node.cpp)
## Rename C++ executable without prefix
set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME behavior_tree_node PREFIX "")
## Add cmake target dependencies of the executable
add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${Boost_LIBRARIES})
#############
## Install ##
#############
## Mark cpp header files for installation
install(
DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest_gtest(common_action_test test/common_action.test test/common_action_test.cpp)
target_link_libraries(common_action_test ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_rostest_gtest(semaphore_test test/semaphore.test test/semaphore_test.cpp)
target_link_libraries(semaphore_test ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_rostest_gtest(process_code_test test/process_code.test test/process_code_test.cpp)
target_link_libraries(process_code_test ${catkin_LIBRARIES} ${Boost_LIBRARIES})
endif()