Skip to content

Commit

Permalink
Remove usage of ament_cmake_auto
Browse files Browse the repository at this point in the history
  • Loading branch information
rcywongaa committed Jun 8, 2024
1 parent 711c3e0 commit 72e49f2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
56 changes: 31 additions & 25 deletions topic_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.8)
project(topic_tools)

find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(topic_tools_interfaces REQUIRED)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
Expand All @@ -9,106 +13,103 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

ament_python_install_package(${PROJECT_NAME}
SETUP_CFG
${PROJECT_NAME}/setup.cfg
SCRIPTS_DESTINATION
lib/${PROJECT_NAME}
)
include_directories(include)

ament_auto_add_library(relay_node SHARED
add_library(relay_node SHARED
src/relay_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(relay_node rclcpp rclcpp_components)
target_compile_definitions(relay_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(relay_node "topic_tools::RelayNode")

ament_auto_add_executable(relay
add_executable(relay
src/relay.cpp
)

target_link_libraries(relay
relay_node
)

ament_auto_add_library(throttle_node SHARED
add_library(throttle_node SHARED
src/throttle_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(throttle_node rclcpp rclcpp_components)
target_compile_definitions(throttle_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(throttle_node "topic_tools::ThrottleNode")

ament_auto_add_executable(throttle
add_executable(throttle
src/throttle.cpp
)

target_link_libraries(throttle
throttle_node
)

ament_auto_add_library(drop_node SHARED
add_library(drop_node SHARED
src/drop_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(drop_node rclcpp rclcpp_components)
target_compile_definitions(drop_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(drop_node "topic_tools::DropNode")

ament_auto_add_executable(drop
add_executable(drop
src/drop.cpp
)

target_link_libraries(drop
drop_node
)

ament_auto_add_library(mux_node SHARED
add_library(mux_node SHARED
src/mux_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(mux_node rclcpp rclcpp_components topic_tools_interfaces)
target_compile_definitions(mux_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(mux_node "topic_tools::MuxNode")

ament_auto_add_executable(mux
add_executable(mux
src/mux.cpp
)

target_link_libraries(mux
mux_node
)

ament_auto_add_library(demux_node SHARED
add_library(demux_node SHARED
src/demux_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(demux_node rclcpp rclcpp_components topic_tools_interfaces)
target_compile_definitions(demux_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(demux_node "topic_tools::DemuxNode")

ament_auto_add_executable(demux
add_executable(demux
src/demux.cpp
)

target_link_libraries(demux
demux_node
)

ament_auto_add_library(delay_node SHARED
add_library(delay_node SHARED
src/delay_node.cpp
src/tool_base_node.cpp
)
ament_target_dependencies(delay_node rclcpp rclcpp_components)
target_compile_definitions(delay_node PRIVATE "TOPIC_TOOLS_BUILDING_LIBRARY")

rclcpp_components_register_nodes(delay_node "topic_tools::DelayNode")

ament_auto_add_executable(delay
add_executable(delay
src/delay.cpp
)

Expand Down Expand Up @@ -181,7 +182,12 @@ if(BUILD_TESTING)
)
endif()

ament_auto_package(
INSTALL_TO_SHARE
launch
install(TARGETS relay_node relay throttle_node throttle drop_node drop mux_node mux demux_node demux delay_node delay
DESTINATION lib/${PROJECT_NAME}
)

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

ament_package()
1 change: 0 additions & 1 deletion topic_tools/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<maintainer email="[email protected]">ROS Tooling Working Group</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

Expand Down
6 changes: 3 additions & 3 deletions topic_tools_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(rosidl_default_generators REQUIRED)
find_package(builtin_interfaces REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/DemuxAdd.srv"
Expand All @@ -32,4 +32,4 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package()
ament_package()
1 change: 0 additions & 1 deletion topic_tools_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<maintainer email="[email protected]">ROS Tooling Working Group</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<build_depend>rosidl_default_generators</build_depend>

Expand Down

0 comments on commit 72e49f2

Please sign in to comment.