Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[globe] Fix Mac dependencies so plugin can run from app bundle
  • Loading branch information
dakcarto committed Sep 14, 2013
1 parent e7ae5d2 commit 546b8d2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -50,5 +50,7 @@

#cmakedefine MAPSERVER_SKIP_ECW

#cmakedefine HAVE_MACAPP_BUNDLED_OSG

#endif

2 changes: 1 addition & 1 deletion mac/cmake/1osg.cmake.in
Expand Up @@ -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@)
Expand Down
4 changes: 4 additions & 0 deletions mac/cmake/1qt.cmake.in
Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/globe/globe_plugin.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 546b8d2

Please sign in to comment.