打开根目录下的WORKSPACE文件,将相应模块的路径替换为自己的库的路径。然后再在third_party里找到修改的模块的配置文件,在里面修改相应路径,保存即可。
比如要修改opencv目录为自己的目录,在WORKSPACE里找到自己平台的opencv模块配置,如opencv_linux,修改路径完成后,在third_party里找到相应的模块配置文件,文件名为模块名+.BUILD。在这个例子中,配置文件名为opencv_linux.BUILD。打开后配置相应的路径保存即可。
hdrs = glob([
"include/opencv2/**/*.h*",
]),
includes = [
"include/",
"lib/",
],
srcs = glob(["lib/libopencv*.so*"]),
linkopts = [
"-l:libopencv_world.so",
],
如果嫌下载慢,可以换国内源:依次打开WORKSPACE ->maven_install -> repositories
添加国内源,如阿里源 "https://maven.aliyun.com/repository/public",
maven_install(
artifacts = [
xxxxxx
],
repositories = [
"https://maven.aliyun.com/repository/public",
"https://maven.google.com",
"https://dl.google.com/dl/android/maven2",
"https://repo1.maven.org/maven2",
"https://jcenter.bintray.com",
],