Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use catkin_install_python() to install Python scripts #596

Merged
merged 1 commit into from Feb 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/catkin_generate_environment.cmake
Expand Up @@ -58,7 +58,7 @@ function(catkin_generate_environment)
configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in
${CMAKE_BINARY_DIR}/catkin_generated/installspace/_setup_util.py
@ONLY)
install(PROGRAMS
catkin_install_python(PROGRAMS
${CMAKE_BINARY_DIR}/catkin_generated/installspace/_setup_util.py
DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
Expand Down
17 changes: 4 additions & 13 deletions doc/howto/installing_python.rst
Expand Up @@ -21,19 +21,10 @@ install in the global ``bin/`` directory.
Standard ROS practice is to place all your executable Python programs
in a ``scripts/`` subdirectory. To keep the user API clean,
executable script names generally do not include a ``.py`` suffix.
Your ``CMakeLists.txt`` can conveniently install all the scripts in
that directory::

install(DIRECTORY scripts/
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE)

The ``PATTERN ".svn" EXCLUDE`` is only needed if you use a Subversion_
repository. For other types of repositories, it can be omitted.

Other directory names are allowed. If you mixed the scripts with
other files, you should install them one by one::
Your ``CMakeLists.txt`` should install all the scripts explictly
using the special install function ``catkin_install_python``.
This will make sure that shebang lines are updated to use the
specific Python version used at configure time::

install(PROGRAMS scripts/your_node1 scripts/your_node2
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide/setup_dot_py.rst
Expand Up @@ -97,7 +97,7 @@ one distributes to pypi.
installing such python scripts is to add the following to
the CMakeLists.txt::

install(PROGRAMS scripts/myscript
catkin_install_python(PROGRAMS scripts/myscript
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})


Expand Down