From 593fa5efbd94b589a83e6a077884b03a38c3ad81 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 29 Oct 2024 16:37:48 -0700 Subject: [PATCH] Add comments to explain how to configure OpenCV in the opencv_macos.BUILD file. PiperOrigin-RevId: 691204643 --- third_party/opencv_macos.BUILD | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/third_party/opencv_macos.BUILD b/third_party/opencv_macos.BUILD index d05c83ccc1..7ed8ab8f28 100644 --- a/third_party/opencv_macos.BUILD +++ b/third_party/opencv_macos.BUILD @@ -7,8 +7,29 @@ licenses(["notice"]) # BSD license exports_files(["LICENSE"]) -# The path to OpenCV is a combination of the path set for "macos_opencv" -# in the WORKSPACE file and the prefix here. +# Example configurations: +# +# To configure OpenCV 3, obtain the path of OpenCV 3 from Homebrew: +# +# $ brew ls opencv@3 | grep version.hpp +# $ /opt/homebrew/Cellar/opencv@3/3.4.16_10/include/opencv2/core/version.hpp +# +# Then set path in "macos_opencv" rule in the WORKSPACE file to +# "/opt/homebrew/Cellar" and the PREFIX below to "opencv@3/3.4.16_10". +# +# +# To configure OpenCV 4, obtain the path of OpenCV 4 from Homebrew: +# +# $ brew ls opencv | grep version.hpp +# $ /opt/homebrew/Cellar/opencv/4.10.0_12/include/opencv4/opencv2/core/version.hpp +# $ /opt/homebrew/Cellar/opencv/4.10.0_12/include/opencv4/opencv2/dnn/version.hpp +# +# Then set path in "macos_opencv" rule in the WORKSPACE file to +# "/opt/homebrew/Cellar" and the PREFIX below to "opencv/4.10.0_12". For OpenCV +# 4, you will also need to adjust the include paths. The header search path +# should be "include/opencv4/opencv2/**/*.h*" and the include prefix needs to +# be set to "include/opencv4". + PREFIX = "opt/opencv@3" cc_library(