-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
55 lines (45 loc) · 1.56 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
cmake_minimum_required(VERSION 3.5)
project(rviz_polygon_selection_tool)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
# 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 -Wpedantic)
endif()
set(CMAKE_AUTOMOC ON)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rviz_common REQUIRED)
find_package(pluginlib REQUIRED)
# Include the 'rosidl_get_typesupport_target' target on distros earlier than Galactic
if(DEFINED ENV{ROS_DISTRO})
if("$ENV{ROS_DISTRO}" STREQUAL "foxy")
include(cmake/macros.cmake)
endif()
endif()
rosidl_generate_interfaces(
${PROJECT_NAME}
"srv/GetSelection.srv"
DEPENDENCIES
geometry_msgs)
add_library(${PROJECT_NAME}_plugin SHARED src/rviz_polygon_selection_tool.cpp src/rviz_polygon_selection_tool.h)
ament_target_dependencies(${PROJECT_NAME}_plugin rviz_common pluginlib)
rosidl_get_typesupport_target(msgs_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME}_plugin ${msgs_target})
# Install the library
install(TARGETS ${PROJECT_NAME}_plugin EXPORT ${PROJECT_NAME}-targets DESTINATION lib)
ament_export_targets(${PROJECT_NAME}-targets HAS_LIBRARY_TARGET)
ament_export_dependencies(
geometry_msgs
rosidl_default_runtime
rviz_common
pluginlib)
pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)
ament_package()