[CMake] Python installation files on linux
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Wed Feb 27 19:43:07 EST 2008
On 2008-02-27 19:32+0100 Cedric Pinson wrote:
> Hi,
> i am new to cmake and i would like to use it to make a python module, but i
> don't know how to get the version of python installed on the system, how to
> select where the files should be installed considering the version of python
> ...
> I come from autotools and i would like to switch, cmake is very useful to
> write rules/conditional compilation... but for installing files like python
> module it seems not easy. Maybe i missed something.
>
> Any clue to do what i want ?
You can use EXECUTE_PROCESS and python distutils to obtain python
attributes. See
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/cmake/modules/python.cmake
for an example of this approach for determining the installation directory.
(Note, we don't bother to obtain the explicit python version, but it would
certainly be possible to do that with this general approach.) You may also
like to look in trunk/bindings/python and trunk/bindings/swig-support to see
how we build a python interface to the PLplot core C library. Finally,
trunk/examples/python also has lots of plotting examples done with our
python interface to PLplot.
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