diff --git a/CMakeLists.txt b/CMakeLists.txt index cc5dca619..ed5d5c07d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,11 @@ install(DIRECTORY cmake/ USE_SOURCE_PERMISSIONS ) -#install( -# FILES -# ${CMAKE_CURRENT_BINARY_DIR}/cmake_install/catkin-config.cmake -# DESTINATION share/cmake/catkin -# ) +configure_file(setup.sh.in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh + setup.bash + setup.zsh + DESTINATION / + ) catkin_package(catkin) diff --git a/cmake/em/rules.python_distutils.em b/cmake/em/rules.python_distutils.em index 3436f7406..01649d6e1 100755 --- a/cmake/em/rules.python_distutils.em +++ b/cmake/em/rules.python_distutils.em @@ -18,7 +18,8 @@ override_dh_auto_configure: override_dh_auto_install: dh_auto_install -Scmake - dh_auto_install -Spython_distutils -- --prefix="@(CMAKE_INSTALL_PREFIX)" + dh_auto_install -Spython_distutils -- \ + --prefix="@(CMAKE_INSTALL_PREFIX)" --install-layout=deb override_dh_auto_build: dh_auto_build -Scmake diff --git a/setup.bash b/setup.bash new file mode 100644 index 000000000..93a3e40f4 --- /dev/null +++ b/setup.bash @@ -0,0 +1,22 @@ +#!/bin/bash +# IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND +# IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES +# EDIT "setup.sh" IN THIS DIRECTORY. + +# Load the path of this particular setup.bash + +SCRIPT_PATH="${BASH_SOURCE[0]}"; +if([ -h "${SCRIPT_PATH}" ]) then + while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done +fi +pushd . > /dev/null +cd `dirname ${SCRIPT_PATH}` > /dev/null +SCRIPT_PATH=`pwd`; +popd > /dev/null + + +. $SCRIPT_PATH/setup.sh + +if [ -e ${ROS_ROOT}/tools/rosbash/rosbash ]; then + . ${ROS_ROOT}/tools/rosbash/rosbash +fi diff --git a/setup.sh.in b/setup.sh.in new file mode 100644 index 000000000..42eb3efc2 --- /dev/null +++ b/setup.sh.in @@ -0,0 +1,2 @@ +PYTHONPATH=@CMAKE_INSTALL_PREFIX@/lib/python$(python -c 'from sys import version_info as v; print "%u.%u" % (v.major, v.minor)'):$PYTHONPATH + diff --git a/setup.zsh b/setup.zsh new file mode 100644 index 000000000..8aec48e96 --- /dev/null +++ b/setup.zsh @@ -0,0 +1,13 @@ +#!/bin/zsh +# IT IS UNLIKELY YOU WANT TO EDIT THIS FILE BY HAND +# IF YOU WANT TO CHANGE THE ROS ENVIRONMENT VARIABLES +# EDIT "setup.sh" IN THIS DIRECTORY. + +# Load the path of this particular setup.zsh +SCRIPT_PATH="$(dirname $0)"; + +. $SCRIPT_PATH/setup.sh + +if [ -e ${ROS_ROOT}/tools/rosbash/roszsh ]; then + . ${ROS_ROOT}/tools/rosbash/roszsh +fi