xmake.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("screen_capture_lite")
  2. set_homepage("https://github.com/smasherprog/screen_capture_lite")
  3. set_description("cross platform screen/window capturing library")
  4. set_license("MIT")
  5. add_urls("https://github.com/smasherprog/screen_capture_lite/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/smasherprog/screen_capture_lite.git")
  7. add_versions("17.1.2539", "002b495f0691937c9f8046134dc3b14168904b3becf98c866a9fc6a317fe57f6")
  8. add_versions("17.1.1369", "72abf1cd9fc538e98547841ec56396ba75a36853e861f7bf721f21c64c34453e")
  9. add_versions("17.1.1368", "78b5f6c2689f49672ff465e4e832377a244455ada90d271d1cd44c3c3ecef952")
  10. add_deps("cmake", "lodepng", "tinyjpeg")
  11. if is_plat("windows") then
  12. add_syslinks("user32", "gdi32", "dwmapi", "d3d11", "dxgi")
  13. elseif is_plat("linux") then
  14. add_deps("libxtst", "libxinerama", "libx11", "libxfixes")
  15. elseif is_plat("macosx") then
  16. add_frameworks("Foundation", "CoreFoundation", "CoreGraphics", "CoreVideo", "CoreMedia", "ApplicationServices", "AVFoundation")
  17. end
  18. on_install("windows", "linux", "macosx", function (package)
  19. local configs = {"-DBUILD_EXAMPLE=OFF", "-DBUILD_CSHARP=OFF"}
  20. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  21. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  22. import("package.tools.cmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include <ScreenCapture.h>
  27. void test() {
  28. SL::Screen_Capture::CanRequestScreenCapture();
  29. SL::Screen_Capture::GetMonitors();
  30. SL::Screen_Capture::GetWindows();
  31. }
  32. ]]}, {configs = {languages = "cxx17"}}))
  33. end)