Skip to content

Commit fb60f86

Browse files
committed
fix
1 parent 8a8f47c commit fb60f86

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.github/workflows/windows.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ jobs:
5757
id: opencv-cache
5858
uses: actions/cache/restore@v5
5959
with:
60-
path: |
61-
${{ github.workspace }}/opencv_artifacts/include
62-
${{ github.workspace }}/opencv_artifacts/lib
63-
${{ github.workspace }}/opencv_artifacts/bin
60+
path: ${{ github.workspace }}/opencv_artifacts
6461
key: opencv-${{ env.OPENCV_VERSION }}-windows-x64-${{ hashFiles('cmake/opencv_build_options.cmake') }}
6562

6663
- name: Build OpenCV
@@ -86,10 +83,7 @@ jobs:
8683
if: steps.opencv-cache.outputs.cache-hit != 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
8784
uses: actions/cache/save@v5
8885
with:
89-
path: |
90-
${{ github.workspace }}/opencv_artifacts/include
91-
${{ github.workspace }}/opencv_artifacts/lib
92-
${{ github.workspace }}/opencv_artifacts/bin
86+
path: ${{ github.workspace }}/opencv_artifacts
9387
key: opencv-${{ env.OPENCV_VERSION }}-windows-x64-${{ hashFiles('cmake/opencv_build_options.cmake') }}
9488

9589
# Commented out: FFmpeg backend is included in opencv_videoio_ffmpeg DLLs

cmake/opencv_build_options.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@ set(BUILD_opencv_wechat_qrcode ON CACHE BOOL "" FORCE)
4343

4444
# Disable unused 3rd-party integrations
4545
set(WITH_GSTREAMER OFF CACHE BOOL "" FORCE)
46-
set(WITH_ADE OFF CACHE BOOL "" FORCE)
46+
set(WITH_ADE OFF CACHE BOOL "" FORCE)
47+
48+
# Use a flat install layout (avoids x64/vc17/ subdirectories; libs go to staticlib/)
49+
set(OpenCV_INSTALL_BINARIES_PREFIX "" CACHE STRING "" FORCE)

src/OpenCvSharpExtern/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ if(APPLE)
1616
find_package(Protobuf REQUIRED)
1717
endif()
1818

19+
# On Windows, OpenCV is built as a static library; tell the Windows Pack config to look for static libs.
20+
if(WIN32)
21+
set(OpenCV_STATIC ON)
22+
endif()
23+
1924
find_package(OpenCV REQUIRED)
2025

2126
# iconv support isn't automatic on some systems

0 commit comments

Comments
 (0)