From eb6301e023e8cfa9d83fbbfc6ca5797b62d8d535 Mon Sep 17 00:00:00 2001 From: Radim Blazek Date: Wed, 12 Jul 2017 17:51:03 +0200 Subject: [PATCH] [GRASS] remove GRASS 6 support --- CMakeLists.txt | 19 +-- cmake/FindGRASS.cmake | 17 +- debian/rules | 5 - ms-windows/osgeo4w/package-nightly.cmd | 1 - ms-windows/osgeo4w/package.cmd | 1 - src/plugins/grass/modules/db.in.ogr.qgm | 3 +- src/plugins/grass/modules/db.out.ogr.qgm | 6 +- src/plugins/grass/modules/db.select.qgm | 3 +- .../modules/g.region.multiple.raster.qgm | 3 +- .../modules/g.region.multiple.vector.qgm | 3 +- src/plugins/grass/modules/i.fft.qgm | 10 +- src/plugins/grass/modules/i.his.rgb.qgm | 18 +-- src/plugins/grass/modules/i.ifft.qgm | 9 +- src/plugins/grass/modules/i.image.mosaic.qgm | 8 +- src/plugins/grass/modules/i.in.spotvgt.qgm | 6 +- src/plugins/grass/modules/i.oif.qgm | 10 +- src/plugins/grass/modules/i.rgb.his.qgm | 18 +-- src/plugins/grass/modules/i.tasscap4.qgm | 14 +- src/plugins/grass/modules/i.tasscap5.qgm | 14 +- src/plugins/grass/modules/i.tasscap7.qgm | 14 +- src/plugins/grass/modules/m.cogo.qgm | 3 +- src/plugins/grass/modules/m.proj.qgm | 6 +- src/plugins/grass/modules/r.basins.fill.qgm | 9 +- src/plugins/grass/modules/r.carve.qgm | 6 +- src/plugins/grass/modules/r.circle.qgm | 6 +- src/plugins/grass/modules/r.coin.qgm | 6 +- src/plugins/grass/modules/r.colors.stddev.qgm | 3 +- src/plugins/grass/modules/r.composite.qgm | 9 +- src/plugins/grass/modules/r.cost.coord.qgm | 8 +- src/plugins/grass/modules/r.cost.rast.qgm | 8 +- src/plugins/grass/modules/r.cost.vect.qgm | 4 +- src/plugins/grass/modules/r.describe.qgm | 6 +- src/plugins/grass/modules/r.distance.qgm | 14 +- src/plugins/grass/modules/r.drain.qgm | 4 +- src/plugins/grass/modules/r.fill.dir.qgm | 8 +- src/plugins/grass/modules/r.his.qgm | 24 +-- src/plugins/grass/modules/r.in.ascii.qgm | 16 +- src/plugins/grass/modules/r.in.wms.qgm | 36 ++--- src/plugins/grass/modules/r.in.xyz.qgm | 4 +- src/plugins/grass/modules/r.info.qgm | 2 +- src/plugins/grass/modules/r.lake.seed.qgm | 8 +- src/plugins/grass/modules/r.lake.xy.qgm | 12 +- src/plugins/grass/modules/r.out.ascii.qgm | 8 +- src/plugins/grass/modules/r.out.mpeg.qgm | 4 +- src/plugins/grass/modules/r.out.pov.qgm | 8 +- src/plugins/grass/modules/r.out.ppm.qgm | 4 +- src/plugins/grass/modules/r.out.vrml.qgm | 8 +- src/plugins/grass/modules/r.out.vtk.qgm | 12 +- src/plugins/grass/modules/r.out.xyz.qgm | 4 +- src/plugins/grass/modules/r.param.scale.qgm | 4 +- src/plugins/grass/modules/r.plane.qgm | 4 +- src/plugins/grass/modules/r.random.qgm | 8 +- src/plugins/grass/modules/r.random.raster.qgm | 8 +- .../grass/modules/r.reclass.area.greater.qgm | 6 +- .../grass/modules/r.reclass.area.lesser.qgm | 6 +- .../grass/modules/r.regression.line.qgm | 8 +- src/plugins/grass/modules/r.resamp.rst.qgm | 4 +- src/plugins/grass/modules/r.stats.qgm | 8 +- src/plugins/grass/modules/r.surf.area.qgm | 6 +- src/plugins/grass/modules/r.surf.fractal.qgm | 12 +- src/plugins/grass/modules/r.texture.bis.qgm | 20 +-- src/plugins/grass/modules/r.texture.qgm | 20 +-- src/plugins/grass/modules/r.to.vect.area.qgm | 4 +- src/plugins/grass/modules/r.to.vect.line.qgm | 4 +- src/plugins/grass/modules/r.to.vect.point.qgm | 4 +- src/plugins/grass/modules/r.volume.qgm | 4 +- src/plugins/grass/modules/r.walk.coord.qgm | 8 +- src/plugins/grass/modules/r.walk.vect.qgm | 4 +- src/plugins/grass/modules/r.water.outlet.qgm | 14 +- .../grass/modules/r.what.coordinates.qgm | 18 +-- src/plugins/grass/modules/v.buffer.qgm | 4 +- .../grass/modules/v.clean.chdangles.qgm | 4 +- src/plugins/grass/modules/v.clean.prune.qgm | 4 +- src/plugins/grass/modules/v.clean.rmarea.qgm | 4 +- .../grass/modules/v.clean.rmdangles.qgm | 4 +- src/plugins/grass/modules/v.clean.snap.qgm | 4 +- src/plugins/grass/modules/v.db.join.qgm | 8 +- src/plugins/grass/modules/v.db.select.qgm | 8 +- .../grass/modules/v.db.select.where.qgm | 8 +- src/plugins/grass/modules/v.db.univar.qgm | 8 +- src/plugins/grass/modules/v.db.update_op.qgm | 4 +- .../grass/modules/v.db.update_op_query.qgm | 4 +- src/plugins/grass/modules/v.drape.qgm | 4 +- src/plugins/grass/modules/v.extract.list.qgm | 4 +- src/plugins/grass/modules/v.extrude.attr.qgm | 4 +- src/plugins/grass/modules/v.generalize.qgm | 2 +- src/plugins/grass/modules/v.hull.qgm | 4 +- src/plugins/grass/modules/v.in.ascii.qgm | 4 +- src/plugins/grass/modules/v.in.e00.qgm | 8 +- .../grass/modules/v.in.ogr.all.loc.qgm | 8 +- src/plugins/grass/modules/v.in.ogr.all.qgm | 8 +- src/plugins/grass/modules/v.in.ogr.loc.qgm | 8 +- .../grass/modules/v.in.ogr.qgis.loc.qgm | 8 +- src/plugins/grass/modules/v.in.ogr.qgis.qgm | 8 +- src/plugins/grass/modules/v.in.ogr.qgm | 8 +- src/plugins/grass/modules/v.info.qgm | 2 +- src/plugins/grass/modules/v.kcv.qgm | 10 +- src/plugins/grass/modules/v.kernel.qgm | 8 +- src/plugins/grass/modules/v.net.alloc.qgm | 12 +- src/plugins/grass/modules/v.net.iso.qgm | 12 +- src/plugins/grass/modules/v.net.nodes.qgm | 8 +- src/plugins/grass/modules/v.net.path.qgm | 20 +-- src/plugins/grass/modules/v.net.qgm | 14 +- src/plugins/grass/modules/v.net.salesman.qgm | 12 +- src/plugins/grass/modules/v.net.steiner.qgm | 12 +- .../grass/modules/v.net.visibility.qgm | 8 +- src/plugins/grass/modules/v.out.ascii.qgm | 4 +- src/plugins/grass/modules/v.out.ogr.gml.qgm | 8 +- .../grass/modules/v.out.ogr.mapinfo.qgm | 4 +- src/plugins/grass/modules/v.out.ogr.qgm | 8 +- src/plugins/grass/modules/v.out.vtk.qgm | 4 +- src/plugins/grass/modules/v.outlier.qgm | 18 +-- src/plugins/grass/modules/v.random.3d.qgm | 6 +- src/plugins/grass/modules/v.random.qgm | 4 +- src/plugins/grass/modules/v.rast.stats.qgm | 8 +- src/plugins/grass/modules/v.sample.qgm | 6 +- src/plugins/grass/modules/v.segment.qgm | 8 +- src/plugins/grass/modules/v.support.qgm | 4 +- src/plugins/grass/modules/v.surf.bspline.qgm | 16 +- src/plugins/grass/modules/v.surf.rst.qgm | 36 ++--- src/plugins/grass/modules/v.to.db.qgm | 4 +- src/plugins/grass/modules/v.to.points.qgm | 8 +- src/plugins/grass/modules/v.to.rast.attr.qgm | 4 +- src/plugins/grass/modules/v.type.bl.qgm | 6 +- src/plugins/grass/modules/v.type.cp.qgm | 6 +- src/plugins/grass/modules/v.type.lb.qgm | 6 +- src/plugins/grass/modules/v.type.pc.qgm | 6 +- src/plugins/grass/modules/v.what.rast.qgm | 8 +- src/plugins/grass/modules/v.what.vect.qgm | 16 +- src/plugins/grass/qgsgrassmodule.cpp | 8 - src/plugins/grass/qgsgrassmoduleinput.cpp | 10 -- src/plugins/grass/qgsgrassmoduleinput.h | 4 - src/plugins/grass/qgsgrassmoduleoptions.cpp | 8 - src/plugins/grass/qgsgrassmoduleparam.cpp | 11 -- src/plugins/grass/qgsgrassnewmapset.cpp | 4 - src/plugins/grass/qgsgrassplugin.cpp | 9 -- src/plugins/grass/qgsgrassselect.cpp | 5 - src/plugins/grass/qgsgrasstools.cpp | 5 +- src/providers/grass/qgis.d.rast.c | 60 ++----- src/providers/grass/qgis.g.info.c | 129 ++++----------- src/providers/grass/qgis.r.in.cpp | 53 ++----- src/providers/grass/qgis.v.in.cpp | 9 -- src/providers/grass/qgsgrass.cpp | 147 +++--------------- src/providers/grass/qgsgrass.h | 18 --- .../grass/qgsgrassfeatureiterator.cpp | 16 +- src/providers/grass/qgsgrassgislib.cpp | 12 -- src/providers/grass/qgsgrassprovider.cpp | 22 +-- .../grass/qgsgrassprovidermodule.cpp | 4 - src/providers/grass/qgsgrassrasterprovider.h | 2 - src/providers/grass/qgsgrassvector.cpp | 5 - src/providers/grass/qgsgrassvectormap.cpp | 16 -- .../grass/qgsgrassvectormaplayer.cpp | 5 - src/providers/grass/qgsgrassvectormaplayer.h | 5 - .../providers/grass/testqgsgrassprovider.cpp | 8 +- 154 files changed, 576 insertions(+), 1063 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af5fe04ab9e..2710829faee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,19 +38,16 @@ SET (WITH_CORE TRUE CACHE BOOL "Determines whether QGIS core should be built.") MARK_AS_ADVANCED(WITH_CORE) IF(WITH_CORE) - # try to configure and build GRASS plugin by default - FOREACH (GRASS_SEARCH_VERSION 6 7) - # For GRASS 6 are used cached variables without version suffix so that existing caches don't have to be reconfigured. - # Cached variables: WITH_GRASS, WITH_GRASS7, GRASS_PREFIX, GRASS_PREFIX7, GRASS_INCLUDE_DIR, GRASS_INCLUDE_DIR7 + # Only GRASS 7 is currently supported but we keep dual version support in cmake for possible future switch to GRASS 8. + # Try to configure and build GRASS plugin by default + FOREACH (GRASS_SEARCH_VERSION 7) + # Legacy note: + # For GRASS 6 there were used cached variables without version suffix so that existing caches didn't have to be reconfigured. + # Cached variables were: WITH_GRASS, WITH_GRASS7, GRASS_PREFIX, GRASS_PREFIX7, GRASS_INCLUDE_DIR, GRASS_INCLUDE_DIR7 # Everywhere else each variable has version major appended. - # Normal variables: GRASS_FOUND6, GRASS_FOUND7, GRASS_MAJOR_VERSION6, GRASS_MAJOR_VERSION7, etc. + # Normal variables were: GRASS_FOUND6, GRASS_FOUND7, GRASS_MAJOR_VERSION6, GRASS_MAJOR_VERSION7, etc. # In addition there is also GRASS_FOUND, which is TRUE if at least one version of GRASS was found - IF (GRASS_SEARCH_VERSION EQUAL 6) - SET (GRASS_CACHE_VERSION "") - ELSE (GRASS_SEARCH_VERSION EQUAL 6) - SET (GRASS_CACHE_VERSION ${GRASS_SEARCH_VERSION}) - ENDIF (GRASS_SEARCH_VERSION EQUAL 6) - + SET (GRASS_CACHE_VERSION ${GRASS_SEARCH_VERSION}) SET (WITH_GRASS${GRASS_CACHE_VERSION} TRUE CACHE BOOL "Determines whether GRASS ${GRASS_SEARCH_VERSION} plugin should be built") IF (WITH_GRASS${GRASS_CACHE_VERSION}) FIND_PACKAGE(GRASS ${GRASS_SEARCH_VERSION}) diff --git a/cmake/FindGRASS.cmake b/cmake/FindGRASS.cmake index 64cfebbe27f..346c78a5be0 100644 --- a/cmake/FindGRASS.cmake +++ b/cmake/FindGRASS.cmake @@ -137,12 +137,6 @@ MACRO (CHECK_GRASS G_PREFIX) SET(GRASS_FOUND TRUE) # GRASS_FOUND is true if at least one version was found SET(GRASS_PREFIX${GRASS_CACHE_VERSION} ${G_PREFIX}) CHECK_GRASS_EXTRA_INCLUDE_DIRS(${GRASS_FIND_VERSION}) - IF(GRASS_FIND_VERSION EQUAL 6) - # Set also normal variable with number - SET(GRASS_INCLUDE_DIR${GRASS_FIND_VERSION} ${GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION}}) - SET(GRASS_PREFIX${GRASS_FIND_VERSION} ${G_PREFIX}) - CHECK_GRASS_EXTRA_INCLUDE_DIRS(${GRASS_FIND_VERSION}) - ENDIF(GRASS_FIND_VERSION EQUAL 6) ENDIF(GRASS_LIBRARIES_FOUND${GRASS_FIND_VERSION}) ENDIF(GRASS_MAJOR_VERSION${GRASS_FIND_VERSION} EQUAL GRASS_FIND_VERSION) ENDIF(GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION} AND EXISTS ${GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION}}/grass/version.h) @@ -164,20 +158,13 @@ IF (WIN32) ENDIF (WIN32) IF (UNIX) - IF (GRASS_FIND_VERSION EQUAL 6) - LIST(APPEND GRASS_PATHS /usr/lib64/grass64 /usr/lib/grass64) - ELSEIF (GRASS_FIND_VERSION EQUAL 7) + IF (GRASS_FIND_VERSION EQUAL 7) LIST(APPEND GRASS_PATHS /usr/lib64/grass70 /usr/lib/grass70 /usr/lib64/grass71 /usr/lib/grass71 /usr/lib64/grass72 /usr/lib/grass72) ENDIF () ENDIF (UNIX) IF (APPLE) - IF (GRASS_FIND_VERSION EQUAL 6) - LIST(APPEND GRASS_PATHS - /Applications/GRASS-6.3.app/Contents/MacOS - /Applications/GRASS-6.4.app/Contents/MacOS - ) - ELSEIF (GRASS_FIND_VERSION EQUAL 7) + IF (GRASS_FIND_VERSION EQUAL 7) LIST(APPEND GRASS_PATHS /Applications/GRASS-7.0.app/Contents/MacOS /Applications/GRASS-7.1.app/Contents/MacOS diff --git a/debian/rules b/debian/rules index 95ae406ad06..d831ab74c73 100755 --- a/debian/rules +++ b/debian/rules @@ -85,11 +85,6 @@ ifeq ($(GRASSVER),7) -DWITH_GRASS=TRUE \ -DWITH_GRASS7=TRUE \ -DGRASS_PREFIX7=/usr/lib/$(GRASS) -else - CMAKE_OPTS += \ - -DWITH_GRASS=TRUE \ - -DWITH_GRASS6=TRUE \ - -DGRASS_PREFIX=/usr/lib/$(GRASS) endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) diff --git a/ms-windows/osgeo4w/package-nightly.cmd b/ms-windows/osgeo4w/package-nightly.cmd index b557c0f0fb4..8cbcdb71bbb 100644 --- a/ms-windows/osgeo4w/package-nightly.cmd +++ b/ms-windows/osgeo4w/package-nightly.cmd @@ -165,7 +165,6 @@ cmake -G Ninja ^ -D WITH_SERVER=TRUE ^ -D SERVER_SKIP_ECW=TRUE ^ -D WITH_GRASS=TRUE ^ - -D WITH_GRASS6=FALSE ^ -D WITH_GRASS7=TRUE ^ -D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^ -D WITH_GLOBE=FALSE ^ diff --git a/ms-windows/osgeo4w/package.cmd b/ms-windows/osgeo4w/package.cmd index 5f86770a290..65173865b1f 100644 --- a/ms-windows/osgeo4w/package.cmd +++ b/ms-windows/osgeo4w/package.cmd @@ -158,7 +158,6 @@ cmake -G Ninja ^ -D WITH_SERVER=TRUE ^ -D SERVER_SKIP_ECW=TRUE ^ -D WITH_GRASS=TRUE ^ - -D WITH_GRASS6=FALSE ^ -D WITH_GRASS7=TRUE ^ -D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^ -D WITH_GLOBE=FALSE ^ diff --git a/src/plugins/grass/modules/db.in.ogr.qgm b/src/plugins/grass/modules/db.in.ogr.qgm index 9bbb042e1d2..1019cc377b4 100644 --- a/src/plugins/grass/modules/db.in.ogr.qgm +++ b/src/plugins/grass/modules/db.in.ogr.qgm @@ -2,7 +2,6 @@ - - + diff --git a/src/plugins/grass/modules/db.out.ogr.qgm b/src/plugins/grass/modules/db.out.ogr.qgm index ef1e5c744c0..2997faf0111 100644 --- a/src/plugins/grass/modules/db.out.ogr.qgm +++ b/src/plugins/grass/modules/db.out.ogr.qgm @@ -3,9 +3,7 @@ diff --git a/src/plugins/grass/modules/db.select.qgm b/src/plugins/grass/modules/db.select.qgm index c5127c92481..3c6e70c7232 100644 --- a/src/plugins/grass/modules/db.select.qgm +++ b/src/plugins/grass/modules/db.select.qgm @@ -6,6 +6,5 @@