Skip to content

Commit

Permalink
Install xacro using console_script entrypoint (#304)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Haschke <[email protected]>
  • Loading branch information
wmmc88 and rhaschke authored Oct 21, 2022
1 parent b8716fc commit 334589a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 75 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ cmake_minimum_required(VERSION 3.5)
project(xacro)

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

install(FILES scripts/completion.bash DESTINATION share/${PROJECT_NAME}/environment)

## The following manually installs the python package and the entry-point script
## Using ament_cmake, we cannot actually use setup.py to install these...
# install xacro python package and it's console_script entry-point script
ament_python_install_package(${PROJECT_NAME} SCRIPTS_DESTINATION lib/${PROJECT_NAME})

# install xacro python package
ament_python_install_package(xacro)
# install main script
install(PROGRAMS scripts/xacro DESTINATION bin)
install(PROGRAMS scripts/xacro DESTINATION lib/${PROJECT_NAME})
# install entry-point script(s) in bin as well
install(
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_python/${PROJECT_NAME}/scripts/
DESTINATION bin/
USE_SOURCE_PERMISSIONS)

if(BUILD_TESTING)
## run linters as defined in package.xml
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<author>Robert Haschke</author>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_python</buildtool_depend>

<depend>ament_index_python</depend>
<depend>python3-yaml</depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
33 changes: 0 additions & 33 deletions scripts/xacro

This file was deleted.

3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[options.entry_points]
console_scripts =
xacro = xacro:main
35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

0 comments on commit 334589a

Please sign in to comment.