[CMake] CMake Python support

Marcel Loose loose at astron.nl
Wed Aug 19 04:15:57 EDT 2009


Ah thanks,

I didn't know that byte code is incompatible between Python releases.
That's definitely a pitfall ;-). I agree that, in that case, it's better
to let the installer handle byte compilation. So, in short, I can do
with the existing FindPython* scripts, I guess?

Thanks for your prompt reply.

Best regards,
Marcel Loose.

On Wed, 2009-08-19 at 10:02 +0200, Hendrik Sattler wrote:
> Zitat von Marcel Loose <loose at astron.nl>:
> > Would it be worthwhile to add Python as a valid language to the
> > project() method? Or is it better to use the currently available
> > FindPython-like scripts.
> >
> > My reason for asking is that oftentimes you'd like to byte-compile
> > Python source and install these byte-compiled files along with the
> > Python sources. If Python were a fully supported programming language,
> > then you could write the CMakeLists.txt files more or less the same way
> > as for other languages (e.g., like Java).
> >
> > It's just a thought, and maybe I'm overlooking all kinds of potential
> > pitfalls.
> 
> Citing from http://effbot.org/zone/python-compile.htm:
> Python?s byte code is portable between platforms, but not necessarily  
> between Python releases.
> 
> Unless your python module is for only one specific version or you know  
> the python interpreter version on all installation targets, you better  
> leave it up to the installer to compile the module (the page shows  
> trivial code in python to do this).
> 
> Something different would be to get complete application binaries.  
> However, that somehow defeats one purpose of using Python.
> 
> HS
> 
> 



More information about the CMake mailing list