[CMake] cmake and distutils

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Apr 22 16:14:44 EDT 2008


On 2008-04-22 20:06+0200 Christophe Alexandre wrote:

> Hi all,
>
> I'm working on a C++ project exporting its API with in Python.
> Is there an "easy..." way to compile and generate the Python Modules with 
> cmake.
> I find the the distutils and cmake hard to use together : not the same build 
> management, the installation process,...
> Wouldn't it be better to compile the Python Modules only with cmake ?
>
> If anyone has some experience on the subject, I'll be happy to hear from it.

PLplot historically has chosen to use autotools and now cmake to build our
swig-generated (and also one hand-crafted instance) of python bindings to
our C library.  The method works well. Although we don't use distutils for
the actual build, it is quite useful for finding out things about the python
environment that we need to know for the build.

To see the full example, look at cmake/modules/python.cmake (which finds out
everything we need to know about python) and bindings/python/CMakeList.txt
(for the module build and install), and examples/python/CMakeList.txt (for
examples that use the built python interface to PLplot) in
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list