package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.1 KiB

package("openjpeg")
set_homepage("http://www.openjpeg.org/")
set_description("OpenJPEG is an open-source JPEG 2000 codec written in C language.")
set_license("BSD-2-Clause")
add_urls("https://github.com/uclouvain/openjpeg/archive/v$(version).tar.gz",
"https://github.com/uclouvain/openjpeg.git")
add_versions("2.3.1", "63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9")
add_versions("2.4.0", "8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d")
add_deps("cmake")
add_deps("lcms", "libtiff", "libpng")
on_install("windows", "linux", "macosx", function (package)
local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
os.mv(package:installdir("include", "openjpeg*", "*.h"), package:installdir("include"))
package:add("PATH", "bin")
end)
on_test(function (package)
assert(package:has_cfuncs("opj_version", {includes = "openjpeg.h"}))
end)