xmake.lua 1.2 KB

123456789101112131415161718192021222324
  1. package("libgeotiff")
  2. set_homepage("https://github.com/OSGeo/libgeotiff")
  3. set_description("Libgeotiff is an open source library for reading and writing GeoTIFF information tags")
  4. set_license("MIT")
  5. add_urls("https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-$(version).tar.gz")
  6. add_versions("1.7.1", "05ab1347aaa471fc97347d8d4269ff0c00f30fa666d956baba37948ec87e55d6")
  7. add_configs("utils", {description = "Choose if GeoTIFF utilities should be built", default = false, type = "boolean"})
  8. add_deps("cmake", "libtiff")
  9. add_deps("proj", {configs = {tiff = true}})
  10. on_install("windows", "macosx", "linux", function (package)
  11. local configs = {"-DHAVE_TIFFOPEN=1", "-DHAVE_TIFFMERGEFIELDINFO=1"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. table.insert(configs, "-DWITH_UTILITIES=" .. (package:config("utils") and "ON" or "OFF"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:has_cfuncs("GTIFNew", {includes = "geotiff.h"}))
  19. end)