Skip to content

Commit ca51e25

Browse files
author
telwertowski
committedJul 10, 2006
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/qgis@5580 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/gui/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,14 @@ int main(int argc, char *argv[])
369369
{
370370
QCoreApplication::setLibraryPaths(QStringList(QCoreApplication::applicationDirPath()));
371371
}
372+
373+
// If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH
374+
// is not already defined, use the GDAL plugins in the application bundle.
375+
QString gdalPlugins(QCoreApplication::applicationDirPath().append("/lib/gdalplugins"));
376+
if (QFile::exists(gdalPlugins) && !getenv("GDAL_DRIVER_PATH"))
377+
{
378+
setenv("GDAL_DRIVER_PATH", gdalPlugins, 1);
379+
}
372380
#endif
373381

374382
// Check to see if qgis was started from the source directory.

0 commit comments

Comments
 (0)
Please sign in to comment.