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

Tim Sutton lists at linfiniti.com
Wed Feb 23 16:13:28 EST 2011


Hi

On Wed, Feb 23, 2011 at 8:05 PM, Julien Malik <julien.malik at c-s.fr> wrote:
> 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 added the FindQGIS cmake file that I wrote for openModeller some
years ago into qgis/src/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.

Ok I added support for this - see the bottom of the general options
tab in QGIS Options dialog.

Available in trunk as of r15250.

I have only tested on linux but it should work on linux & mac too.

Some time maybe you can return the favour and help me to get my otb
plugins to compile properly - I never did get them to build by
following the instructions on your wiki.... I'd have to write back to
this list with more specifics of the problem first though.

Regards

Tim

> 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
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list