Skip to content

Commit 4d3d678

Browse files
committed
introduce MAPSERVER_SKIP_ECW setting to disable ECW support in mapserver
1 parent 14f1d2c commit 4d3d678

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ SET (WITH_DESKTOP TRUE CACHE BOOL "Determines whether QGIS desktop should be bui
4343

4444
# mapserver by us disabled default because it needs FastCGI (which is optional dependency)
4545
SET (WITH_MAPSERVER FALSE CACHE BOOL "Determines whether QGIS mapserver should be built")
46+
IF(WITH_MAPSERVER)
47+
SET (MAPSERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS mapserver should disable ECW (ECW in server apps requires a special license)")
48+
ENDIF(WITH_MAPSERVER)
4649

4750
# build our version of astyle
4851
SET (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare-commit.sh (using 'our' astyle)")

cmake_templates/qgsconfig.h.in

+2
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,7 @@
4848

4949
#cmakedefine HAVE_OSGEARTHQT
5050

51+
#cmakedefine MAPSERVER_SKIP_ECW
52+
5153
#endif
5254

debian/rules

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ CMAKE_OPTS := \
4848
-D PEDANTIC=TRUE \
4949
-D WITH_QSPATIALITE=TRUE \
5050
-D WITH_MAPSERVER=TRUE \
51+
-D MAPSERVER_SKIP_ECW=TRUE \
5152
-D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
5253
-D WITH_APIDOC=TRUE
5354

ms-windows/osgeo4w/package-nightly.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ cmake -G "Visual Studio 9 2008" ^
109109
-D PEDANTIC=TRUE ^
110110
-D WITH_QSPATIALITE=TRUE ^
111111
-D WITH_MAPSERVER=TRUE ^
112+
-D MAPSERVER_SKIP_ECW=TRUE ^
112113
-D WITH_ASTYLE=TRUE ^
113114
-D WITH_GLOBE=TRUE ^
114115
-D WITH_TOUCH=TRUE ^

ms-windows/osgeo4w/package.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ cmake -G "Visual Studio 9 2008" ^
106106
-D PEDANTIC=TRUE ^
107107
-D WITH_QSPATIALITE=TRUE ^
108108
-D WITH_MAPSERVER=TRUE ^
109+
-D MAPSERVER_SKIP_ECW=TRUE ^
109110
-D WITH_GLOBE=TRUE ^
110111
-D WITH_TOUCH=TRUE ^
111112
-D WITH_ORACLE=TRUE ^

src/mapserver/qgis_map_serv.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ int main( int argc, char * argv[] )
179179
}
180180
#endif
181181

182+
#if defined(MAPSERVER_SKIP_ECW)
183+
QgsDebugMsg( "Skipping GDAL ECW drivers in server." );
184+
QgsApplication::skipGdalDriver( "ECW" );
185+
QgsApplication::skipGdalDriver( "JP2ECW" );
186+
#endif
187+
182188
QDomImplementation::setInvalidDataPolicy( QDomImplementation::DropInvalidChars );
183189

184190
// Instantiate the plugin directory so that providers are loaded

0 commit comments

Comments
 (0)