cmake_minimum_required(VERSION 3.8)
project(saltybot_mapping)

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
  "srv/ListMaps.srv"
  "srv/SaveMap.srv"
  "srv/LoadMap.srv"
  "srv/DeleteMap.srv"
  "srv/ExportOccupancy.srv"
  "srv/ExportPointCloud.srv"
  DEPENDENCIES std_msgs builtin_interfaces
)

ament_python_install_package(${PROJECT_NAME})

install(PROGRAMS
  scripts/export_map.py
  scripts/backup_map.py
  DESTINATION lib/${PROJECT_NAME}
)

ament_python_install_scripts(
  "saltybot_mapping/map_manager_node.py"
  "saltybot_mapping/slam_toolbox_persistence.py"
  DESTINATION lib/${PROJECT_NAME}
)

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

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

ament_package()
