Skip to content
Permalink
Browse files

[globe] Make OSG_PLUGINS_PATH CMake option functional on Mac

  • Loading branch information
dakcarto committed Nov 12, 2013
1 parent e882e47 commit 3d0b28649ec8523922d18540e154dc5d9b1e5745
Showing with 20 additions and 4 deletions.
  1. +3 −0 cmake_templates/qgsconfig.h.in
  2. +17 −4 src/plugins/globe/globe_plugin.cpp
@@ -32,6 +32,9 @@
//used by Mac to find system Qt plugins when bundle is run from build directory
#define QTPLUGINSDIR "${QT_PLUGINS_DIR}"

//used by Mac to find system Open Scene Graph plugins when bundle is run from build directory
#define OSG_PLUGINS_PATH "${OSG_PLUGINS_PATH}"

#cmakedefine USING_NMAKE

#cmakedefine HAVE_POSTGRESQL
@@ -38,6 +38,7 @@
#include <qgsdistancearea.h>

#include <QAction>
#include <QDir>
#include <QToolBar>
#include <QMessageBox>

@@ -96,11 +97,23 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
setObjectName( "globePlugin" );
setParent( theQgisInterface->mainWindow() );

// add internal osg plugin path if bundled osg on OS X
#ifdef HAVE_MACAPP_BUNDLED_OSG
if ( !QgsApplication::isRunningFromBuildDir() )
// update path to osg plugins on Mac OS X
#ifdef Q_OS_MACX
if ( !getenv( "OSG_LIBRARY_PATH" ) )
{
osgDB::Registry::instance()->setLibraryFilePathList( QDir::cleanPath( QgsApplication::pluginPath() + "/../osgPlugins" ).toStdString() );
// OSG_PLUGINS_PATH value set by CMake option
QString ogsPlugins( OSG_PLUGINS_PATH );
#ifdef HAVE_MACAPP_BUNDLED_OSG
if ( !QgsApplication::isRunningFromBuildDir() )
{
// add internal osg plugin path if bundled osg
ogsPlugins = QgsApplication::pluginPath() + "/../osgPlugins";
}
#endif
if ( QFile::exists( ogsPlugins ) )
{
osgDB::Registry::instance()->setLibraryFilePathList( QDir::cleanPath( ogsPlugins ).toStdString() );
}
}
#endif

0 comments on commit 3d0b286

Please sign in to comment.
You can’t perform that action at this time.