cmake_minimum_required(VERSION 3.0.2)

project(toposens_sync)

add_compile_options(-std=c++17)

set(${PROJECT_NAME}_DEPS
  message_runtime
  roscpp
  toposens_driver
  toposens_msgs
)

find_package(catkin REQUIRED COMPONENTS ${${PROJECT_NAME}_DEPS})

find_package(Boost REQUIRED COMPONENTS system)

catkin_package(INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} CATKIN_DEPENDS
               ${${PROJECT_NAME}_DEPS})

# ##############################################################################
# Build ##
# ##############################################################################

include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})

add_subdirectory(src)

install(DIRECTORY include/${PROJECT_NAME}/
        DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

# ##############################################################################
# Test ##
# ##############################################################################

if(CATKIN_ENABLE_TESTING)
  add_subdirectory(tests)
endif()
