cmake_minimum_required(VERSION 3.8)
project(dual_arm_action_server)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)

include_directories(
  include
  ${CMAKE_CURRENT_SOURCE_DIR}/../../include
)

add_executable(dual_arm_action_server_node
  src/dual_arm_action_server_node.cpp
  src/real_robot_driver.cpp
)

ament_target_dependencies(dual_arm_action_server_node
  rclcpp
  rclcpp_action
  interfaces
  geometry_msgs
  sensor_msgs
  tf2
)

find_library(RMAN_API_LIB NAMES api_cpp PATHS "${CMAKE_CURRENT_SOURCE_DIR}/../../lib")
target_link_libraries(dual_arm_action_server_node ${RMAN_API_LIB})

install(TARGETS
  dual_arm_action_server_node
  DESTINATION lib/${PROJECT_NAME})

install(DIRECTORY include/
  DESTINATION include/${PROJECT_NAME}
)

install(
  DIRECTORY launch config
  DESTINATION share/${PROJECT_NAME}
  OPTIONAL
)

ament_package()

