[C++-sig] Alternate locations for BOOST_PYTHON_MODULE

Trevor Haba Trevor.Haba at logmein.com
Wed Jun 12 11:05:21 CEST 2013


Hello,

I am attempting to make a large pre-existing code base accessible to python, so that I can run quick scripts to automate the behavior of certain classes for testing purposes. We are using C++ and python 3.3 with the boost.python library. I have a script to automatically generate the BOOST_PYTHON_MODULE( ... ) wrapper definitions for the C++ source code. But, because this is a pre-existing code base with other people already working on it, I would prefer to not have to modify the source code files of all of the classes by inserting the python wrappers at the bottom. All the examples I've seen show the BOOST_PYTHON_MODULE at the bottom of the C++ source file. Is it possible to put the BOOST_PYTHON_MODULE in a separate file, and #include the class it is wrapping? If so, how would I do this? And how would I configure the Jamroot file to compile these properly?

Also, I'm targeting windows systems and using Visual Studio 2010, if that matters

Thanks very much,
Trevor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20130612/5716fec3/attachment.html>


More information about the Cplusplus-sig mailing list