File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -387,9 +387,21 @@ impl Library {
387
387
}
388
388
let opencv = opencv. ok_or_else ( || errors. join ( ", " ) ) ?;
389
389
390
- let version = Self :: version_from_include_paths ( & opencv. include_paths ) ;
390
+ let mut opencv_include_paths = opencv. include_paths ;
391
+
392
+ let mut version = Self :: version_from_include_paths ( & opencv_include_paths) ;
393
+ // workaround for the wrong detected include path for vcpkg 2024.11.16+: https://github.com/twistedfall/opencv-rust/issues/640
394
+ if version. is_none ( ) {
395
+ for include_path in & mut opencv_include_paths {
396
+ if include_path. ends_with ( "include" ) {
397
+ include_path. push ( "opencv4" ) ;
398
+ version = Self :: version_from_include_paths ( & [ include_path] ) ;
399
+ break ;
400
+ }
401
+ }
402
+ }
391
403
392
- let include_paths = Self :: process_env_var_list ( include_paths, opencv . include_paths ) ;
404
+ let include_paths = Self :: process_env_var_list ( include_paths, opencv_include_paths ) ;
393
405
394
406
let mut cargo_metadata = opencv. cargo_metadata ;
395
407
You can’t perform that action at this time.
0 commit comments