From 07e04f596b8a0c3bd9748465f6c1acf94518f504 Mon Sep 17 00:00:00 2001 From: Siddharth Kucheria Date: Mon, 15 Jul 2019 10:55:47 -0700 Subject: [PATCH] new macro to replace add_node Signed-off-by: Siddharth Kucheria --- ...=> rclcpp_components_add_library_with_nodes.cmake} | 2 +- .../cmake/rclcpp_components_register_node.cmake | 11 ++++++++--- rclcpp_components/rclcpp_components-extras.cmake | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) rename rclcpp_components/cmake/{rclcpp_components_add_multiple_nodes.cmake => rclcpp_components_add_library_with_nodes.cmake} (96%) diff --git a/rclcpp_components/cmake/rclcpp_components_add_multiple_nodes.cmake b/rclcpp_components/cmake/rclcpp_components_add_library_with_nodes.cmake similarity index 96% rename from rclcpp_components/cmake/rclcpp_components_add_multiple_nodes.cmake rename to rclcpp_components/cmake/rclcpp_components_add_library_with_nodes.cmake index a05e6ae550..bb1a675a73 100644 --- a/rclcpp_components/cmake/rclcpp_components_add_multiple_nodes.cmake +++ b/rclcpp_components/cmake/rclcpp_components_add_library_with_nodes.cmake @@ -24,7 +24,7 @@ # :param sourceN: the list of source files for executable and shared library # :type sourceN: list of strings # -function(rclcpp_components_add_multiple_nodes target) +function(rclcpp_components_add_library_with_nodes target) cmake_parse_arguments( ARGS "EXCLUDE_FROM_ALL" diff --git a/rclcpp_components/cmake/rclcpp_components_register_node.cmake b/rclcpp_components/cmake/rclcpp_components_register_node.cmake index 40b46543ee..3a87b63eaf 100644 --- a/rclcpp_components/cmake/rclcpp_components_register_node.cmake +++ b/rclcpp_components/cmake/rclcpp_components_register_node.cmake @@ -28,9 +28,14 @@ # :type node: string # macro(rclcpp_components_register_node target) - set(ARGS ${ARGN}) - list(GET ARGS 0 component) - list(GET ARGS 1 node) + cmake_parse_arguments( + ARGS + "" + "PLUGIN;EXECUTABLE" + "" + ${ARGN}) + set(component ${ARGS_PLUGIN}) + set(node ${ARGS_EXECUTABLE}) _rclcpp_components_register_package_hook() if(WIN32) set(_path "bin") diff --git a/rclcpp_components/rclcpp_components-extras.cmake b/rclcpp_components/rclcpp_components-extras.cmake index 61e5acd51e..f3d7da2521 100644 --- a/rclcpp_components/rclcpp_components-extras.cmake +++ b/rclcpp_components/rclcpp_components-extras.cmake @@ -29,3 +29,4 @@ include("${rclcpp_components_DIR}/rclcpp_components_register_nodes.cmake") include("${rclcpp_components_DIR}/rclcpp_components_add_node.cmake") include("${rclcpp_components_DIR}/rclcpp_components_add_multiple_nodes.cmake") include("${rclcpp_components_DIR}/rclcpp_components_register_node.cmake") +include("${rclcpp_components_DIR}/rclcpp_components_add_library_with_nodes.cmake") \ No newline at end of file