forked from RobotnikAutomation/vectornav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (82 loc) · 2.41 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
cmake_minimum_required(VERSION 3.5)
# Compile options so compiles with ROS Kinetic
# Future releases may want to
add_compile_options(-std=c++17)
project(vectornav)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(std_srvs REQUIRED)
# Declare ROS2 messages and services
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Ins.msg"
DEPENDENCIES std_msgs geometry_msgs
ADD_LINTER_TESTS
)
ament_export_dependencies(rosidl_default_runtime)
rosidl_get_typesupport_target(cpp_typesupport_target
${PROJECT_NAME} "rosidl_typesupport_cpp")
#include(vnproglib-1.1/cpp/CMakeLists.txt)
add_subdirectory(vnproglib-1.2.0.0/cpp)
## Declare a cpp library
## Declare a cpp executable
add_executable(vnpub src/main.cpp)
ament_target_dependencies(vnpub
rclcpp
geometry_msgs
tf2
tf2_geometry_msgs
nav_msgs
sensor_msgs
std_srvs)
target_link_libraries(vnpub
libvncxx
${cpp_typesupport_target})
add_executable(vectornav_node src/vectornav_node.cpp src/vectornav.cpp)
target_include_directories(vectornav_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(vectornav_node
rclcpp
geometry_msgs
tf2
tf2_geometry_msgs
nav_msgs
sensor_msgs
std_srvs)
target_link_libraries(vectornav_node
libvncxx
${cpp_typesupport_target})
add_executable(vectornav_lifecycle_node src/vectornav_lifecycle_node.cpp src/vectornav_lifecycle.cpp)
target_include_directories(vectornav_lifecycle_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(vectornav_lifecycle_node
rclcpp
geometry_msgs
tf2
tf2_geometry_msgs
nav_msgs
sensor_msgs
std_srvs
rclcpp_lifecycle)
target_link_libraries(vectornav_lifecycle_node
libvncxx
${cpp_typesupport_target})
## Mark executables and/or libraries for installation
install(TARGETS
vnpub vectornav_node vectornav_lifecycle_node
DESTINATION lib/${PROJECT_NAME})
install(DIRECTORY
config launch
DESTINATION share/${PROJECT_NAME}/
)
ament_package()