cmake_minimum_required(VERSION 3.5)
project(ps2_controller)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 17)
endif()

# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rc_msgs REQUIRED)  # 添加对 rc_msgs 的依赖

add_executable(ps2_reader src/ps2_reader.cpp)

ament_target_dependencies(ps2_reader rclcpp rc_msgs)  # 添加 rc_msgs 依赖

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

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

ament_package()