Skip to content

Commit 334589a

Browse files
wmmc88rhaschke
andauthored
Install xacro using console_script entrypoint (#304)
Co-authored-by: Robert Haschke <[email protected]>
1 parent b8716fc commit 334589a

File tree

5 files changed

+13
-75
lines changed

5 files changed

+13
-75
lines changed

CMakeLists.txt

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ cmake_minimum_required(VERSION 3.5)
22
project(xacro)
33

44
find_package(ament_cmake REQUIRED)
5+
find_package(ament_cmake_python REQUIRED)
56

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

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

11-
# install xacro python package
12-
ament_python_install_package(xacro)
13-
# install main script
14-
install(PROGRAMS scripts/xacro DESTINATION bin)
15-
install(PROGRAMS scripts/xacro DESTINATION lib/${PROJECT_NAME})
12+
# install entry-point script(s) in bin as well
13+
install(
14+
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ament_cmake_python/${PROJECT_NAME}/scripts/
15+
DESTINATION bin/
16+
USE_SOURCE_PERMISSIONS)
1617

1718
if(BUILD_TESTING)
1819
## run linters as defined in package.xml

package.xml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<author>Robert Haschke</author>
2121

2222
<buildtool_depend>ament_cmake</buildtool_depend>
23+
<buildtool_depend>ament_cmake_python</buildtool_depend>
24+
2325
<depend>ament_index_python</depend>
2426
<depend>python3-yaml</depend>
2527
<test_depend>ament_lint_auto</test_depend>

scripts/xacro

-33
This file was deleted.

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[options.entry_points]
2+
console_scripts =
3+
xacro = xacro:main

setup.py

-35
This file was deleted.

0 commit comments

Comments
 (0)