* fix boost

* improve openjpeg

* add dcmtk
pull/669/head
Hoildkv 3 years ago committed by GitHub
parent 0a9e917294
commit 2f39c823fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/b/boost/xmake.lua
  2. 66
      packages/d/dcmtk/xmake.lua
  3. 8
      packages/o/openjpeg/xmake.lua

@ -77,6 +77,9 @@ package("boost")
elseif vs_runtime == "MDd" then
linkname = linkname .. "-gd"
end
if package:version():ge("1.77.0") then
linkname = linkname .. (package:is_arch("x64") and "-x64" or "-x32")
end
package:add("links", linkname)
end
-- disable auto-link all libs

@ -0,0 +1,66 @@
package("dcmtk")
set_homepage("https://dcmtk.org/dcmtk.php.en")
set_description("DCMTK - DICOM Toolkit")
set_license("BSD-3-Clause")
add_urls("https://dicom.offis.de/download/dcmtk/dcmtk$(version).tar.gz", {version = function (version)
return version:gsub("%.", "") .. "/dcmtk-" .. version
end})
add_versions("3.6.6", "6859c62b290ee55677093cccfd6029c04186d91cf99c7642ae43627387f3458e")
local configdeps = {libtiff = "TIFF",
libpng = "PNG",
openssl = "OPENSSL",
libxml2 = "XML",
zlib = "ZLIB",
libsndfile = "SNDFILE",
libiconv = "ICONV",
icu4c = "ICU",
openjpeg = "OPENJPEG"}
for config, _ in pairs(configdeps) do
add_configs(config, {description = "Enable " .. config .. " support.", default = (config ~= "openssl" and config ~= "icu4c"), type = "boolean"})
end
add_deps("cmake")
if is_plat("windows") then
add_syslinks("ws2_32", "netapi32")
end
on_load("windows", "macosx", "linux", function (package)
for config, _ in pairs(configdeps) do
if package:config(config) then
package:add("deps", config)
end
end
if package:config("libtiff") then
package:add("deps", "libjpeg-turbo")
end
end)
on_install("windows", "macosx", "linux", function (package)
io.replace("CMake/3rdparty.cmake", "OpenJPEG QUIET", "OpenJPEG CONFIG QUIET", {plain = true})
io.replace("CMake/3rdparty.cmake", "include_directories(${LIBXML2_INCLUDE_DIR})", "include_directories(${LIBXML2_INCLUDE_DIR})\nadd_definitions(-DLIBXML_STATIC)", {plain = true})
local configs = {"-DDCMTK_USE_FIND_PACKAGE=ON", "-DDCMTK_WITH_WRAP=OFF", "-DDCMTK_WITH_DOXYGEN=OFF", "-DDCMTK_ENABLE_MANPAGES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DDCMTK_COMPILE_WIN32_MULTITHREADED_DLL=" .. (package:config("vs_runtime"):startswith("MD") and "ON" or "OFF"))
elseif package:config("pic") ~= false then
table.insert(configs, "-DDCMTK_FORCE_FPIC_ON_UNIX=ON")
end
for config, dep in pairs(configdeps) do
table.insert(configs, "-DDCMTK_WITH_" .. dep .. "=" .. (package:config(config) and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include "dcmtk/config/osconfig.h"
#include "dcmtk/ofstd/ofcmdln.h"
void test() {
OFCommandLine cmd;
cmd.setOptionColumns(20, 3);
}
]]}, {configs = {languages = "c++11"}}))
end)

@ -11,15 +11,23 @@ package("openjpeg")
add_deps("cmake")
add_deps("lcms", "libtiff", "libpng")
if is_plat("linux") then
add_syslinks("pthread")
end
on_load("windows", "linux", "macosx", function (package)
local ver = package:version():major() .. "." .. package:version():minor()
package:add("includedirs", "include/openjpeg-" .. ver)
if package:is_plat("windows") and not package:config("shared") then
package:add("defines", "OPJ_STATIC")
end
end)
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"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
import("package.tools.cmake").install(package, configs)
package:add("PATH", "bin")

Loading…
Cancel
Save