Skip to content
Permalink
Browse files

Define QGIS_MACAPP_BUNDLE in qgsconfig.h so resources can be found wh…

…en QGIS_MACAPP_BUNDLE=0
  • Loading branch information
dakcarto committed Feb 22, 2014
1 parent ececdb7 commit 30fff85703953fc9b7e48cbf27a4ae277612e13e
Showing with 9 additions and 14 deletions.
  1. +0 −4 CMakeLists.txt
  2. +6 −5 cmake_templates/qgsconfig.h.in
  3. +2 −2 src/app/main.cpp
  4. +1 −3 src/plugins/globe/globe_plugin.cpp
@@ -450,10 +450,6 @@ ELSE (WIN32)
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")
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
@@ -29,10 +29,13 @@
#define CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}"

#define QSCINTILLA_VERSION_STR "${QSCINTILLA_VERSION_STR}"
//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
#if defined( __APPLE__ )
//used by Mac to find system or bundle resources relative to amount of bundling
#define QGIS_MACAPP_BUNDLE ${QGIS_MACAPP_BUNDLE}
#endif

#define QT_PLUGINS_DIR "${QT_PLUGINS_DIR}"
#define OSG_PLUGINS_PATH "${OSG_PLUGINS_PATH}"

#cmakedefine USING_NMAKE
@@ -53,7 +56,5 @@

#cmakedefine MAPSERVER_SKIP_ECW

#cmakedefine HAVE_MACAPP_BUNDLED_OSG

#endif

@@ -858,9 +858,9 @@ int main( int argc, char *argv[] )
// Now set the paths inside the bundle
myPath += "/Contents/Plugins";
QCoreApplication::addLibraryPath( myPath );
if ( QgsApplication::isRunningFromBuildDir() )
if ( QgsApplication::isRunningFromBuildDir() || QGIS_MACAPP_BUNDLE == 0 )
{
QCoreApplication::addLibraryPath( QTPLUGINSDIR );
QCoreApplication::addLibraryPath( QT_PLUGINS_DIR );
}
//next two lines should not be needed, testing only
#if 0
@@ -111,13 +111,11 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
{
// OSG_PLUGINS_PATH value set by CMake option
QString ogsPlugins( OSG_PLUGINS_PATH );
#ifdef HAVE_MACAPP_BUNDLED_OSG
if ( !QgsApplication::isRunningFromBuildDir() )
if ( QGIS_MACAPP_BUNDLE > 0 && !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() );

0 comments on commit 30fff85

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