Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with -DOGR_ENABLE_DRIVER_GML=OFF (fixes #6647) #6648

Merged
merged 1 commit into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion frmts/ogcapi/CMakeLists.txt
@@ -1,3 +1,6 @@
add_gdal_driver(TARGET gdal_OGCAPI SOURCES gdalogcapidataset.cpp PLUGIN_CAPABLE NO_DEPS)
gdal_standard_includes(gdal_OGCAPI)
target_include_directories(gdal_OGCAPI PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gml)
if(OGR_ENABLE_DRIVER_GML)
target_include_directories(gdal_OGCAPI PRIVATE ${GDAL_VECTOR_FORMAT_SOURCE_DIR}/gml)
target_compile_definitions(gdal_OGCAPI PRIVATE -DOGR_ENABLE_DRIVER_GML)
endif()
9 changes: 9 additions & 0 deletions frmts/ogcapi/gdalogcapidataset.cpp
Expand Up @@ -33,7 +33,10 @@
#include "tilematrixset.hpp"
#include "gdal_utils.h"
#include "ogrsf_frmts.h"

#ifdef OGR_ENABLE_DRIVER_GML
#include "parsexsd.h"
#endif

#include <algorithm>
#include <memory>
Expand Down Expand Up @@ -1398,6 +1401,7 @@ GDALColorInterp OGCAPIMapWrapperBand::GetColorInterpretation()
/* ParseXMLSchema() */
/************************************************************************/

#ifdef OGR_ENABLE_DRIVER_GML
static bool ParseXMLSchema(
const std::string& osURL,
std::vector<std::unique_ptr<OGRFieldDefn>>& apoFields,
Expand Down Expand Up @@ -1442,6 +1446,7 @@ static bool ParseXMLSchema(

return false;
}
#endif

/************************************************************************/
/* InitWithTilesAPI() */
Expand Down Expand Up @@ -1648,6 +1653,7 @@ bool OGCAPIDataset::InitWithTilesAPI(GDALOpenInfo* poOpenInfo,
m_oSRS.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER);

bool bFoundSomething = false;
#ifdef OGR_ENABLE_DRIVER_GML
if( !osVectorURL.empty() && (poOpenInfo->nOpenFlags & GDAL_OF_VECTOR) != 0 )
{
const auto osVectorType = oJsonCollection.GetString("vectorType");
Expand Down Expand Up @@ -1721,6 +1727,9 @@ bool OGCAPIDataset::InitWithTilesAPI(GDALOpenInfo* poOpenInfo,

bFoundSomething = true;
}
#else
CPL_IGNORE_RET_VAL(oJsonCollection);
#endif

if( !osRasterURL.empty() && (poOpenInfo->nOpenFlags & GDAL_OF_RASTER) != 0 )
{
Expand Down
8 changes: 4 additions & 4 deletions ogr/ogrsf_frmts/CMakeLists.txt
Expand Up @@ -56,20 +56,20 @@ ogr_dependent_driver(sdts SDTS "GDAL_ENABLE_DRIVER_SDTS")
ogr_dependent_driver(gpx "GPX - GPS Exchange Format" "GDAL_USE_EXPAT")
ogr_dependent_driver(gmlas GMLAS "GDAL_USE_XERCESC;OGR_ENABLE_DRIVER_PGDUMP")
ogr_dependent_driver(svg "Scalable Vector Graphics" "GDAL_USE_EXPAT")
ogr_dependent_driver(csw CSW "GDAL_USE_CURL")
ogr_dependent_driver(csw CSW "GDAL_USE_CURL;OGR_ENABLE_DRIVER_GML")
ogr_dependent_driver(dwg DWG "GDAL_USE_TEIGHA")
ogr_dependent_driver(filegdb FileGDB "GDAL_USE_FILEGDB")
ogr_dependent_driver(libkml LibKML "GDAL_USE_LIBKML")
ogr_dependent_driver(nas "NAS/ALKIS" "GDAL_USE_XERCESC")
ogr_dependent_driver(nas "NAS/ALKIS" "GDAL_USE_XERCESC;OGR_ENABLE_DRIVER_GML")
ogr_dependent_driver(plscenes PLSCENES "GDAL_USE_CURL")
ogr_dependent_driver(sosi "SOSI:Systematic Organization of Spatial Information" "GDAL_USE_FYBA")
ogr_dependent_driver(wfs "OGC WFS service" "GDAL_USE_CURL")
ogr_dependent_driver(wfs "OGC WFS service" "GDAL_USE_CURL;OGR_ENABLE_DRIVER_GML")
ogr_dependent_driver(ngw "NextGIS Web" "GDAL_USE_CURL")
ogr_dependent_driver(elastic "ElasticSearch" "GDAL_USE_CURL")

ogr_dependent_driver(idrisi IDRISI "GDAL_ENABLE_DRIVER_IDRISI")

ogr_dependent_driver(pds "Planetary Data Systems TABLE" "GDAL_ENABLE_DRIVER_PDS")
ogr_dependent_driver(pds "Planetary Data Systems TABLE" "GDAL_ENABLE_DRIVER_PDS;OGR_ENABLE_DRIVER_GML")

# Caution: if modifying SQLite declaration here, also modify it in gdal.cmake
ogr_dependent_driver(sqlite "SQLite3 / Spatialite RDBMS" "GDAL_USE_SQLITE3")
Expand Down