File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 32
32
//used by Mac to find system Qt plugins when bundle is run from build directory
33
33
#define QTPLUGINSDIR "${QT_PLUGINS_DIR}"
34
34
35
+ //used by Mac to find system Open Scene Graph plugins when bundle is run from build directory
36
+ #define OSG_PLUGINS_PATH "${OSG_PLUGINS_PATH}"
37
+
35
38
#cmakedefine USING_NMAKE
36
39
37
40
#cmakedefine HAVE_POSTGRESQL
Original file line number Diff line number Diff line change 38
38
#include < qgsdistancearea.h>
39
39
40
40
#include < QAction>
41
+ #include < QDir>
41
42
#include < QToolBar>
42
43
#include < QMessageBox>
43
44
@@ -96,11 +97,23 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
96
97
setObjectName ( " globePlugin" );
97
98
setParent ( theQgisInterface->mainWindow () );
98
99
99
- // add internal osg plugin path if bundled osg on OS X
100
- #ifdef HAVE_MACAPP_BUNDLED_OSG
101
- if ( !QgsApplication::isRunningFromBuildDir ( ) )
100
+ // update path to osg plugins on Mac OS X
101
+ #ifdef Q_OS_MACX
102
+ if ( !getenv ( " OSG_LIBRARY_PATH " ) )
102
103
{
103
- osgDB::Registry::instance ()->setLibraryFilePathList ( QDir::cleanPath ( QgsApplication::pluginPath () + " /../osgPlugins" ).toStdString () );
104
+ // OSG_PLUGINS_PATH value set by CMake option
105
+ QString ogsPlugins ( OSG_PLUGINS_PATH );
106
+ #ifdef HAVE_MACAPP_BUNDLED_OSG
107
+ if ( !QgsApplication::isRunningFromBuildDir () )
108
+ {
109
+ // add internal osg plugin path if bundled osg
110
+ ogsPlugins = QgsApplication::pluginPath () + " /../osgPlugins" ;
111
+ }
112
+ #endif
113
+ if ( QFile::exists ( ogsPlugins ) )
114
+ {
115
+ osgDB::Registry::instance ()->setLibraryFilePathList ( QDir::cleanPath ( ogsPlugins ).toStdString () );
116
+ }
104
117
}
105
118
#endif
106
119
You can’t perform that action at this time.
0 commit comments