From faeaed134bf64060a83769d59121411024631a66 Mon Sep 17 00:00:00 2001 From: test123456654321 <16307130148@fudan.edu.cn> Date: Tue, 5 Nov 2024 16:14:51 +0800 Subject: [PATCH] opencv (#1137) --- .gitignore | 1 - src/plugins/libs/libs.cmake | 3 +++ src/plugins/scripts/fetchwebview2.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 57d959e2..08005899 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,3 @@ src/plugins/libs/opencv-static.zip src/plugins/libs/onnxruntime-static.zip src/plugins/libs/onnxruntime-static/onnxruntime-static.7z src/plugins/libs/opencv-static/opencv-static.7z -src/plugins/libs/opencv-static/opencv-4.8.1-windows-vs2022-mt.7z diff --git a/src/plugins/libs/libs.cmake b/src/plugins/libs/libs.cmake index 345d4e5a..fcf00b2b 100644 --- a/src/plugins/libs/libs.cmake +++ b/src/plugins/libs/libs.cmake @@ -29,7 +29,10 @@ target_include_directories(Clipper2Lib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Clipper2 if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) set(OnnxRuntime_DIR ${CMAKE_CURRENT_LIST_DIR}/onnxruntime-static/windows-x64) set(OpenCV_DIR ${CMAKE_CURRENT_LIST_DIR}/opencv-static/windows-x64) +set(OpenCV_ARCH x64) else() set(OnnxRuntime_DIR ${CMAKE_CURRENT_LIST_DIR}/onnxruntime-static/windows-x86) set(OpenCV_DIR ${CMAKE_CURRENT_LIST_DIR}/opencv-static/windows-x86) +set(OpenCV_ARCH x86) endif() +set(OpenCV_RUNTIME vc16) diff --git a/src/plugins/scripts/fetchwebview2.py b/src/plugins/scripts/fetchwebview2.py index fa3ea1a2..3c667d7a 100644 --- a/src/plugins/scripts/fetchwebview2.py +++ b/src/plugins/scripts/fetchwebview2.py @@ -30,7 +30,7 @@ onnx = os.path.normpath( opencv = os.path.normpath( os.path.join( os.path.dirname(__file__), - r"..\libs\opencv-static\windows-x64\x64\vc17\staticlib\opencv_core481.lib", + r"..\libs\opencv-static\windows-x64\x64\vc16\staticlib\opencv_core470.lib", ) ) onnx_1 = os.path.normpath( @@ -50,6 +50,6 @@ if os.path.exists(onnx) == False: if os.path.exists(opencv) == False: os.makedirs(os.path.dirname(opencv_1), exist_ok=True) os.system( - rf'curl -SLo "{opencv_1}" https://github.com/RapidAI/OpenCVBuilder/releases/download/4.8.1/opencv-4.8.1-windows-vs2022-mt.7z' + rf'curl -SLo "{opencv_1}" https://github.com/RapidAI/OpenCVBuilder/releases/download/4.7.0/opencv-4.7.0-windows-vs2019-mt.7z' ) os.system(rf'7z x -y "{opencv_1}" -o{os.path.dirname(opencv_1)}')