Open robert-go opened 3 years ago
Ideally whatever headers you need from opencv would be coming in automatically through your deps
from the @ios_opencv//:OpencvFramework
dependency. If you need to re-export headers for some reason they would have to have a separate rule in their BUILD file to give you a filegroup
or something with them. I imagine your glob of OpencvFramework/opencv2.framework/Versions/A/Headers/**/*.h*
is invalid in this BUILD file if those files are actually coming from the @ios_opencv
workspace and therefore that matches nothing
@keith thank you so much for your reply here is the BUILD file of opencv How can I re-export headers ?
# Description:
# OpenCV libraries for video/image processing on iOS
licenses(["notice"]) # BSD license
exports_files(["LICENSE"])
load(
"@build_bazel_rules_apple//apple:apple.bzl",
"apple_static_framework_import",
)
apple_static_framework_import(
name = "OpencvFramework",
framework_imports = glob(["opencv2.framework/**"]),
visibility = ["//visibility:public"],
)
objc_library(
name = "opencv_objc_lib",
deps = [":OpencvFramework"],
)
cc_library(
name = "opencv",
hdrs = glob([
"opencv2.framework/Versions/A/Headers/**/*.h*",
]),
copts = [
"-std=c++11",
"-x objective-c++",
],
include_prefix = "opencv2",
linkopts = [
"-framework AssetsLibrary",
"-framework CoreFoundation",
"-framework CoreGraphics",
"-framework CoreMedia",
"-framework Accelerate",
"-framework CoreImage",
"-framework AVFoundation",
"-framework CoreVideo",
"-framework QuartzCore",
],
strip_include_prefix = "opencv2.framework/Versions/A/Headers",
visibility = ["//visibility:public"],
deps = [":opencv_objc_lib"],
)
In this case I was saying you could do something like:
filegroup(
name = "headers",
srcs = glob([
"opencv2.framework/Versions/A/Headers/**/*.h*",
]),
)
And then consume the new headers
rule from wherever. Note that it is pretty non-standard to have to manually export headers like this, normally they're inherited through deps instead
Hi I'm trying to build a
ios_framework
. It use OpencvFramework. But I don't know how to export headers from Opencv to reuse it MyBUILD
file