We're using SWIG to generate python bindings for some C++ classes. This works fine in the devel space (cmake below). However, I can't figure out how to change our cmake to also install the python modules in the install space in addition. I can change the destinations from CATKIN_DEVEL_PREFIX to CMAKE_INSTALL_PREFIX for PYTHON_MODULE_DIR
which does what I want. However, then the modules are not available in the devel space anymore. So how can I properly install my modules to the install space?
I tried to add the install macro to the cmake below:
# Install
install(TARGETS ${SWIG_MODULE_${target}_REAL_NAME}
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python2.7/${DIST_DIR}/${PYTHON_PACKAGE_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python2.7/${DIST_DIR}/${PYTHON_PACKAGE_NAME}
)
But the corresponding files are not installed to the install space. I only get a relatively empty __init__.py
and __init__.pyc
. In the devel dist-package I have __init__.py
, _package_name.so
, package_name.py
, package_namePYTHON_wrap.cxx
.
Originally posted by prex on ROS Answers with karma: 151 on 2020-04-19
Post score: 0