cmake_minimum_required(VERSION 3.8)
project(depthimage_view)

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(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)

add_executable(view_depthimage src/view_depthimage.cpp)
ament_target_dependencies(view_depthimage rclcpp sensor_msgs std_msgs)

target_include_directories(view_depthimage PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>)
target_compile_features(view_depthimage PUBLIC c_std_99 cxx_std_17)  # Require C99 and C++17

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

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
