Skip to content

Commit

Permalink
Build: make the OAPIF driver independent from the WFS one, and plugin…
Browse files Browse the repository at this point in the history
… capable
  • Loading branch information
rouault committed Oct 2, 2024
1 parent 5984846 commit 579ffc7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion ogr/ogrsf_frmts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ ogr_optional_driver(avc AVC)
if (NOT(DEFINED OGR_ENABLE_DRIVER_GML AND NOT OGR_ENABLE_DRIVER_GML AND
((NOT GDAL_USE_CURL) OR
(DEFINED OGR_ENABLE_DRIVER_WFS AND NOT OGR_ENABLE_DRIVER_WFS AND
DEFINED OGR_ENABLE_DRIVER_OAPIF AND NOT OGR_ENABLE_DRIVER_OAPIF AND
DEFINED OGR_ENABLE_DRIVER_CSW AND NOT OGR_ENABLE_DRIVER_CSW))))
# Only build gmlutils if we have GML, WFS or CSW
# Only build gmlutils if we have GML, WFS, OAPIF or CSW
add_subdirectory(gmlutils)
endif()

Expand Down Expand Up @@ -108,6 +109,7 @@ 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(oapif "OGC API Features service" "GDAL_USE_CURL")
ogr_dependent_driver(ngw "NextGIS Web" "GDAL_USE_CURL")
ogr_dependent_driver(elastic "ElasticSearch" "GDAL_USE_CURL")
ogr_dependent_driver(xodr OpenDRIVE "GDAL_USE_OPENDRIVE;GDAL_USE_GEOS")
Expand Down
2 changes: 2 additions & 0 deletions ogr/ogrsf_frmts/generic/ogrregisterall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ void OGRRegisterAllInternal()
#endif
#ifdef WFS_ENABLED
RegisterOGRWFS();
#endif
#ifdef OAPIF_ENABLED
RegisterOGROAPIF();
#endif
#ifdef SOSI_ENABLED
Expand Down
8 changes: 8 additions & 0 deletions ogr/ogrsf_frmts/oapif/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
add_gdal_driver(
TARGET ogr_OAPIF
SOURCES ogroapifdriver.cpp
PLUGIN_CAPABLE
NO_DEPS
STRONG_CXX_FLAGS)
gdal_standard_includes(ogr_OAPIF)
target_include_directories(ogr_OAPIF PRIVATE $<TARGET_PROPERTY:gmlutils,SOURCE_DIR>)
File renamed without changes.
4 changes: 0 additions & 4 deletions ogr/ogrsf_frmts/wfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ add_gdal_driver(
ogrwfsdriver.cpp
ogrwfsjoinlayer.cpp
ogrwfslayer.cpp
ogroapifdriver.cpp
PLUGIN_CAPABLE
NO_DEPS)
gdal_standard_includes(ogr_WFS)
target_include_directories(ogr_WFS PRIVATE $<TARGET_PROPERTY:gmlutils,SOURCE_DIR>)
if (OGR_ENABLE_DRIVER_WFS_PLUGIN)
target_compile_definitions(ogr_WFS PRIVATE PLUGIN)
endif()
4 changes: 0 additions & 4 deletions ogr/ogrsf_frmts/wfs/ogrwfsdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,4 @@ void RegisterOGRWFS()
poDriver->pfnOpen = OGRWFSDriverOpen;

GetGDALDriverManager()->RegisterDriver(poDriver);

#ifdef PLUGIN
RegisterOGROAPIF();
#endif
}

0 comments on commit 579ffc7

Please sign in to comment.