Skip to content

Commit 4539469

Browse files
committed
introduce MAPSERVER_SKIP_ECW setting to disable ECW support in mapserver
1 parent 46355fe commit 4539469

File tree

7 files changed

+15
-0
lines changed

7 files changed

+15
-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
@@ -35,5 +35,7 @@
3535

3636
#cmakedefine HAVE_PYTHON
3737

38+
#cmakedefine MAPSERVER_SKIP_ECW
39+
3840
#endif
3941

debian/rules

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ CMAKE_OPTS := \
4040
-D PEDANTIC=TRUE \
4141
-D WITH_SPATIALITE=TRUE \
4242
-D WITH_MAPSERVER=TRUE \
43+
-D MAPSERVER_SKIP_ECW=TRUE \
4344
-D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
4445
-D WITH_APIDOC=TRUE
4546

ms-windows/osgeo4w/package-nightly.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ cmake -G "Visual Studio 9 2008" ^
9292
-D PEDANTIC=TRUE ^
9393
-D WITH_SPATIALITE=TRUE ^
9494
-D WITH_MAPSERVER=TRUE ^
95+
-D MAPSERVER_SKIP_ECW=TRUE ^
9596
-D WITH_ASTYLE=TRUE ^
9697
-D WITH_GLOBE=TRUE ^
9798
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^

ms-windows/osgeo4w/package.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ cmake -G "Visual Studio 9 2008" ^
9292
-D PEDANTIC=TRUE ^
9393
-D WITH_SPATIALITE=TRUE ^
9494
-D WITH_MAPSERVER=TRUE ^
95+
-D MAPSERVER_SKIP_ECW=TRUE ^
9596
-D WITH_GLOBE=TRUE ^
9697
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
9798
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^

ms-windows/osgeo4w/package64.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%
102102
cmake -G "Visual Studio 10 Win64" ^
103103
-D PEDANTIC=TRUE ^
104104
-D WITH_MAPSERVER=TRUE ^
105+
-D MAPSERVER_SKIP_ECW=TRUE ^
105106
-D WITH_GLOBE=FALSE ^
106107
-D WITH_TOUCH=TRUE ^
107108
-D WITH_GRASS=TRUE ^

src/mapserver/qgis_map_serv.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ int main( int argc, char * argv[] )
165165
}
166166
#endif
167167

168+
#if defined(MAPSERVER_SKIP_ECW)
169+
QgsDebugMsg( "Skipping GDAL ECW drivers in server." );
170+
QgsApplication::skipGdalDriver( "ECW" );
171+
QgsApplication::skipGdalDriver( "JP2ECW" );
172+
#endif
173+
168174
// Instantiate the plugin directory so that providers are loaded
169175
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
170176
QgsDebugMsg( "Prefix PATH: " + QgsApplication::prefixPath() );

0 commit comments

Comments
 (0)