[Qgis-developer] Plugin Development C++ Windows - Any response?

maaza mekuria sailmcm at yahoo.com
Thu Feb 24 17:44:06 EST 2011


I like your idea Julien. It does not make sense to have to store all of QGIS source files for a c++ plugin to work. I think the libraries that need to be referenced should be found identified so that one may be able to just build (compile and link) the dll independently of the rest of the QGIS source.

I was able to find out why my QGIS compile failed. It appears to me that when I uninstalled Python version 2.6 and installed 2.7 something went wrong. I reinstalled Python 2.6 and now I am able to use cmake and configure and generate with out any error messages. I am thankful for your help and prayers, I might add. 

Now that I also heard that there is a build_plugin.py file that could ease my pain of creating a plugin, I am looking at it. Does it need to be run from with QGIS or what?

Just trying to break the C++ plugin barrier,
 
Maaza

--- On Wed, 2/23/11, Julien Malik <julien.malik at c-s.fr> wrote:

From: Julien Malik <julien.malik at c-s.fr>
Subject: Re: [Qgis-developer] Plugin Development C++ Windows - Any response?
To: "Barend Gehrels" <barend at xs4all.nl>
Cc: qgis-developer at lists.osgeo.org
Date: Wednesday, February 23, 2011, 1:05 PM

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
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110224/816ce3ee/attachment-0001.html


More information about the Qgis-developer mailing list