xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("cimg")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/greyclab/cimg")
  4. set_description("Small and open-source C++ toolkit for image processing")
  5. set_license("CeCILL-C")
  6. add_urls("https://github.com/greyclab/cimg/archive/refs/tags/$(version).tar.gz", {version = function(version)
  7. return version:gsub("%v", "v.")
  8. end})
  9. add_urls("https://github.com/greyclab/cimg.git")
  10. add_versions("v3.2.6", "1fcca9a7a453aa278660c10d54c6db9b4c614b6a29250adeb231e95a0be209e7")
  11. if is_plat("windows") then
  12. add_syslinks("gdi32", "shell32", "user32")
  13. elseif is_plat("linux") then
  14. add_syslinks("pthread")
  15. elseif is_plat("macosx") then
  16. add_syslinks("m", "pthread")
  17. end
  18. on_install("windows", "linux", "macosx", "android", "mingw", "cygwin", "bsd", "cross", function (package)
  19. os.cp("CImg.h", package:installdir("include"))
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. int main() {
  24. cimg_library::CImg<unsigned char> img{ 128, 128, 1, 3 };
  25. img.fill(32);
  26. img.noise(128);
  27. }
  28. ]]}, {configs = {languages = "c++11", defines = "cimg_display=0"}, includes = "CImg.h"}))
  29. end)