@ -1,6 +1,6 @@
package ( " gdal " )
set_homepage ( " https://gdal.org/ " )
set_description ( " L is a translator library for raster and vector geospatial data formats that is released under an MIT style Open Source License by the Open Source Geospatial Foundation " )
set_description ( " GDA L is a translator library for raster and vector geospatial data formats by the Open Source Geospatial Foundation" )
set_license ( " MIT " )
add_urls ( " https://github.com/OSGeo/gdal/releases/download/v$(version)/gdal-$(version).tar.gz " )
@ -12,14 +12,21 @@ package("gdal")
if is_plat ( " windows " ) then
add_syslinks ( " wsock32 " , " ws2_32 " )
end
on_install ( " windows|x86 " , " windows|x64 " , " macosx " , " linux " , function ( package )
local configs = { " -DBUILD_TESTING=OFF " , " -DGDAL_USE_EXTERNAL_LIBS=OFF " , " -DGDAL_USE_OPENJPEG=ON " ,
" -DBUILD_JAVA_BINDINGS=OFF " , " -DBUILD_CSHARP_BINDINGS=OFF " , " -DBUILD_PYTHON_BINDINGS=OFF " }
table.insert ( configs , " -DCMAKE_BUILD_TYPE= " .. ( package : debug ( ) and " Debug " or " Release " ) )
table.insert ( configs , " -DBUILD_SHARED_LIBS= " .. ( package : config ( " shared " ) and " ON " or " OFF " ) )
table.insert ( configs , " -DBUILD_APPS= " .. ( package : config ( " apps " ) and " ON " or " OFF " ) )
import ( " package.tools.cmake " ) . install ( package , configs , { packagedeps = { " openjpeg " , " proj " } } )
--fix gdal compile on msvc debug mode
local cxflags
if package : debug ( ) and package : is_plat ( " windows " ) then
cxflags = " /FS "
end
import ( " package.tools.cmake " ) . install ( package , configs ,
{ cxflags = cxflags , packagedeps = { " openjpeg " , " proj " } } )
if package : config ( " apps " ) then
package : addenv ( " PATH " , " bin " )
end