Skip to content

Commit 30fff85

Browse files
committedFeb 22, 2014
Define QGIS_MACAPP_BUNDLE in qgsconfig.h so resources can be found when QGIS_MACAPP_BUNDLE=0
1 parent ececdb7 commit 30fff85

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed
 

‎CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,6 @@ ELSE (WIN32)
450450
SET (CMAKE_INSTALL_NAME_DIR ${CMAKE_BINARY_DIR}/output/lib)
451451
IF (WITH_GLOBE)
452452
SET (OSG_PLUGINS_PATH "" CACHE PATH "Path to OSG plugins for bundling")
453-
IF (QGIS_MACAPP_BUNDLE GREATER 0)
454-
# ensure OSG plugins bundled path will be used by globe plugin
455-
SET (HAVE_MACAPP_BUNDLED_OSG 1)
456-
ENDIF (QGIS_MACAPP_BUNDLE GREATER 0)
457453
ENDIF (WITH_GLOBE)
458454
# recent cmakes force SDKs, recent SDKs don't have user symlinks
459455
# need to find non-system frameworks

‎cmake_templates/qgsconfig.h.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@
2929
#define CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}"
3030

3131
#define QSCINTILLA_VERSION_STR "${QSCINTILLA_VERSION_STR}"
32-
//used by Mac to find system Qt plugins when bundle is run from build directory
33-
#define QTPLUGINSDIR "${QT_PLUGINS_DIR}"
3432

35-
//used by Mac to find system Open Scene Graph plugins when bundle is run from build directory
33+
#if defined( __APPLE__ )
34+
//used by Mac to find system or bundle resources relative to amount of bundling
35+
#define QGIS_MACAPP_BUNDLE ${QGIS_MACAPP_BUNDLE}
36+
#endif
37+
38+
#define QT_PLUGINS_DIR "${QT_PLUGINS_DIR}"
3639
#define OSG_PLUGINS_PATH "${OSG_PLUGINS_PATH}"
3740

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

5457
#cmakedefine MAPSERVER_SKIP_ECW
5558

56-
#cmakedefine HAVE_MACAPP_BUNDLED_OSG
57-
5859
#endif
5960

‎src/app/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,9 @@ int main( int argc, char *argv[] )
858858
// Now set the paths inside the bundle
859859
myPath += "/Contents/Plugins";
860860
QCoreApplication::addLibraryPath( myPath );
861-
if ( QgsApplication::isRunningFromBuildDir() )
861+
if ( QgsApplication::isRunningFromBuildDir() || QGIS_MACAPP_BUNDLE == 0 )
862862
{
863-
QCoreApplication::addLibraryPath( QTPLUGINSDIR );
863+
QCoreApplication::addLibraryPath( QT_PLUGINS_DIR );
864864
}
865865
//next two lines should not be needed, testing only
866866
#if 0

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,11 @@ GlobePlugin::GlobePlugin( QgisInterface* theQgisInterface )
111111
{
112112
// OSG_PLUGINS_PATH value set by CMake option
113113
QString ogsPlugins( OSG_PLUGINS_PATH );
114-
#ifdef HAVE_MACAPP_BUNDLED_OSG
115-
if ( !QgsApplication::isRunningFromBuildDir() )
114+
if ( QGIS_MACAPP_BUNDLE > 0 && !QgsApplication::isRunningFromBuildDir() )
116115
{
117116
// add internal osg plugin path if bundled osg
118117
ogsPlugins = QgsApplication::pluginPath() + "/../osgPlugins";
119118
}
120-
#endif
121119
if ( QFile::exists( ogsPlugins ) )
122120
{
123121
osgDB::Registry::instance()->setLibraryFilePathList( QDir::cleanPath( ogsPlugins ).toStdString() );

0 commit comments

Comments
 (0)
Please sign in to comment.