cmake_minimum_required(VERSION 3.8)
project(img_dev)

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

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rosidl_default_generators REQUIRED) 
find_package(message_filters REQUIRED)
find_package(realsense2_camera_msgs REQUIRED)
find_package(interfaces REQUIRED)

#rosidl_generate_interfaces(${PROJECT_NAME}
#  "msg/ImgMsg.msg"
#  DEPENDENCIES sensor_msgs
#)
include_directories(
  include
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp
)

add_executable(img_dev_node src/main.cpp src/img_dev_node.cpp)
#add_dependencies(img_dev_node ${PROJECT_NAME}__rosidl_typesupport_cpp)

target_link_libraries(img_dev_node
    message_filters::message_filters
)


ament_target_dependencies(img_dev_node rclcpp sensor_msgs realsense2_camera_msgs interfaces)
install(TARGETS img_dev_node DESTINATION lib/${PROJECT_NAME})
install(DIRECTORY msg/ DESTINATION share/${PROJECT_NAME}) 
install(DIRECTORY launch/ DESTINATION share/${PROJECT_NAME}/launch}) 
ament_export_dependencies(rosidl_default_runtime)

ament_package()
