使用Bazel构建用C ++编写的opencv代码

时间:2019-07-18 03:55:18

标签: opencv bazel

bazel版本:0.19.2

我正在尝试构建具有opencv依赖项的C ++代码(在带有jetpack 4.2的nvidia jetson TX2上使用bazel)     我已经使用官方的opencv安装文档在本地安装了opencv。

然后我在WORKSPACE文件中添加了以下内容。

new_local_repository(
    name = "opencv",
    path = "/usr/local/include",
    build_file = "opencv.BUILD",
)

我在WORKSPACE文件所在的位置创建了一个具有以下内容的opencv.BUILD文件:

cc_library(
    name = "opencv",
    srcs = glob(["lib/*.so*"]),
    hdrs = glob(["include/**/*.hpp", "include/**/*.h"]),
    includes = ["include"],
    visibility = ["//visibility:public"], 
    linkstatic = 1,
)

在代码的BUILD文件中,我添加了依赖项:     @opencv // :: opencv

在警句中,我给出了opencv的路径,即/ usr / local / include

它给了我以下错误:

undeclared inclusion(s) in rule '//tensorflow/temp:temp':
this rule is missing dependency declarations for the following files included by 'tensorflow/temp/XYZ.cpp':
  'tensorflow/temp/A.h'
  'tensorflow/temp/B.h'
  'tensorflow/temp/C.h'
  'external/opencv/opencv2/highgui/highgui.hpp'
  'external/opencv/opencv2/highgui.hpp'
  'external/opencv/opencv2/core.hpp'
  'external/opencv/opencv2/core/cvdef.h'
  'external/opencv/opencv2/core/hal/interface.h'
  'external/opencv/opencv2/core/cv_cpu_dispatch.h'
  'external/opencv/opencv2/core/version.hpp'
  'external/opencv/opencv2/core/base.hpp'
FAILED: Build did NOT complete successfully

0 个答案:

没有答案