Skip to content

Commit

Permalink
Pass path to Qt plugins when Mac bundle is run from build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Nov 22, 2012
1 parent 6b3aed0 commit 2f3243d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -29,6 +29,8 @@
#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}"

#cmakedefine HAVE_POSTGRESQL

Expand Down
6 changes: 5 additions & 1 deletion src/app/main.cpp
Expand Up @@ -662,8 +662,12 @@ int main( int argc, char *argv[] )
QStringList myPathList;
QCoreApplication::setLibraryPaths( myPathList );
// Now set the paths inside the bundle
myPath += "/Contents/plugins";
myPath += "/Contents/Plugins";
QCoreApplication::addLibraryPath( myPath );
if ( QgsApplication::isRunningFromBuildDir() )
{
QCoreApplication::addLibraryPath( QTPLUGINSDIR );
}
//next two lines should not be needed, testing only
//QCoreApplication::addLibraryPath( myPath + "/imageformats" );
//QCoreApplication::addLibraryPath( myPath + "/sqldrivers" );
Expand Down

0 comments on commit 2f3243d

Please sign in to comment.