cmake_minimum_required(VERSION 2.8.3)
project(qt_pi_serial)

find_package(catkin REQUIRED COMPONENTS
    roscpp
    qt_pi_msgs
    std_msgs
    sensor_msgs
    nav_msgs
    std_srvs
    tf
)

catkin_package()

set(SRCS src/ros_node.cpp src/serial_driver.cpp)
set(HPP include/qt_pi_serial/commands.h include/qt_pi_serial/ros_node.h include/qt_pi_serial/payload_specs.h include/qt_pi_serial/serial_driver.h)

include_directories(
    include
    ${catkin_INCLUDE_DIRS}
)

add_library(serial_comm ${SRCS})
add_dependencies(serial_comm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(serial_comm ${catkin_LIBRARIES})

add_executable(serial_node src/main.cpp)
target_link_libraries(serial_node serial_comm)

add_executable(serial_comm_test tests/comm_test.cpp)
target_link_libraries(serial_comm_test serial_comm)

add_executable(imu_test tests/imu_data_test.cpp)
target_link_libraries(imu_test serial_comm)
