[opencv3/opencv4] Check whether TARGET libprotobuf is defined (#36116)

* fix opencv3

* update version

* fix opencv4

* format

* update version

* add comment

* update git-tree

---------

Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
MonicaLiu 2024-01-16 11:02:55 -08:00 committed by GitHub
parent a14456f6fb
commit a215c6a9a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 7 deletions

View File

@ -420,7 +420,7 @@ endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ "${CURRENT_PACKAGES_DIR}/share/opencv3/OpenCVModules.cmake" OPENCV_MODULES)
set(DEPS_STRING "include(CMakeFindDependencyMacro)
if(${BUILD_opencv_flann})
if(${BUILD_opencv_flann} AND NOT TARGET libprotobuf) #Check if the CMake target libprotobuf is already defined
find_dependency(Protobuf CONFIG REQUIRED)
if(TARGET protobuf::libprotobuf)
add_library (libprotobuf INTERFACE IMPORTED)
@ -538,4 +538,4 @@ endif()
configure_file("${CURRENT_PORT_DIR}/usage.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,7 +1,7 @@
{
"name": "opencv3",
"version": "3.4.18",
"port-version": 12,
"port-version": 13,
"description": "Open Source Computer Vision Library",
"homepage": "https://github.com/opencv/opencv",
"license": "BSD-3-Clause",

View File

@ -490,7 +490,7 @@ endif()
file(READ "${CURRENT_PACKAGES_DIR}/share/opencv4/OpenCVModules.cmake" OPENCV_MODULES)
set(DEPS_STRING "include(CMakeFindDependencyMacro)
if(${BUILD_opencv_dnn})
if(${BUILD_opencv_dnn} AND NOT TARGET libprotobuf) #Check if the CMake target libprotobuf is already defined
find_dependency(Protobuf CONFIG REQUIRED)
if(TARGET protobuf::libprotobuf)
add_library (libprotobuf INTERFACE IMPORTED)

View File

@ -1,7 +1,7 @@
{
"name": "opencv4",
"version": "4.8.0",
"port-version": 14,
"port-version": 15,
"description": "computer vision library",
"homepage": "https://github.com/opencv/opencv",
"license": "Apache-2.0",

View File

@ -6274,11 +6274,11 @@
},
"opencv3": {
"baseline": "3.4.18",
"port-version": 12
"port-version": 13
},
"opencv4": {
"baseline": "4.8.0",
"port-version": 14
"port-version": 15
},
"opendnp3": {
"baseline": "3.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "577dd8933e58290664f4290476069978692ed4f2",
"version": "3.4.18",
"port-version": 13
},
{
"git-tree": "f5ee69ffa1b6c98a28fc805afffaeb799b4d22a8",
"version": "3.4.18",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ec4e040d476cee60b2fc21a1f847d30905ac9726",
"version": "4.8.0",
"port-version": 15
},
{
"git-tree": "852583d8f7a5bb15998efad9c0305a8ce686e59b",
"version": "4.8.0",