Pass path to Qt plugins when Mac bundle is run from build directory

This commit is contained in:
Larry Shaffer 2012-11-21 20:23:52 -07:00
parent 6b3aed014f
commit 2f3243d28a
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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" );