Skip to content

Commit e5e80b0

Browse files
author
mhugent
committed
Possibility to set prefix path for mapserver by environment variable
git-svn-id: http://svn.osgeo.org/qgis/trunk@14303 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 235ac00 commit e5e80b0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/mapserver/qgis_map_serv.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,19 @@ int main( int argc, char * argv[] )
125125

126126
QgsApplication qgsapp( argc, argv, false );
127127

128-
// init QGIS's paths - true means that all path will be inited from prefix
129-
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
128+
//Default prefix path may be altered by environment variable
129+
char* prefixPath = getenv( "QGIS_PREFIX_PATH" );
130+
if ( prefixPath )
131+
{
132+
QgsApplication::setPrefixPath( prefixPath, TRUE );
133+
}
134+
else
135+
{
136+
// init QGIS's paths - true means that all path will be inited from prefix
137+
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
138+
}
139+
140+
130141

131142
// Instantiate the plugin directory so that providers are loaded
132143
QgsProviderRegistry::instance( QgsApplication::pluginPath() );

0 commit comments

Comments
 (0)