-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathPackage.swift
51 lines (49 loc) · 1.78 KB
/
Package.swift
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
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "OpenCV",
platforms: [
.macOS(.v10_12), .iOS(.v9),
],
products: [
.library(
name: "OpenCV",
targets: ["OpenCV"]),
],
dependencies: [],
targets: [
.target(
name: "OpenCV",
dependencies: ["opencv2"],
path: "opencv/modules/core/misc/objc/swift-package-manager/Sources",
linkerSettings: [
.linkedLibrary("c++"),
.linkedFramework("Accelerate"),
.linkedFramework("OpenCL", .when(platforms: [.macOS]))
]
),
// Recompute checksum via `swift package --package-path /path/to/opencv compute-checksum /path/to/opencv2.xcframework.zip`
.binaryTarget(
name: "opencv2",
url: "https://github.com/Rightpoint/opencv/releases/download/4.5.1/opencv2-4.5.1-dynamic.xcframework.zip",
checksum: "48273710fe03eb6d6a77ca57f96ef7917db395e6c3bc62e2b495df3dc8f1a0a9"
),
// If you are compiling OpenCV locally, you can uncomment the below block to use a custom copy
// e.g. `$ python opencv/platforms/apple/build_xcframework.py --dynamic opencv/build/dynamic-xcframework`
// .binaryTarget(
// name: "opencv2",
// path: "opencv/build/dynamic-xcframework/opencv2.xcframework"
// ),
.testTarget(
name: "OpenCVTests",
dependencies: ["OpenCV"],
path: "opencv/modules/core/misc/objc/test/swift",
resources: [.process("Resources")]
),
.testTarget(
name: "OpenCVObjCTests",
dependencies: ["OpenCV"],
path: "opencv/modules/core/misc/objc/test/objc"
),
]
)