cmake_minimum_required(VERSION 3.8)
project(toid_bt)

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

find_package(ament_cmake REQUIRED)

set(PACKAGE_DEPS
  rclcpp
  angles
  behaviortree_cpp
  behaviortree_ros2
  btcpp_ros2_interfaces
  nav2_util
  tf2
  tf2_ros
  tf2_geometry_msgs
  geometry_msgs
  toid_msgs
  std_msgs
  std_srvs
)

foreach(PACKAGE ${PACKAGE_DEPS})
  find_package(${PACKAGE} REQUIRED)
endforeach()

set(SOURCES
    src/bt_executor.cpp
)

add_executable(toid_bt ${SOURCES})

target_include_directories(
  toid_bt
  PRIVATE
  include
)

ament_target_dependencies(toid_bt ${PACKAGE_DEPS})

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

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

target_compile_features(
  toid_bt PUBLIC
  c_std_99
  cxx_std_17
)


ament_package()

