Skip to content

Commit

Permalink
Support multiple SCRIPTS_DESTINATIONs
Browse files Browse the repository at this point in the history
For example, xacro is install into lib/xacro/xacro and bin/xacro.

Signed-off-by: Robert Haschke <[email protected]>
  • Loading branch information
rhaschke committed Jan 6, 2022
1 parent fe6b3a3 commit d29798e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ament_cmake_python/cmake/ament_python_install_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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}/"
Expand Down

0 comments on commit d29798e

Please sign in to comment.