Skip to content
Permalink
Browse files

fix prefix path setting: enable running from from build directory

  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent d679255 commit 6ef3842a528feb06f50de56fa38d3877ff13eec4
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/server/qgsserver.cpp
@@ -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" );

0 comments on commit 6ef3842

Please sign in to comment.
You can’t perform that action at this time.