xmake.lua 1.8 KB

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