forked from ros/robot_state_publisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (117 loc) · 4.29 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
cmake_minimum_required(VERSION 3.5)
project(robot_state_publisher)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra)
endif()
find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(kdl_parser REQUIRED)
find_package(orocos_kdl REQUIRED)
find_package(rcl_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(urdf REQUIRED)
set(THIS_PACKAGE_INCLUDE_DEPENDS
builtin_interfaces
geometry_msgs
kdl_parser
orocos_kdl
rcl_interfaces
rclcpp
rclcpp_components
sensor_msgs
std_msgs
tf2_ros
urdf)
add_library(
${PROJECT_NAME}_node SHARED
src/robot_state_publisher.cpp)
target_include_directories(${PROJECT_NAME}_node PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
ament_target_dependencies(${PROJECT_NAME}_node ${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_export_targets(export_${PROJECT_NAME}_node)
rclcpp_components_register_node(${PROJECT_NAME}_node
PLUGIN "robot_state_publisher::RobotStatePublisher"
EXECUTABLE robot_state_publisher)
install(
TARGETS
${PROJECT_NAME}_node
EXPORT export_${PROJECT_NAME}_node
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(DIRECTORY include/
DESTINATION include/${PROJECT_NAME})
install(DIRECTORY launch urdf
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
find_package(launch_testing_ament_cmake REQUIRED)
ament_find_gtest()
add_executable(test_two_links_fixed_joint test/test_two_links_fixed_joint.cpp)
ament_target_dependencies(test_two_links_fixed_joint
rclcpp
tf2_ros
)
target_include_directories(test_two_links_fixed_joint PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_two_links_fixed_joint ${GTEST_LIBRARIES})
add_launch_test(test/two_links_fixed_joint-launch.py
ARGS "test_exe:=$<TARGET_FILE:test_two_links_fixed_joint>")
add_executable(test_two_links_fixed_joint_prefix test/test_two_links_fixed_joint_prefix.cpp)
ament_target_dependencies(test_two_links_fixed_joint_prefix
rclcpp
tf2_ros
)
target_include_directories(test_two_links_fixed_joint PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_two_links_fixed_joint_prefix ${GTEST_LIBRARIES})
add_launch_test(test/two_links_fixed_joint_prefix-launch.py
ARGS "test_exe:=$<TARGET_FILE:test_two_links_fixed_joint_prefix>")
add_executable(test_two_links_moving_joint test/test_two_links_moving_joint.cpp)
ament_target_dependencies(test_two_links_moving_joint
rclcpp
sensor_msgs
tf2_ros
)
target_include_directories(test_two_links_fixed_joint PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_two_links_moving_joint ${GTEST_LIBRARIES})
add_launch_test(test/two_links_moving_joint-launch.py
ARGS "test_exe:=$<TARGET_FILE:test_two_links_moving_joint>")
add_executable(test_two_links_change_fixed_joint test/test_two_links_change_fixed_joint.cpp)
ament_target_dependencies(test_two_links_change_fixed_joint
rclcpp
tf2_ros
)
ament_target_dependencies(test_two_links_change_fixed_joint
rcl_interfaces
rclcpp
tf2_ros
)
target_include_directories(test_two_links_change_fixed_joint PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_two_links_change_fixed_joint ${GTEST_LIBRARIES})
add_launch_test(test/two_links_change_fixed_joint-launch.py
ARGS "test_exe:=$<TARGET_FILE:test_two_links_change_fixed_joint>")
add_executable(test_change_mimic_joint test/test_change_mimic_joint.cpp)
ament_target_dependencies(test_change_mimic_joint
rclcpp
rcl_interfaces
)
target_include_directories(test_change_mimic_joint PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(test_change_mimic_joint ${GTEST_LIBRARIES})
add_launch_test(test/change_mimic_joint-launch.py
ARGS "test_exe:=$<TARGET_FILE:test_change_mimic_joint>")
endif()
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()