@@ -119,7 +119,6 @@ int main(int argc, char **argv) {
119119include_directories (${CMAKE_CURRENT_BINARY_DIR} )
120120
121121#options suported by the cmake builder
122- option (WITH_PROJ "Choose if reprojection support should be built in" ON )
123122option (WITH_PROTOBUFC "Choose if protocol buffers support should be built in (required for vector tiles)" ON )
124123option (WITH_KML "Enable native KML output support (requires libxml2 support)" OFF )
125124option (WITH_SOS "Enable SOS Server support (requires PROJ and libxml2 support)" OFF )
@@ -134,8 +133,6 @@ option(WITH_MYSQL "Choose if MYSQL joining support should be built in" OFF)
134133option (WITH_FCGI "Choose if FastCGI support should be built in" ON )
135134option (WITH_GEOS "Choose if GEOS geometry operations support should be built in" ON )
136135option (WITH_POSTGIS "Choose if Postgis input support should be built in" ON )
137- option (WITH_GDAL "Choose if GDAL input raster support should be built in" ON )
138- option (WITH_OGR "Choose if OGR/GDAL input vector support should be built in" ON )
139136option (WITH_CLIENT_WMS "Enable Client WMS Layer support (requires CURL and GDAL support)" OFF )
140137option (WITH_CLIENT_WFS "Enable Client WMS Layer support (requires CURL and OGR support)" OFF )
141138option (WITH_CURL "Enable Curl HTTP support (required for wms/wfs client, and remote SLD)" OFF )
@@ -388,17 +385,14 @@ ms_link_libraries( ${FREETYPE_LIBRARY})
388385list (APPEND ALL_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} )
389386
390387
391- if (WITH_PROJ)
392- find_package (Proj )
393- if (NOT PROJ_FOUND)
394- report_optional_not_found (PROJ )
395- else (NOT PROJ_FOUND )
396- include_directories (${PROJ_INCLUDE_DIR} )
397- ms_link_libraries ( ${PROJ_LIBRARY} )
398- list (APPEND ALL_INCLUDE_DIRS ${PROJ_INCLUDE_DIR} )
399- set (USE_PROJ 1)
400- endif (NOT PROJ_FOUND )
401- endif (WITH_PROJ )
388+ find_package (Proj )
389+ if (NOT PROJ_FOUND)
390+ report_mandatory_not_found (PROJ )
391+ endif (NOT PROJ_FOUND )
392+
393+ include_directories (${PROJ_INCLUDE_DIR} )
394+ ms_link_libraries ( ${PROJ_LIBRARY} )
395+ list (APPEND ALL_INCLUDE_DIRS ${PROJ_INCLUDE_DIR} )
402396
403397if (USE_PBF)
404398 include_directories (${PROJECT_BINARY_DIR} /renderers/mvt )
@@ -419,11 +413,7 @@ if(WITH_PIXMAN)
419413endif (WITH_PIXMAN )
420414
421415if (WITH_WMS)
422- if (USE_PROJ)
423- set (USE_WMS_SVR 1)
424- else (USE_PROJ )
425- report_dependency_error (WMS PROJ )
426- endif (USE_PROJ )
416+ set (USE_WMS_SVR 1)
427417endif (WITH_WMS )
428418
429419if (WITH_FRIBIDI)
@@ -591,17 +581,14 @@ if(WITH_POSTGIS)
591581 endif (POSTGRESQL_FOUND )
592582endif (WITH_POSTGIS )
593583
594- if (WITH_GDAL)
595- find_package (GDAL )
596- if (GDAL_FOUND)
597- include_directories (${GDAL_INCLUDE_DIR} )
598- ms_link_libraries ( ${GDAL_LIBRARY} )
599- list (APPEND ALL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR} )
600- set (USE_GDAL 1)
601- else (GDAL_FOUND )
602- report_optional_not_found (GDAL )
603- endif (GDAL_FOUND )
604- endif (WITH_GDAL )
584+ find_package (GDAL )
585+ if (NOT GDAL_FOUND)
586+ report_mandatory_not_found (GDAL )
587+ endif (NOT GDAL_FOUND )
588+
589+ include_directories (${GDAL_INCLUDE_DIR} )
590+ ms_link_libraries ( ${GDAL_LIBRARY} )
591+ list (APPEND ALL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR} )
605592
606593if (WITH_SVGCAIRO)
607594 if (WITH_RSVG)
@@ -636,25 +623,6 @@ if(WITH_RSVG)
636623 endif (RSVG_FOUND AND GOBJECT_FOUND )
637624endif (WITH_RSVG )
638625
639- if (WITH_OGR)
640- if (GDAL_FOUND)
641- set (USE_OGR 1)
642- else (GDAL_FOUND )
643- find_package (GDAL )
644- if (GDAL_FOUND)
645- include_directories (${GDAL_INCLUDE_DIR} )
646- ms_link_libraries ( ${GDAL_LIBRARY} )
647- list (APPEND ALL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR} )
648- set (USE_OGR 1)
649- else (GDAL_FOUND )
650- message (SEND_ERROR "GDAL library could not be found and is needed for OGR support.
651- HINTS:
652- - disable OGR support by adding -DWITH_OGR=0
653- - add the GDAL install directory to the CMAKE_PREFIX_PATH variable (-DCMAKE_PREFIX_PATH=\" /path/to/${component} -install-dir;/path/to/other/dirs\" " )
654- endif (GDAL_FOUND )
655- endif (GDAL_FOUND )
656- endif (WITH_OGR )
657-
658626if (WITH_CLIENT_WMS OR WITH_CLIENT_WFS)
659627 set (WITH_CURL ON )
660628endif (WITH_CLIENT_WMS OR WITH_CLIENT_WFS )
@@ -683,56 +651,19 @@ if(WITH_CLIENT_WMS OR WITH_CLIENT_WFS)
683651endif (WITH_CLIENT_WMS OR WITH_CLIENT_WFS )
684652
685653if (WITH_CLIENT_WMS)
686- if (USE_GDAL AND USE_PROJ)
687- set (USE_WMS_LYR 1)
688- else (USE_GDAL AND USE_PROJ )
689- if (NOT USE_GDAL)
690- report_dependency_error (CLIENT_WMS GDAL )
691- endif (NOT USE_GDAL )
692- if ( NOT USE_PROJ)
693- report_dependency_error (CLIENT_WMS PROJ )
694- endif (NOT USE_PROJ )
695- endif (USE_GDAL AND USE_PROJ )
654+ set (USE_WMS_LYR 1)
696655endif (WITH_CLIENT_WMS )
697656
698657if (WITH_CLIENT_WFS)
699- if (USE_OGR AND USE_PROJ)
700- set (USE_WFS_LYR 1)
701- else (USE_OGR AND USE_PROJ )
702- if (NOT USE_OGR)
703- report_dependency_error (CLIENT_WFS OGR )
704- endif (NOT USE_OGR )
705- if ( NOT USE_PROJ)
706- report_dependency_error (CLIENT_WFS PROJ )
707- endif (NOT USE_PROJ )
708- endif (USE_OGR AND USE_PROJ )
658+ set (USE_WFS_LYR 1)
709659endif (WITH_CLIENT_WFS )
710660
711661if (WITH_WFS)
712- if (USE_PROJ AND USE_OGR)
713- set (USE_WFS_SVR 1)
714- #TODO: set WFS_USE_LIBXML2 ?
715- else (USE_PROJ AND USE_OGR )
716- if ( NOT USE_OGR)
717- report_dependency_error (WFS OGR )
718- endif ( NOT USE_OGR )
719- if ( NOT USE_PROJ)
720- report_dependency_error (WFS PROJ )
721- endif ( NOT USE_PROJ )
722- endif (USE_PROJ AND USE_OGR )
662+ set (USE_WFS_SVR 1)
723663endif (WITH_WFS )
724664
725665if (WITH_WCS)
726- if (USE_PROJ AND USE_GDAL)
727- set (USE_WCS_SVR 1)
728- else (USE_PROJ AND USE_GDAL )
729- if (NOT USE_GDAL)
730- report_dependency_error (WCS GDAL )
731- endif (NOT USE_GDAL )
732- if (NOT USE_PROJ)
733- report_dependency_error (WCS PROJ )
734- endif (NOT USE_PROJ )
735- endif (USE_PROJ AND USE_GDAL )
666+ set (USE_WCS_SVR 1)
736667endif (WITH_WCS )
737668
738669if (WITH_LIBXML2)
@@ -758,20 +689,11 @@ if( USE_WFS_SVR AND NOT USE_LIBXML2 )
758689endif ( USE_WFS_SVR AND NOT USE_LIBXML2 )
759690
760691if (WITH_SOS)
761- if (NOT USE_OGR)
762- report_dependency_error (WITH_SOS OGR )
763- endif (NOT USE_OGR )
764-
765- if (USE_PROJ AND USE_LIBXML2)
692+ if (USE_LIBXML2)
766693 set (USE_SOS_SVR 1)
767- else (USE_PROJ AND USE_LIBXML2 )
768- if (NOT USE_LIBXML2)
769- report_dependency_error (SOS LIBXML2 )
770- endif (NOT USE_LIBXML2 )
771- if (NOT USE_PROJ)
772- report_dependency_error (SOS PROJ )
773- endif (NOT USE_PROJ )
774- endif (USE_PROJ AND USE_LIBXML2 )
694+ else (USE_LIBXML2 )
695+ report_dependency_error (SOS LIBXML2 )
696+ endif (USE_LIBXML2 )
775697endif (WITH_SOS )
776698
777699if (WITH_POINT_Z_M)
@@ -944,12 +866,12 @@ endmacro()
944866
945867message (STATUS "* Summary of configured options for this build" )
946868message (STATUS " * Mandatory components" )
869+ message (STATUS " * GDAL: ${GDAL_LIBRARY} " )
870+ message (STATUS " * PROJ: ${PROJ_LIBRARY} " )
947871message (STATUS " * png: ${PNG_LIBRARY} " )
948872message (STATUS " * jpeg: ${JPEG_LIBRARY} " )
949873message (STATUS " * freetype: ${FREETYPE_LIBRARY} " )
950874message (STATUS " * Optional components" )
951- status_optional_component ("GDAL" "${USE_GDAL} " "${GDAL_LIBRARY} " )
952- status_optional_component ("OGR" "${USE_OGR} " "${GDAL_LIBRARY} " )
953875status_optional_component ("GIF" "${USE_GIF} " "${GIF_LIBRARY} " )
954876status_optional_component ("MYSQL" "${USE_MYSQL} " "${MYSQL_LIBRARY} " )
955877status_optional_component ("FRIBIDI" "${USE_FRIBIDI} " "${FRIBIDI_LIBRARY} " )
@@ -959,7 +881,6 @@ status_optional_component("CAIRO" "${USE_CAIRO}" "${CAIRO_LIBRARY}")
959881status_optional_component ("SVGCAIRO" "${USE_SVG_CAIRO} " "${SVGCAIRO_LIBRARY} " )
960882status_optional_component ("RSVG" "${USE_RSVG} " "${RSVG_LIBRARY} " )
961883status_optional_component ("CURL" "${USE_CURL} " "${CURL_LIBRARY} " )
962- status_optional_component ("PROJ" "${USE_PROJ} " "${PROJ_LIBRARY} " )
963884status_optional_component ("PIXMAN" "${USE_PIXMAN} " "${PIXMAN_LIBRARY} " )
964885status_optional_component ("LIBXML2" "${USE_LIBXML2} " "${LIBXML2_LIBRARY} " )
965886status_optional_component ("POSTGIS" "${USE_POSTGIS} " "${POSTGRESQL_LIBRARY} " )
0 commit comments