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

install pip under PACKAGE_DESTINATION instead of GLOBAL_DESTINATION #98

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ configure_file(cmake/env-hooks/42.site_packages.sh.develspace.in ${CATKIN_DEVEL_
configure_file(cmake/env-hooks/42.site_packages.bash.develspace.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/env-hooks/42.site_packages.bash.develspace.in COPYONLY)
#configure_file(cmake/templates/python_setuptools_install.bat.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/templates/python_setuptools_install.bat.in COPYONLY)
configure_file(cmake/templates/python_setuptools_install.sh.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/templates/python_setuptools_install.sh.in COPYONLY)
configure_file(cmake/templates/python.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/templates/python.in COPYONLY)

# to be found in install space and from package
install(FILES
Expand All @@ -62,6 +63,7 @@ install(FILES
install(PROGRAMS
# cmake/templates/python_setuptools_install.bat.in
cmake/templates/python_setuptools_install.sh.in
cmake/templates/python.in
DESTINATION
${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/templates
)
Expand Down
10 changes: 9 additions & 1 deletion cmake/catkin-pip-requirements.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ function(catkin_pip_requirements requirements_txt)
catkin_pip_setup_prefix(${CATKIN_PIP_ENV})

# runnig the pip command (configure time)
catkin_pip_runcmd(${CATKIN_PIP} install ${ARGN} -r ${requirements_txt} --ignore-installed --src ${CMAKE_SOURCE_DIR} --exists-action b --prefix "${CATKIN_DEVEL_PREFIX}")
catkin_pip_runcmd(${CATKIN_PIP} install ${ARGN} -r ${requirements_txt} --ignore-installed --src ${CMAKE_SOURCE_DIR} --exists-action b --prefix "${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}") ## somehow we could not use CATKIN_PACKAGE_SHARE_DESTINATION here

install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/${CATKIN_PIP_GLOBAL_PYTHON_DESTINATION}
DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/${CATKIN_PIP_GLOBAL_PYTHON_DESTINATION})
# for devel
set (CATKIN_PIP_GLOBAL_PYTHON_DESTINATION "lib/python2.7/site-packages") # ???? why we need at here????
configure_file(${CATKIN_PIP_TEMPLATES_PATH}/python.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_LIBEXEC_DESTINATION}/${PROJECT_NAME}/python)
# for install
install(CODE "configure_file(${CATKIN_PIP_TEMPLATES_PATH}/python.in ${CATKIN_GLOBAL_LIBEXEC_DESTINATION}/${PROJECT_NAME}/python)")

endfunction()
1 change: 1 addition & 0 deletions cmake/catkin-pip-setup.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function(catkin_pip_python_setup)
${INSTALL_SCRIPT}
@ONLY)
endif()
configure_file(${CATKIN_PIP_TEMPLATES_PATH}/python.in cmake/python.in @ONLY)

# generate python script which gets executed at install time
configure_file(${catkin_EXTRAS_DIR}/templates/safe_execute_install.cmake.in
Expand Down
3 changes: 3 additions & 0 deletions cmake/templates/python.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

PYTHONPATH=@CATKIN_DEVEL_PREFIX@/@CATKIN_GLOBAL_SHARE_DESTINATION@/@PROJECT_NAME@/@CATKIN_PIP_GLOBAL_PYTHON_DESTINATION@:$PYTHONPATH python $@