cmake_minimum_required(VERSION 3.8)
project(robotiq_2f_controllers)

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

# find dependencies
find_package(rclcpp REQUIRED)
find_package(controller_interface REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(pluginlib REQUIRED)
find_package(robotiq_2f_msgs REQUIRED)
find_package(realtime_tools REQUIRED)

include_directories(include)

add_library(robotiq_2f_controllers SHARED
  src/robotiq_forward_controller.cpp
)
ament_target_dependencies(${PROJECT_NAME}
  rclcpp
  controller_interface
  hardware_interface
  pluginlib
  robotiq_2f_msgs
  realtime_tools
)
pluginlib_export_plugin_description_file(controller_interface controller_plugin.xml)


# Install targets
install(TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin
)

# Install header files
install(DIRECTORY include/
  DESTINATION include
)

# Install plugin description file
install(FILES
  controller_plugin.xml
  DESTINATION share/${PROJECT_NAME}
)
ament_package()
