-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDartCvIOS.podspec
149 lines (130 loc) · 4.62 KB
/
DartCvIOS.podspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint DartCvIOS.podspec` to validate before publishing.
#
opencv_version = '4.11.0+0'
Pod::Spec.new do |s|
s.name = 'DartCvIOS'
s.version = '4.11.0.2'
s.summary = 'dartcv for ios'
s.description = <<-DESC
OpenCV bindings for Dart.
DESC
s.homepage = 'https://github.com/rainyl/dartcv'
s.license = { :type => 'Apache License v2.0', :file => 'LICENSE' }
# This will ensure the source files in Classes/ are included in the native
# builds of apps using this FFI plugin. Podspec does not support relative
# paths, so Classes contains a forwarder C file that relatively imports
# `../src/*` so that the C sources can be shared among all target platforms.
# s.source = { :path => '.' }
s.source = { :git => 'https://github.com/rainyl/dartcv.git', :tag => "#{s.version.to_s}" }
# s.preserve_paths = 'dartcv/**', 'libopencv/{include,lib,share}'
# s.source_files = 'include/*.h'
s.libraries = 'c++'
s.requires_arc = false
s.platform = :ios, '12.0'
s.vendored_libraries = 'libopencv/libopencv.a'
s.frameworks = [
'Accelerate', 'AssetsLibrary', 'AVFoundation',
'CoreGraphics', 'CoreImage', 'CoreMedia',
'CoreVideo', 'Foundation', 'QuartzCore',
'UIKit'
]
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64',
'HEADER_SEARCH_PATHS' => '"$(inherited)" "${PODS_TARGET_SRCROOT}/libopencv/include/opencv4"',
'USER_HEADER_SEARCH_PATHS' => [
'"$(PODS_TARGET_SRCROOT)"',
'"$(PODS_TARGET_SRCROOT)/dartcv"'
],
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_WARN_DOCUMENTATION_COMMENTS' => 'NO',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
# https://wadetregaskis.com/no-platform-load-command-found-in-libxyz-a-assuming-macos/
'OTHER_LDFLAGS' => "-Wno-unused-function"
}
s.swift_version = '5.0'
s.prepare_command = <<-CMD
if [ ! -f libopencv/libopencv.a ]; then
if [ ! -f libopencv.zip ]; then
echo "libopencv.a and libopencv.zip not found, downloading...";
curl -L "https://github.com/rainyl/opencv.full/releases/download/#{opencv_version}/libopencv-ios.zip" > libopencv.zip;
else
echo "found libopencv.zip";
fi
echo "extracting...";
unzip -q -o libopencv.zip;
echo "cleaning...";
rm -f libopencv.zip;
else
echo "found libopencv.a, continue...";
fi
CMD
s.default_subspec = [
"core", "calib3d", "contrib", "features2d", "imgproc",
"objdetect", "photo", "stitching", "video"
]
s.subspec 'core' do |ss|
ss.header_mappings_dir = '.'
ss.preserve_paths = 'dartcv/**', 'libopencv/{include,lib,share}'
ss.source_files = 'dartcv/{core,imgcodecs}/*.{h,c,cpp}'
ss.vendored_libraries = 'libopencv/libopencv.a'
end
s.subspec 'calib3d' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = "dartcv/calib3d/*.{h,c,cpp}"
ss.dependency "DartCvIOS/core"
end
s.subspec 'contrib' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/contrib/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'dnn' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/dnn/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'features2d' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/features2d/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
# s.subspec 'gapi' do |ss|
# ss.header_mappings_dir = '.'
# ss.source_files = 'dartcv/gapi/*.{h,c,cpp}'
# ss.dependency "DartCvIOS/core"
# end
s.subspec 'imgproc' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/imgproc/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'objdetect' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/objdetect/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'photo' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/photo/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'stitching' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/stitching/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'video' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/video/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
s.subspec 'videoio' do |ss|
ss.header_mappings_dir = '.'
ss.source_files = 'dartcv/videoio/*.{h,c,cpp}'
ss.dependency "DartCvIOS/core"
end
end