Skip to content

Commit

Permalink
Merge pull request #285 from orocos/refactor/remove-env-hooks-and-col…
Browse files Browse the repository at this point in the history
…con-support

Remove python_orocos_kdl env-hooks, support devel-space build of python_orocos_kdl and invoke catkin_package()
  • Loading branch information
MatthijsBurgh authored Sep 21, 2020
2 parents a2a2dff + 7e1f40d commit 5b37d7e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 18 deletions.
11 changes: 8 additions & 3 deletions orocos_kdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ MESSAGE( STATUS "Orocos KDL version ${VERSION} (${KDL_VERSION_MAJOR}.${KDL_VERSI
SET( PROJ_SOURCE_DIR ${orocos_kdl_SOURCE_DIR} )
SET( PROJ_BINARY_DIR ${orocos_kdl_BINARY_DIR} )

# catkin-specific configuration (optional)
find_package(catkin QUIET)
if(catkin_FOUND)
catkin_package(
SKIP_CMAKE_CONFIG_GENERATION
SKIP_PKG_CONFIG_GENERATION
)
endif()

IF(NOT CMAKE_INSTALL_PREFIX)
SET( CMAKE_INSTALL_PREFIX /usr/local/ CACHE PATH "Installation directory" FORCE)
Expand Down Expand Up @@ -125,6 +133,3 @@ CONFIGURE_FILE(orocos_kdl.pc.in ${CMAKE_CURRENT_BINARY_DIR}/orocos_kdl.pc @ONLY)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/orocos-kdl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/orocos_kdl.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)

# Install package manifest (for catkin compatibility)
INSTALL(FILES package.xml DESTINATION share/orocos_kdl)
2 changes: 1 addition & 1 deletion orocos_kdl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<url>http://wiki.ros.org/orocos_kdl</url>
<license>LGPL</license>

<buildtool_depend>cmake</buildtool_depend>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>eigen</build_depend>

<exec_depend>catkin</exec_depend>
Expand Down
20 changes: 12 additions & 8 deletions python_orocos_kdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} REQUIRED)
# get_python_lib in python3 produces path which isn't in sys.path: https://bugs.launchpad.net/ubuntu/+source/python3-stdlib-extensions/+bug/1832215
# execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific=True, prefix=''))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
set(PYTHON_SITE_PACKAGES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages")
set(PYTHON_SITE_PACKAGES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages") # This might be overridden below if built with catkin.
set(LIBRARY_NAME "PyKDL")

# catkin-specific configuration (optional)
find_package(catkin QUIET)
if(catkin_FOUND)
catkin_package(
SKIP_CMAKE_CONFIG_GENERATION
SKIP_PKG_CONFIG_GENERATION
)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${PYTHON_INSTALL_DIR})
set(PYTHON_SITE_PACKAGES_INSTALL_DIR "${PYTHON_INSTALL_DIR}")
endif()

message(DEPRECATION "PyKDL has been moved to PyBind11. PyKDL based on SIP might become depracted in the (near) future. To keep using the SIP based version set 'BUILD_PYKDL_PYBIND11' to OFF.")

option(BUILD_PYKDL_PYBIND11 "Use PyBind11 instead of SIP" ON)
Expand Down Expand Up @@ -53,10 +64,3 @@ else (BUILD_PYKDL_PYBIND11)
endif()
add_sip_python_module(${LIBRARY_NAME} ${LIBRARY_NAME}/sip/${LIBRARY_NAME}.sip ${orocos_kdl_LIBRARIES})
endif(BUILD_PYKDL_PYBIND11)

install(FILES package.xml DESTINATION share/python_orocos_kdl)

find_package(catkin QUIET)
if(catkin_FOUND)
catkin_add_env_hooks(python_orocos_kdl_site_packages SHELLS bash tcsh zsh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
endif()

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions python_orocos_kdl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<url>http://wiki.ros.org/python_orocos_kdl</url>
<license>LGPL</license>

<buildtool_depend>cmake</buildtool_depend>
<buildtool_depend>catkin</buildtool_depend>

<build_depend>orocos_kdl</build_depend>
<build_depend condition="$ROS_PYTHON_VERSION == 2">python-sip</build_depend>
Expand All @@ -32,7 +32,6 @@
<doc_depend>python-sphinx</doc_depend>

<export>
<build_type>cmake</build_type>
<rosdoc config="rosdoc.yaml"/>
</export>

Expand Down

0 comments on commit 5b37d7e

Please sign in to comment.