ci: fix Fedora mingw OpenCV include path
Some checks failed
Cross Build Windows Release on Linux / cross-build-windows (push) Failing after 1m47s
Build Windows Release / build-windows (push) Has been cancelled

This commit is contained in:
luochen570
2026-05-30 01:01:23 +08:00
parent d1be6d1f24
commit 4793f21f2b

View File

@@ -15,6 +15,17 @@ endif()
find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs)
# Fedora MinGW OpenCV 4.13.0 may report an invalid include directory
# (//include/opencv4) from its OpenCVConfig.cmake. The headers are in the
# MinGW sysroot, so add a narrow cross-build fallback when CMake did not get a
# usable OpenCV include path from the package config.
if (MINGW AND (NOT OpenCV_INCLUDE_DIRS OR NOT EXISTS "${OpenCV_INCLUDE_DIRS}"))
set(_fedora_mingw_opencv_include "/usr/x86_64-w64-mingw32/sys-root/mingw/include/opencv4")
if (EXISTS "${_fedora_mingw_opencv_include}")
set(OpenCV_INCLUDE_DIRS "${_fedora_mingw_opencv_include}")
endif()
endif()
set(PROJECT_SOURCES
app/src/main.cpp
app/src/MainWindow.cpp