[Qgis-developer] osgearth/globe - osg plugins?

William Kyngesburye woklist at kyngchaos.com
Wed Jul 27 11:36:13 EDT 2011


On Jul 27, 2011, at 4:21 AM, Pirmin Kalberer wrote:

>>> as far as I can recall the plugins are transparent and we have no plugin
>>> specific code: "The OpenSceneGraph database plugin library osgDB
>>> automatically loads plugins on demand, using the extension of the file
>>> being loaded/saved to determine which plugin to load."
>>> 
>>>> How does osg handle alternate paths for osg plugins, and does the globe
>>>> plugin make use of this?  I guess it would have to something configured
>>>> for compilation.
>> 
>> But, can an alternate osg plugin searth path be specified from osgEarth, or
>> can this be added.  I can't bundle osg/osgEarth in the QGIS application if
>> not, and must distribute a separate package like my other frameworks
>> (though maybe others would be interested in that).
>> 
> 
> You can set OSG library search paths at runtime with OSG_LIBRARY_PATH or 
> OSG_LD_LIBRARY_PATH 
> (http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/EnvironmentVariables).
> If you want to bundle the libraries together with QGIS, then the cmake 
> variables CMAKE_INSTALL_PREFIX and OSG_PLUGINS of OSG/OSGEarth have to be 
> changed at least. If you set OSG_PLUGINS to an empty string, the plugins will 
> be installed in the same directory as the libraries.
> On the QGIS globe side only the OSG*LIBRARY cmake variables have to be 
> changed.
> 

- OS X apps do not use existing environment variables unless the app is started from a shell, but this is not how apps are started.  An app can still use environment variables if they are defined in the app process.

- when something is bundled in an OS X app, paths need to be relative to the app package because the app package can be moved (OS X apps normally are not locked to a configured path).  osg is configured with an absolute path for plugins.  Same as the library is also not correct since osg is built as frameworks on OS X, so there is no single common library path for the binary framework file (just a common framework path with multiple framework subfolders).


If env vars is the only way to configure the path after compilation, the GDAL Tools plugin has one possibility.  An application configuration option to set the path manually by the user.  This could work in a pinch, but it requires the user to set it post-installation of QGIS.

What's really needed is a compilation method - define OSG_LIBRARY_PATH like QGIS defines its own plugin path and other paths: QGIS application path + one of the *_SUBDIR settings.  this could be done globally without hurting other platforms and would open them to bundling possibilities (I don't know how the standalone Windows QGIS bundles things).  This is simple enough (and there are examples in QGIS already) that I think my minimal C++ skills can try it.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war



More information about the Qgis-developer mailing list