Skip to content

Commit 22a5425

Browse files
committed
improving docs for macOS
1 parent e6028ff commit 22a5425

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ Get OpenCV from homebrew:
9797
--install`), XCode (from AppStore) or `llvm` (from Brew). You most probably need to also check the item 7 of the
9898
troubleshooting below.
9999

100+
Get llvm from homebrew
101+
```shell script
102+
brew install llvm
103+
```
104+
105+
If you have already installed OpenCV via Homebrew, there is no need to configure any environment variables specifically for OpenCV on macOS. The OpenCV installation can be automatically detected if it was installed through Homebrew.
106+
107+
To take advantage of this automatic detection, refrain from setting the following environment variables:
108+
`OPENCV_LINK_LIBS`, `OPENCV_LINK_PATHS`, and `OPENCV_INCLUDE_PATHS`.
109+
110+
However, make sure you have configured the following environment variables:
111+
`DYLD_FALLBACK_LIBRARY_PATH`, `LDFLAGS` and `LD_LIBRARY_PATH`.
112+
113+
If you have not made any custom changes to your installation, the following settings should work for your setup:
114+
115+
```
116+
export DYLD_FALLBACK_LIBRARY_PATH="$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain/usr/lib/"
117+
export LDFLAGS=-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
118+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
119+
```
120+
100121
### Manual build
101122

102123
You can of course always compile OpenCV of the version you prefer manually. This is also supported, but it

0 commit comments

Comments
 (0)