Skip to content

Commit

Permalink
Disable WITH_SERVER_PLUGINS when WITH_BINDINGS=FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Apr 3, 2019
1 parent 21e08c2 commit e839f27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -128,10 +128,14 @@ IF(WITH_CORE)
IF(WITH_SERVER)
SET (SERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS server should disable ECW (ECW in server apps requires a special license)")

SET (WITH_SERVER_PLUGINS TRUE CACHE BOOL "Determines whether QGIS server support for python plugins should be built")
SET (WITH_SERVER_PLUGINS ${WITH_BINDINGS} CACHE BOOL "Determines whether QGIS server support for python plugins should be built")
IF(WITH_SERVER_PLUGINS AND NOT WITH_BINDINGS)
MESSAGE(FATAL_ERROR "Server plugins are not supported without python bindings. Enable WITH_BINDINGS or disable WITH_SERVER_PLUGINS")
ENDIF(WITH_SERVER_PLUGINS AND NOT WITH_BINDINGS)
IF(WITH_SERVER_PLUGINS)
SET(HAVE_SERVER_PYTHON_PLUGINS TRUE)
ENDIF(WITH_SERVER_PLUGINS)

ENDIF(WITH_SERVER)

# Custom widgets
Expand Down
10 changes: 5 additions & 5 deletions src/server/services/wms/qgswmsgetlegendgraphics.cpp
Expand Up @@ -34,6 +34,11 @@ namespace QgsWms
// get parameters from query
QgsWmsParameters parameters( QUrlQuery( request.url() ) );

// init render context
QgsWmsRenderContext context( project, serverIface );
context.setFlag( QgsWmsRenderContext::UseScaleDenominator );
context.setParameters( parameters );

const QString format = request.parameters().value( QStringLiteral( "FORMAT" ), QStringLiteral( "PNG" ) );
ImageOutputFormat outputFormat = parseImageFormat( format );

Expand Down Expand Up @@ -76,11 +81,6 @@ namespace QgsWms
}
}
#endif
// init render context
QgsWmsRenderContext context( project, serverIface );
context.setFlag( QgsWmsRenderContext::UseScaleDenominator );
context.setParameters( parameters );

QgsRenderer renderer( context );

std::unique_ptr<QImage> result( renderer.getLegendGraphics() );
Expand Down

0 comments on commit e839f27

Please sign in to comment.