xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. package("simage")
  2. set_homepage("https://coin3d.github.io/simage/html/")
  3. set_description("Simage is a library capable of loading, manipulating and saving images, creating and saving movies (AVI and MPEG), and loading audio.")
  4. set_license("MIT")
  5. add_urls("https://github.com/coin3d/simage/releases/download/v$(version)/simage-$(version)-src.zip")
  6. add_versions("1.8.1", "308a8712c1f28cf6e662acab2e1fdd263fbfcb11323869806f4fef435653d4d3")
  7. if is_plat("windows") then
  8. add_syslinks("gdiplus")
  9. elseif is_plat("macosx") then
  10. add_frameworks("CoreFoundation", "ApplicationServices")
  11. end
  12. add_deps("cmake", "zlib", "giflib", "libsndfile", "libpng", "libjpeg-turbo", "libtiff")
  13. on_load("windows", function (package)
  14. package:add("defines", package:config("shared") and "SIMAGE_DLL" or "SIMAGE_NOT_DLL")
  15. end)
  16. on_install("windows", "macosx", "linux", function (package)
  17. local configs = {"-DSIMAGE_BUILD_EXAMPLES=OFF", "-DSIMAGE_BUILD_TESTS=OFF", "-DSIMAGE_USE_QIMAGE=OFF"}
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  19. table.insert(configs, "-DSIMAGE_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. if package:is_plat("windows") then
  21. table.insert(configs, "-DSIMAGE_USE_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  22. end
  23. import("package.tools.cmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("simage_read_image", {includes = "simage.h"}))
  27. end)