@@ -8,26 +8,76 @@ package("pangolin")
88
99 add_versions (" v0.9.4" , " fb95a354dc64bb151881192703db461a59089f7bcdb2c2c9185cfb5393586d97" )
1010
11+ add_configs (" libpng" , { description = " Build support for libpng image input" , default = false , type = " boolean" })
12+ add_configs (" libjpeg" , { description = " Build support for libjpeg image input" , default = false , type = " boolean" })
13+ add_configs (" libtiff" , { description = " Build support for libtiff image input" , default = false , type = " boolean" })
14+ add_configs (" openexr" , { description = " Build support for OpenEXR image input" , default = false , type = " boolean" })
15+ add_configs (" lz4" , { description = " Build support for lz4 compression" , default = false , type = " boolean" })
16+ add_configs (" zstd" , { description = " Build support for zstd compression" , default = false , type = " boolean" })
17+ add_configs (" libraw" , { description = " Build support for libraw (raw images)" , default = false , type = " boolean" })
18+
19+ add_configs (" libdc1394" , { description = " Build support for libdc1394 video input" , default = false , type = " boolean" })
20+ add_configs (" v4l" , { description = " Build support for V4L video input (Linux only)" , default = false , type = " boolean" })
21+ add_configs (" ffmpeg" , { description = " Build support for ffmpeg video input" , default = false , type = " boolean" })
22+ add_configs (" realsense" , { description = " Build support for RealSense video input" , default = false , type = " boolean" })
23+ add_configs (" realsense2" , { description = " Build support for RealSense2 video input" , default = false , type = " boolean" })
24+ add_configs (" openni" , { description = " Build support for OpenNI video input" , default = false , type = " boolean" })
25+ add_configs (" openni2" , { description = " Build support for OpenNI2 video input" , default = false , type = " boolean" })
26+ add_configs (" libuvc" , { description = " Build support for libuvc video input" , default = false , type = " boolean" })
27+ add_configs (" uvc_mediafoundation" , { description = " Build support for MediaFoundation UVC input (Windows)" , default = false , type = " boolean" })
28+ add_configs (" depthsense" , { description = " Build support for DepthSense video input" , default = false , type = " boolean" })
29+ add_configs (" telicam" , { description = " Build support for TeliCam video input" , default = false , type = " boolean" })
30+ add_configs (" pleora" , { description = " Build support for Pleora video input" , default = false , type = " boolean" })
31+
1132 add_configs (" tools" , {description = " Build tools" , default = false , type = " boolean" })
1233
1334 if is_plat (" linux" , " bsd" ) then
1435 add_syslinks (" pthread" , " rt" )
1536 elseif is_plat (" windows" , " mingw" ) then
1637 add_syslinks (" shlwapi" , " gdi32" , " user32" , " shell32" )
1738 elseif is_plat (" macosx" ) then
18- add_frameworks (" Cocoa" )
39+ add_frameworks (" Cocoa" , " OpenGL " )
1940 end
2041
2142 add_deps (" cmake" )
2243 add_deps (" eigen" )
23- if not is_plat (" wasm" , " linux" ) then
24- add_deps (" glew" )
25- elseif is_plat (" linux" ) then
44+ if is_plat (" linux" ) then
2645 add_deps (" libepoxy" )
46+ elseif not is_plat (" wasm" ) then
47+ add_deps (" glew" )
2748 end
2849 -- TODO: unbundle sigslot tinyobjloader
50+ local deps = {
51+ " libpng" ,
52+ " libjpeg" ,
53+ " libtiff" ,
54+ " openexr" ,
55+ " lz4" ,
56+ " zstd" ,
57+ " libraw" ,
58+
59+ " libdc1394" ,
60+ " v4l" ,
61+ " ffmpeg" ,
62+ " realsense" ,
63+ " realsense2" ,
64+ " openni" ,
65+ " openni2" ,
66+ " libuvc" ,
67+ " uvc_mediafoundation" ,
68+ " depthsense" ,
69+ " telicam" ,
70+ " pleora" ,
71+ }
2972
3073 on_load (function (package )
74+ for _ , dep in ipairs (deps ) do
75+ if package :config (dep ) then
76+ package :add (" deps" , dep )
77+ end
78+ end
79+
80+ package :add (" defines" , " HAVE_EIGEN" )
3181 if package :is_plat (" windows" ) then
3282 package :add (" defines" , " _WIN_" )
3383 elseif package :is_plat (" linux" ) then
@@ -48,14 +98,26 @@ package("pangolin")
4898 end )
4999
50100 on_install (" windows" , " linux" , " macosx" , " mingw" , " msys" , " wasm" , function (package )
51- local configs = {" -DBUILD_EXAMPLES=OFF" }
101+ io .replace (" CMakeLists.txt" , " -Werror=vla" , " " , {plain = true })
102+ io .replace (" CMakeLists.txt" , " -Werror" , " " , {plain = true })
103+
104+ local configs = {" -DBUILD_EXAMPLES=OFF" , " -DBUILD_PANGOLIN_PYTHON=OFF" }
52105 table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
53106 table.insert (configs , " -DBUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
107+ if package :is_plat (" windows" ) and package :is_debug () and package :config (" shared" ) then
108+ table.insert (configs , " -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=" )
109+ end
110+
111+ for _ , dep in ipairs (deps ) do
112+ if package :config (dep ) then
113+ table.insert (configs , format (" -DBUILD_PANGOLIN_%s=%s" , dep :upper (), (package :config (dep ) and " ON" or " OFF" )))
114+ end
115+ end
54116 table.insert (configs , " -DBUILD_TOOLS=" .. (package :config (" tools" ) and " ON" or " OFF" ))
55117
56118 local opt = {}
57119 local glew = package :dep (" glew" )
58- if glew and not glew :config (" shared" ) then
120+ if glew and not glew :config (" shared" ) and package : is_plat ( " windows " , " mingw " ) then
59121 opt .cxflags = " -DGLEW_STATIC"
60122 end
61123 import (" package.tools.cmake" ).install (package , configs , opt )
0 commit comments