Skip to content

Commit

Permalink
fix prefix path setting: enable running from from build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent d679255 commit 6ef3842
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/server/qgsserver.cpp
Expand Up @@ -284,13 +284,16 @@ bool QgsServer::init( )
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );

//Default prefix path may be altered by environment variable
QgsApplication::init();
#if !defined(Q_OS_WIN)
// init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, true );
// Set the QGIS_PREFIX_PATH environnemnt instead of calling directly
// setPrefixPath: this will allow running server from build directory
// and get the paths accordingly
setenv( "QGIS_PREFIX_PATH", CMAKE_INSTALL_PREFIX, 1 );
#endif

//Default prefix path may be altered by environment variable
QgsApplication::init();

#if defined(SERVER_SKIP_ECW)
QgsMessageLog::logMessage( "Skipping GDAL ECW drivers in server.", "Server", QgsMessageLog::INFO );
QgsApplication::skipGdalDriver( "ECW" );
Expand Down

0 comments on commit 6ef3842

Please sign in to comment.