add notes about custom header dir
MODIFY
README.md
README.md
@@ -118,6 +118,12 @@ export LD_LIBRARY_PATH=/custom/prefix/lib/
Path specified by `PKG_CONFIG_PATH` must contain `opencv.pc` or `opencv4.pc` (for OpenCV 4.x).
Path specified by `LD_LIBRARY_PATH` must contain `libopencv_*.so` files.
+During crate build it uses opencv headers supplied inside the crate for binding generation.
+If you want to use your own (system) headers supply `OPENCV_HEADER_DIR` environment variable.
+The directory in that environment variable should contain `opencv2` dir, e.g. `/usr/include` for
+OpenCV-3.4.x or `/usr/include/opencv4` for OpenCV-4.x. Please be sure to match the supplied
+header version with the crate version features (opencv-34, opencv-41, etc.).
+
### Compiling OpenCV
See the [upstream

MODIFY
build.rs
build.rs
@@ -39,6 +39,8 @@ fn get_modules(opencv_dir_as_string: &str) -> Result<&'static Vec<(String, Vec<S
"aruco",
"bgsegm",
"core_detect",
+ "cudalegacy",
+ "cudev",
"face",
"flann",
"gapi",
@@ -484,7 +486,6 @@ fn cleanup(opencv_dir: &PathBuf) -> Result<(), Box<dyn Error>> {
fn main() -> Result<(), Box<dyn Error>> {
let features = [cfg!(feature = "opencv-32"), cfg!(feature = "opencv-34"), cfg!(feature = "opencv-41")].iter().map(|&x| i32::from(x)).sum::<i32>();
if features != 1 {
- // todo: allow building with custom headers
panic!("Please select exactly one of the features: opencv-32, opencv-34, opencv-41");
}
let opencv_header_dir = env::var("OPENCV_HEADER_DIR").map(PathBuf::from).unwrap_or_else(|_| {

add notes about custom header dir