xmake.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  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. "https://github.com/coin3d/simage.git")
  7. add_versions("1.8.1", "308a8712c1f28cf6e662acab2e1fdd263fbfcb11323869806f4fef435653d4d3")
  8. add_versions("1.8.3", "48fd116bf8493df08729ad8468ce42d7c9c73ddbb21feff48bf6aac187294f1b")
  9. if is_plat("windows") then
  10. add_syslinks("gdiplus")
  11. elseif is_plat("macosx") then
  12. add_frameworks("CoreFoundation", "ApplicationServices")
  13. end
  14. add_deps("cmake", "zlib", "giflib", "libsndfile", "libpng", "libjpeg-turbo", "libtiff")
  15. on_load("windows", function (package)
  16. package:add("defines", package:config("shared") and "SIMAGE_DLL" or "SIMAGE_NOT_DLL")
  17. end)
  18. on_install("windows", "macosx", "linux", function (package)
  19. local configs = {"-DSIMAGE_BUILD_EXAMPLES=OFF", "-DSIMAGE_BUILD_TESTS=OFF", "-DSIMAGE_USE_QIMAGE=OFF"}
  20. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  21. table.insert(configs, "-DSIMAGE_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  22. if package:is_plat("windows") then
  23. table.insert(configs, "-DSIMAGE_USE_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  24. end
  25. import("package.tools.cmake").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("simage_read_image", {includes = "simage.h"}))
  29. end)