Skip to content
Permalink
Browse files

Disable WITH_SERVER_PLUGINS when WITH_BINDINGS=FALSE

  • Loading branch information
dmarteau committed Apr 3, 2019
1 parent 21e08c2 commit e839f277c5c15179d3776c4ba3f6b19ec2fd414c
Showing with 10 additions and 6 deletions.
  1. +5 −1 CMakeLists.txt
  2. +5 −5 src/server/services/wms/qgswmsgetlegendgraphics.cpp
@@ -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
@@ -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 );

@@ -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() );

0 comments on commit e839f27

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