From 09d82770085d03255027030199d0671e4428f4a8 Mon Sep 17 00:00:00 2001 From: telwertowski Date: Mon, 10 Jul 2006 06:58:03 +0000 Subject: [PATCH] For Mac OS X, if the GDAL plugins are bundled with the application, set an environment variable to search the bundle before searching the GDAL prefix path hardcoded into the library. git-svn-id: http://svn.osgeo.org/qgis/trunk@5580 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/gui/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index ba741c88aebf..92d27a0829ba 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -369,6 +369,14 @@ int main(int argc, char *argv[]) { QCoreApplication::setLibraryPaths(QStringList(QCoreApplication::applicationDirPath())); } + + // If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH + // is not already defined, use the GDAL plugins in the application bundle. + QString gdalPlugins(QCoreApplication::applicationDirPath().append("/lib/gdalplugins")); + if (QFile::exists(gdalPlugins) && !getenv("GDAL_DRIVER_PATH")) + { + setenv("GDAL_DRIVER_PATH", gdalPlugins, 1); + } #endif // Check to see if qgis was started from the source directory.