Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to add Python Modules into catkin libraries so they can be imported by other packages

Hi,

I want to create some python modules which are common for multiple ros packages. Can anyone guide me on how to list them in CMakeLists.txt file so they get insatlled in lib/python2.7/dist-packages directory? So far I have tried adding following lines

 add_library(python_module_library scripts/common.py)
 set_target_properties(python_module_library
          PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION}

This is giving me CMake Error as:

 CMake Error: CMake can not determine linker language for target: python_module_library
 CMake Error: Cannot determine link language for target "python_module_library".

Any Ideas?