update CMakeLists.txt to be similar to object detection

This commit is contained in:
Sem van der Hoeven
2023-04-25 16:34:05 +02:00
parent b5daa4a77a
commit 5b6c097bd9
3 changed files with 15 additions and 8 deletions

View File

@@ -22,7 +22,20 @@ find_package(px4_ros_com REQUIRED)
find_package(px4_msgs REQUIRED)
add_executable(heartbeat src/heartbeat.cpp)
ament_target_dependencies(
heartbeat
rclcpp
px4_ros_com
px4_msgs
)
add_executable(px4_controller src/px4_controller.cpp)
ament_target_dependencies(
px4_controller
rclcpp
px4_ros_com
px4_msgs
)
target_include_directories(heartbeat PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -32,12 +45,6 @@ target_include_directories(px4_controller PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(
heartbeat
rclcpp
px4_ros_com
px4_msgs
)
install(TARGETS heartbeat px4_controller
DESTINATION lib/${PROJECT_NAME})