xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  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.4.0", "987bddc3a98ec684c2ffc7968881adb2626f5b09c90e6102947b3c4acd0de931")
  11. add_versions("v3.3.6", "7bb6621c38458152f3d1cae3f020e4ca6a314076cb7b4b5d6bbf324ad3d0ab88")
  12. add_versions("v3.2.6", "1fcca9a7a453aa278660c10d54c6db9b4c614b6a29250adeb231e95a0be209e7")
  13. if is_plat("windows") then
  14. add_syslinks("gdi32", "shell32", "user32")
  15. elseif is_plat("linux") then
  16. add_syslinks("pthread")
  17. elseif is_plat("macosx") then
  18. add_syslinks("m", "pthread")
  19. end
  20. on_install("windows", "linux", "macosx", "android", "mingw", "cygwin", "bsd", "cross", function (package)
  21. os.cp("CImg.h", package:installdir("include"))
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. int main() {
  26. cimg_library::CImg<unsigned char> img{ 128, 128, 1, 3 };
  27. img.fill(32);
  28. img.noise(128);
  29. }
  30. ]]}, {configs = {languages = "c++11", defines = "cimg_display=0"}, includes = "CImg.h"}))
  31. end)