Alan W. Irwin wrote:
> 
> Finding the python version should be straightforward. The last stanza
> of cmake/modules/plplot.cmake provides a template for running python
> to generate useful information about python.
> 
> Modify that template to run, e.g.,
> 
> python -c "import sys; print sys.version.split()[0]"
> 
> to obtain the version.  I suggest the result should be stored unmodified
> (see below) in the PYTHON_VERSION variable.
> 
> Note, however, that the version generated this way may have some
> trailing non-numeric data you will need to filter out with the cmake
> string command before you can make numerical comparisons between say
> 2.6.0 (when the necessary buffer functionality is first available to
> python) and ${PYTHON_VERSION}.  For my (Debian squeeze) system I
> obtain, for example, "2.6.5+" from the above command.

Ok, I think I figured out how to do this and to check the Python and 
Swig versions to make sure that they are ok, but I can't figure out how 
to set an environment variable for the build process. In: 
bindings/swig-support/plplotcapi.i I have:

#ifdef PYTHON_HAVE_PYBUFFER

%include <pybuffer.i>
%pybuffer_mutable_string(void * plotmem)

%feature("autodoc", "Set the memory area to be plotted (with the 'mem' 
driver).") plsmem;
void
plsmem(PLINT maxx, PLINT maxy, void *plotmem);

#endif

Now I need cmake to set PYTHON_HAVE_PYBUFFER appropriately. I tried:
SET(ENV{PYTHON_HAVE_PYBUFFER} ON), but that does not seem to work.

-Hazen


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to