Skip to content

Commit 2f3243d

Browse files
committed
Pass path to Qt plugins when Mac bundle is run from build directory
1 parent 6b3aed0 commit 2f3243d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmake_templates/qgsconfig.h.in

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
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}"
3234

3335
#cmakedefine HAVE_POSTGRESQL
3436

src/app/main.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,12 @@ int main( int argc, char *argv[] )
662662
QStringList myPathList;
663663
QCoreApplication::setLibraryPaths( myPathList );
664664
// Now set the paths inside the bundle
665-
myPath += "/Contents/plugins";
665+
myPath += "/Contents/Plugins";
666666
QCoreApplication::addLibraryPath( myPath );
667+
if ( QgsApplication::isRunningFromBuildDir() )
668+
{
669+
QCoreApplication::addLibraryPath( QTPLUGINSDIR );
670+
}
667671
//next two lines should not be needed, testing only
668672
//QCoreApplication::addLibraryPath( myPath + "/imageformats" );
669673
//QCoreApplication::addLibraryPath( myPath + "/sqldrivers" );

0 commit comments

Comments
 (0)