Add gdal-2.0 compatibility
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am trying to compile VTK with gdal 2.0 and got this compilation error:
[ 25%] Building CXX object Wrapping/Python/CMakeFiles/vtkCommonDataModelPythonD.dir/vtkPointSetPython.cxx.o
/build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx: In constructor 'vtkGDALVectorReader::Internal::Internal(const char*, int, int, int)':
/build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx:47:20: error: 'Open' is not a member of 'OGRSFDriverRegistrar'
this->Source = OGRSFDriverRegistrar::Open( srcName, srcMode, &this->Driver );
^
/build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx: In destructor 'vtkGDALVectorReader::Internal::~Internal()':
/build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx:64:22: warning: 'static void OGRDataSource::DestroyDataSource(OGRDataSource*)' is deprecated [-Wdeprecated-declarations]
OGRDataSource::DestroyDataSource( this->Source );
^
In file included from /build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx:32:0:
/usr/include/ogrsf_frmts.h:245:25: note: declared here
static void DestroyDataSource( OGRDataSource * ) OGR_DEPRECATED("Use GDALDataset class instead");
^
/build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx:64:54: warning: 'static void OGRDataSource::DestroyDataSource(OGRDataSource*)' is deprecated [-Wdeprecated-declarations]
OGRDataSource::DestroyDataSource( this->Source );
^
In file included from /build/vtk/src/VTK-6.1.0/IO/GDAL/vtkGDALVectorReader.cxx:32:0:
/usr/include/ogrsf_frmts.h:245:25: note: declared here
static void DestroyDataSource( OGRDataSource * ) OGR_DEPRECATED("Use GDALDataset class instead");
^
IO/GDAL/CMakeFiles/vtkIOGDAL.dir/build.make:72: recipe for target 'IO/GDAL/CMakeFiles/vtkIOGDAL.dir/vtkGDALVectorReader.cxx.o' failed
make[2]: *** [IO/GDAL/CMakeFiles/vtkIOGDAL.dir/vtkGDALVectorReader.cxx.o] Error 1
CMakeFiles/Makefile2:27630: recipe for target 'IO/GDAL/CMakeFiles/vtkIOGDAL.dir/all' failed
make[1]: *** [IO/GDAL/CMakeFiles/vtkIOGDAL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
gdal 2.0 changed its API http://svn.osgeo.org/gdal/trunk/gdal/MIGRATION_GUIDE.TXT and corresponding changes has to be done in VTK.
I found this thread that shows similar problem with proposed solution https://12435320936546247995.googlegroups.com/attach/cd7aca657fcbaa6/OGR.txt?part=0.1&view=1&vt=ANaJVrH7EU5Ja4C-Oo9kS4jp8SfE2IwqQ-gnWGYNWEkYeJpF23JXOewqXdkBy-8Mpt67Il-Ge3pS01p7jFeIFi9I7AaGk3acM8zcXTxt_rAQPCuo5mM2A4A
Edited by Ben Boeckel