I did this on on a macbook pro without testing on any other platform. brew installed opencv ninja cmake Then spent a while figuring out what env vars to set. Then spent a while figuring out why the cargo build kept failing. Read the docs closer on the https://lib.rs/crates/opencv page and landed on what's in Cargo.toml now. This generates a binary, but if you look at it with otool you'll see it's linked to a ton of stuff in /usr/local. This means it's not trivial to redistribute. Which is fine for me, because this is a toy. But, if you every wanted to redistribute it you'll have some work to do to pull in all the deps and set DYLD_* vars at runtime. Or however vendoring third party libs works on macos when grownups do it. To compile this source in the env.sh then do a cargo build. You shouldn't need to set any ENV vars at runtime. This whole mess links to stuff in /usr/local by default. So it's more like a unix application than a macos one. I don't know enough about native mac apps to bundle it up, but it's on my list of things to learn at some point.
jstelzer/rust-opencv-cam-demo
This is a silly toy canny cam filter I use with OBS to be ridiculous on zoom calls
RustMIT