From a215c6a9a0f348362a1a36ed641029085c5d4819 Mon Sep 17 00:00:00 2001 From: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:02:55 -0800 Subject: [PATCH] [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 --- ports/opencv3/portfile.cmake | 4 ++-- ports/opencv3/vcpkg.json | 2 +- ports/opencv4/portfile.cmake | 2 +- ports/opencv4/vcpkg.json | 2 +- versions/baseline.json | 4 ++-- versions/o-/opencv3.json | 5 +++++ versions/o-/opencv4.json | 5 +++++ 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ports/opencv3/portfile.cmake b/ports/opencv3/portfile.cmake index 797aa6ca369656..86c96a553f3b40 100644 --- a/ports/opencv3/portfile.cmake +++ b/ports/opencv3/portfile.cmake @@ -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") diff --git a/ports/opencv3/vcpkg.json b/ports/opencv3/vcpkg.json index f61e73abbd46e9..ab39093154e054 100644 --- a/ports/opencv3/vcpkg.json +++ b/ports/opencv3/vcpkg.json @@ -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", diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index ac8c28f1c99972..a85879d191f12d 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -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) diff --git a/ports/opencv4/vcpkg.json b/ports/opencv4/vcpkg.json index 939fc1602ba8e8..8c6eb97fcaffa0 100644 --- a/ports/opencv4/vcpkg.json +++ b/ports/opencv4/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index d6d1ea1f5e2a46..decb9b09c804ac 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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", diff --git a/versions/o-/opencv3.json b/versions/o-/opencv3.json index 474a6545e4fe2d..832720a0a58e9c 100644 --- a/versions/o-/opencv3.json +++ b/versions/o-/opencv3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "577dd8933e58290664f4290476069978692ed4f2", + "version": "3.4.18", + "port-version": 13 + }, { "git-tree": "f5ee69ffa1b6c98a28fc805afffaeb799b4d22a8", "version": "3.4.18", diff --git a/versions/o-/opencv4.json b/versions/o-/opencv4.json index 6d8efa13a3860d..5752ba2e07c6a9 100644 --- a/versions/o-/opencv4.json +++ b/versions/o-/opencv4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ec4e040d476cee60b2fc21a1f847d30905ac9726", + "version": "4.8.0", + "port-version": 15 + }, { "git-tree": "852583d8f7a5bb15998efad9c0305a8ce686e59b", "version": "4.8.0",