From d29798e006f77c66f0369b6846c82ac70248e615 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 6 Jan 2022 16:06:21 +0100 Subject: [PATCH] Support multiple SCRIPTS_DESTINATIONs For example, xacro is install into lib/xacro/xacro and bin/xacro. Signed-off-by: Robert Haschke --- .../cmake/ament_python_install_package.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ament_cmake_python/cmake/ament_python_install_package.cmake b/ament_cmake_python/cmake/ament_python_install_package.cmake index 6eeb46be..2a401e2c 100644 --- a/ament_cmake_python/cmake/ament_python_install_package.cmake +++ b/ament_cmake_python/cmake/ament_python_install_package.cmake @@ -41,7 +41,7 @@ endmacro() function(_ament_cmake_python_install_package package_name) cmake_parse_arguments( - ARG "SKIP_COMPILE" "PACKAGE_DIR;VERSION;SETUP_CFG;DESTINATION;SCRIPTS_DESTINATION" "" ${ARGN}) + ARG "SKIP_COMPILE" "PACKAGE_DIR;VERSION;SETUP_CFG;DESTINATION" "SCRIPTS_DESTINATION" ${ARGN}) if(ARG_UNPARSED_ARGUMENTS) message(FATAL_ERROR "ament_python_install_package() called with unused " "arguments: ${ARG_UNPARSED_ARGUMENTS}") @@ -166,9 +166,11 @@ setup( endif() # generate/install entry-point console scripts - get_filename_component(ABS_SCRIPTS_DESTINATION "${ARG_SCRIPTS_DESTINATION}" ABSOLUTE BASE_DIR "${CMAKE_INSTALL_PREFIX}") - install(CODE "execute_process(COMMAND ${python_interpreter} setup.py install_scripts --install-dir \"${ABS_SCRIPTS_DESTINATION}\" - WORKING_DIRECTORY \"${build_dir}\")") + foreach(_dest ${ARG_SCRIPTS_DESTINATION}) + get_filename_component(ABS_SCRIPTS_DESTINATION "${_dest}" ABSOLUTE BASE_DIR "${CMAKE_INSTALL_PREFIX}") + install(CODE "execute_process(COMMAND ${python_interpreter} setup.py install_scripts --install-dir \"${ABS_SCRIPTS_DESTINATION}\" + WORKING_DIRECTORY \"${build_dir}\")") + endforeach() install( DIRECTORY "${ARG_PACKAGE_DIR}/"