[opencv] added openvino support (#34727)

* opencv: added openvino support

* updated version database
This commit is contained in:
Ilya Lavrenov 2023-10-28 05:10:15 +04:00 committed by GitHub
parent cbb9d90a2e
commit 1c00eae503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,25 @@
diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
index 437042958e..a90eb5a5ab 100644
--- a/cmake/OpenCVUtils.cmake
+++ b/cmake/OpenCVUtils.cmake
@@ -1632,13 +1632,19 @@ function(ocv_add_external_target name inc link def)
endif()
endfunction()
+set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "" CACHE INTERNAL "")
function(ocv_install_used_external_targets)
if(NOT BUILD_SHARED_LIBS
AND NOT (CMAKE_VERSION VERSION_LESS "3.13.0") # upgrade CMake: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2152
)
foreach(tgt in ${ARGN})
if(tgt MATCHES "^ocv\.3rdparty\.")
- install(TARGETS ${tgt} EXPORT OpenCVModules)
+ list(FIND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}" _found)
+ if(_found EQUAL -1) # don't export target twice
+ install(TARGETS ${tgt} EXPORT OpenCVModules)
+ list(APPEND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}")
+ set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "${__OPENCV_EXPORTED_EXTERNAL_TARGETS}" CACHE INTERNAL "")
+ endif()
endif()
endforeach()
endif()

View File

@ -29,6 +29,7 @@ vcpkg_from_github(
0017-fix-flatbuffers.patch
0019-missing-include.patch
0020-fix-compat-cuda12.2.patch
0021-static-openvino.patch # https://github.com/opencv/opencv/pull/23963
"${ARM64_WINDOWS_FIX}"
)
# Disallow accidental build of vendored copies
@ -85,9 +86,13 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
# Cannot use vcpkg_check_features() for "dnn", "gtk", ipp", "openmp", "ovis", "python", "qt", "tbb"
set(BUILD_opencv_dnn OFF)
set(WITH_OPENVINO OFF)
if("dnn" IN_LIST FEATURES)
if(NOT VCPKG_TARGET_IS_ANDROID)
set(BUILD_opencv_dnn ON)
if(NOT VCPKG_TARGET_IS_UWP)
set(WITH_OPENVINO ON)
endif()
else()
message(WARNING "The dnn module cannot be enabled on Android")
endif()
@ -446,6 +451,7 @@ vcpkg_cmake_configure(
-DWITH_PROTOBUF=${BUILD_opencv_dnn}
-DWITH_PYTHON=${WITH_PYTHON}
-DWITH_OPENCLAMDBLAS=OFF
-DWITH_OPENVINO=${WITH_OPENVINO}
-DWITH_TBB=${WITH_TBB}
-DWITH_OPENJPEG=OFF
-DWITH_CPUFEATURES=OFF
@ -526,6 +532,9 @@ find_dependency(Tesseract)")
if("lapack" IN_LIST FEATURES)
string(APPEND DEPS_STRING "\nfind_dependency(LAPACK)")
endif()
if(WITH_OPENVINO)
string(APPEND DEPS_STRING "\nfind_dependency(OpenVINO CONFIG)")
endif()
if("openexr" IN_LIST FEATURES)
string(APPEND DEPS_STRING "\nfind_dependency(OpenEXR CONFIG)")
endif()

View File

@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 7,
"port-version": 8,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",
@ -109,6 +109,10 @@
"host": true,
"default-features": false
},
{
"name": "openvino",
"platform": "!uwp"
},
"protobuf"
]
},

View File

@ -6150,7 +6150,7 @@
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 7
"port-version": 8
},
"opendnp3": {
"baseline": "3.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "48c97b54fceaef9a96d374693f47e3ea91383f3c",
"version": "4.8.0",
"port-version": 8
},
{
"git-tree": "ef78c1958b122045e9d1e353150049431b3162fa",
"version": "4.8.0",