set ( SB_PROJECT GDAL )
SETUP_SUPERBUILD( PROJECT ${SB_PROJECT} )

set( GDAL_MAJOR 2 )
set( GDAL_MINOR 2 )
set( GDAL_BUILD 0 )
set( GDAL_VERSION "${GDAL_MAJOR}.${GDAL_MINOR}.${GDAL_BUILD}" )

ExternalProject_Add(
    ${SB_PROJECT}
    PREFIX  ${SB_PROJECT}
    DEPENDS GEOS
    URL "http://download.osgeo.org/gdal/${GDAL_VERSION}/gdal${GDAL_MAJOR}${GDAL_MINOR}${GDAL_BUILD}.zip"
    URL_MD5 784333109a92b49efd299caa181064e3
    INSTALL_DIR ${SB_INSTALL_DIR}
    CONFIGURE_COMMAND LD_LIBRARY_PATH=${SB_INSTALL_DIR}/lib <SOURCE_DIR>/configure --prefix=${SB_INSTALL_DIR} --with-geos=${SB_INSTALL_DIR}/bin/geos-config
    BUILD_IN_SOURCE 1
    BUILD_COMMAND $(MAKE)
    INSTALL_COMMAND $(MAKE) install
)
