Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks. I'll have a look at the packages you mentioned. However, I was under the impression that one really wants to compile Python extensions (shared object files that link symbols from the Python interpreter and are loaded in Python as modules) with distutils so that various C runtime parameters are set correctly. I don't recall the details but could imagine that one essentially wants to include the config.h that corresponds to the build of Python in use. (Of course, if that's all that's necessary, that would be easy enough to specify another way and then use of wouldn't be necessary.)

That being said, I did manage to get rosmake to build my extension using, and it Works For Me. In my case, I am compiling an extension named "pyosgvr", which has symbols from both the Cython source file pyosgvr.pyx and the C++ source file osgvr.cpp. The relevant lines in my CMakeLists.txt:

# use distutils to build the extension module
add_custom_target( ALL
                COMMAND ${PYTHON_EXECUTABLE} build_ext --inplace
                DEPENDS src/pyosgvr.pyx src/osgvr.cpp

# move the built extension module into the correct location (this is a total hack)
add_custom_target(pyosgvr ALL
                COMMAND cp ${CMAKE_SOURCE_DIR}/ src/vros_projectors/

# make sure the above commands run in the correct order