[globe] Fix Mac dependencies so plugin can run from app bundle

This commit is contained in:
Larry Shaffer 2013-09-11 22:36:23 -06:00
parent e7ae5d2c68
commit 546b8d2397
5 changed files with 17 additions and 6 deletions

View File

@ -440,7 +440,11 @@ ELSE (WIN32)
# changed later to reference in-app resources upon install
SET (CMAKE_INSTALL_NAME_DIR ${CMAKE_BINARY_DIR}/output/lib)
IF (WITH_GLOBE)
SET (OSG_PLUGINS_PATH "" CACHE PATH "Path to OSG plugins for bundling")
SET (OSG_PLUGINS_PATH "" CACHE PATH "Path to OSG plugins for bundling")
IF (QGIS_MACAPP_BUNDLE GREATER 0)
# ensure OSG plugins bundled path will be used by globe plugin
SET (HAVE_MACAPP_BUNDLED_OSG 1)
ENDIF (QGIS_MACAPP_BUNDLE GREATER 0)
ENDIF (WITH_GLOBE)
# recent cmakes force SDKs, recent SDKs don't have user symlinks
# need to find non-system frameworks

View File

@ -50,5 +50,7 @@
#cmakedefine MAPSERVER_SKIP_ECW
#cmakedefine HAVE_MACAPP_BUNDLED_OSG
#endif

View File

@ -15,7 +15,7 @@ SET (OSG_PLUGINS_PATH "@OSG_PLUGINS_PATH@")
# list of osg frameworks to bundle
SET (OSGLIST OpenThreads osg osgDB osgGA osgViewer osgEarth osgEarthAnnotation osgEarthFeatures osgEarthSymbology osgEarthUtil osgFX osgManipulator osgShadow osgSim osgTerrain osgText osgUtil osgWidget)
SET (OSGLIST OpenThreads osg osgAnimation osgDB osgGA osgViewer osgEarth osgEarthAnnotation osgEarthFeatures osgEarthSymbology osgEarthUtil osgFX osgManipulator osgParticle osgPresentation osgShadow osgSim osgTerrain osgText osgUtil osgVolume osgWidget)
IF (@HAVE_OSGEARTHQT@)
SET (OSGLIST ${OSGLIST} osgQt osgEarthQt)
ENDIF (@HAVE_OSGEARTHQT@)

View File

@ -280,6 +280,10 @@ FOREACH (QFW ${QTLISTQG})
IF (@OSX_HAVE_LOADERPATH@)
SET (QFW_CHG_TO "${ATLOADER}/@QGIS_PLUGIN_SUBDIR_REV@/${QGIS_FW_SUBDIR}/${LIBPOST}")
ENDIF ()
# osg qfont plugin
IF (@HAVE_OSGEARTHQT@)
INSTALLNAMETOOL_CHANGE ("${QFW_CHG}" "${QFW_CHG_TO}" "${QPLUGDIR}/../osgPlugins/osgdb_qfont.so")
ENDIF (@HAVE_OSGEARTHQT@)
FOREACH (QI qgif;qico;qjpeg;qsvg;qtiff)
INSTALLNAMETOOL_CHANGE ("${QFW_CHG}" "${QFW_CHG_TO}" "${QPLUGDIR}/../imageformats/lib${QI}.dylib")
ENDFOREACH (QI)

View File

@ -96,10 +96,11 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
setParent( theQgisInterface->mainWindow() );
// add internal osg plugin path if bundled osg on OS X
#ifdef QGIS_MACAPP_BUNDLE
#if QGIS_MACAPP_BUNDLE > 0
setLibraryFilePathList( QgsApplication::prefixPath() + "/QGIS_PLUGIN_SUBDIR/../osgPlugins" );
#endif
#ifdef HAVE_MACAPP_BUNDLED_OSG
if ( !QgsApplication::isRunningFromBuildDir() )
{
osgDB::Registry::instance()->setLibraryFilePathList( QDir::cleanPath( QgsApplication::pluginPath() + "/../osgPlugins" ).toStdString() );
}
#endif
mSettingsDialog = new QgsGlobePluginDialog( theQgisInterface->mainWindow(), QgisGui::ModalDialogFlags );