[Qgis-developer] QGIS Python support in a library

Martin Dobias wonder.sk at gmail.com
Wed May 28 08:35:40 EDT 2008

Hi all,

as you probably know, until now embedding of Python to QGIS was done
directly in the QGIS application sources and the support was
implemented using conditional #ifdefs. So when building qgis binary,
you got it with or without python. This wasn't a very good solution
and was doing problems for packagers since there was no easy way to do
optional installation of python support.

In my recent commit to trunk (r8530) I've done the embedding in more
flexible way. All python support code has been moved to src/python
directory and now compiles as "qgispython" library. When QGIS
application is started, it checks for the presence of this library and
tries to load it and init python support. If something is wrong, the
python support (i.e. python plugins and console) is disabled.

I've tested this new approach on my ubuntu box with success, but other
platforms are untested (I could try it on win, but I don't have access
to OS X). So Mac and Win wizards please give it a try to see whether
it's working fine there or not. I know that Mac makes difference
between shared objects and libraries (MODULE / SHARED option in CMake)
but I have no idea which one to choose there so try changing this
first if you encounter some problems.

Generally I hope it won't produce any great havoc, but one never knows
:-) If that works fine, you shouldn't notice any change. If that
doesn't work fine, nothing python-related will work. Additionally,
this change has no impact on python bindings or plugins.


More information about the Qgis-developer mailing list