Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch opennav_docking_core to modern CMake idioms. #4630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions nav2_docking/opennav_docking_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,34 @@ cmake_minimum_required(VERSION 3.5)
project(opennav_docking_core)

find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav2_common REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(nav2_util REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(tf2_ros REQUIRED)

nav2_package()

set(dependencies
rclcpp
rclcpp_lifecycle
nav2_msgs
nav2_util
add_library(opennav_docking_core INTERFACE)
target_include_directories(opennav_docking_core
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(opennav_docking_core INTERFACE
${geometry_msgs_TARGETS}
rclcpp_lifecycle::rclcpp_lifecycle
tf2_ros::tf2_ros
)

install(TARGETS opennav_docking_core
EXPORT opennav_docking_core
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

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

if(BUILD_TESTING)
Expand All @@ -28,7 +39,12 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_include_directories(include)
ament_export_dependencies(${dependencies})
ament_export_include_directories(include/${PROJECT_NAME})
ament_export_dependencies(
geometry_msgs
rclcpp_lifecycle
tf2_ros
)
ament_export_targets(opennav_docking_core)

ament_package()
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
#include <string>
#include <memory>

#include "rclcpp/rclcpp.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"
#include "nav2_util/lifecycle_node.hpp"
#include "tf2_ros/buffer.h"


Expand Down
8 changes: 3 additions & 5 deletions nav2_docking/opennav_docking_core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
<license>Apache-2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>nav2_common</build_depend>

<depend>rclcpp</depend>
<depend>geometry_msgs</depend>
<depend>rclcpp_lifecycle</depend>
<depend>nav2_util</depend>
<depend>nav2_msgs</depend>
<depend>tf2_ros</depend>

<test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_pytest</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
Loading