Hello,
Having written some C++ plugins (for Orfeo Toolbox), I have some
feedback to give.
The current recommended procedure is to have a source build of qgis, add
your plugin inside qgis source tree, hack a QGis CMakeLists to add the
new plugin dir, and recompile Qgis.
In my opinion, a better approach is to build them as external project.
The idea is to be able to build a plugin on top of a prebuilt Qgis
(libqgis-dev on ubuntu/debian, and the OSGeo4W build on windows)
That's what I have set up for the plugins I wrote, but ran into the
following problem :
- There is no FindQgis.cmake or QGisConfig.cmake exported in the qgis
development package (either OSGeo4W or ubuntu/debian), so importing QGis
inside a CMake project must be done "by hand". It's ok with the QGis
include path and the path to libqgis_core. But you have to take care of
importing Qt also, which should be done by a FindQgis.cmake
- I had to hack some QGis #define to make it build on windows
(GUI_EXPORT and CORE_EXPORT). Again, this should be handled by a
ADD_DEFINITION inside a FindQgis.cmake
One other thing : it would be nice if the C++ plugins could be loaded
from another directory than the official one.
Let's say I wrote a bunch of plugins for a specific software, I would
like to store them in their own directory instead of messing up with the
official plugins. Maybe it's already supported but I don't know how to
do it...
Regards,
Julien
Le 23/02/2011 14:12, Barend Gehrels a écrit :
Hi,
Yes as Martin notes, and as I mentioned in my last email in this
thread "If you are able to use linux, you can even more easily just
use the plugin_builder.py script in that src/plugins directory and it
will generate for you a 'hello world' C++ plugin."
Perhaps the linux part is not relevant though as you should be able to
use it on widows with python, but I've never tried. As an interesting
history note, we have had a plugin builder script (in one form or
another) in QGIS for c++ plugins from very early on in the life of
QGIS's plugin support.
On Windows the plugin_builder.py works also perfectly.
Regards, Barend
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer