From afbdfc1dec7d9f01ac0a982b66391a0fe43836d3 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Mon, 16 Dec 2019 14:39:37 -0800 Subject: [PATCH] fix function docblock, check for unparsed arguments (#945) Signed-off-by: Dirk Thomas --- .../cmake/rclcpp_components_register_node.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rclcpp_components/cmake/rclcpp_components_register_node.cmake b/rclcpp_components/cmake/rclcpp_components_register_node.cmake index 3e38aa5d27..e7fa3e2fd7 100644 --- a/rclcpp_components/cmake/rclcpp_components_register_node.cmake +++ b/rclcpp_components/cmake/rclcpp_components_register_node.cmake @@ -11,13 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +# Register an rclcpp component with the ament +# resource index and create an executable. # # usage: rclcpp_components_register_node( # PLUGIN EXECUTABLE ) # -# Register an rclcpp component with the ament -# resource index and create an executable. -# # :param target: the shared library target # :type target: string # :param PLUGIN: the plugin name @@ -27,6 +27,10 @@ # macro(rclcpp_components_register_node target) cmake_parse_arguments(ARGS "" "PLUGIN;EXECUTABLE" "" ${ARGN}) + if(ARGS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "rclcpp_components_register_node() called with unused " + "arguments: ${ARGS_UNPARSED_ARGUMENTS}") + endif() set(component ${ARGS_PLUGIN}) set(node ${ARGS_EXECUTABLE}) _rclcpp_components_register_package_hook()