Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ jobs:
include:
- os: ubuntu-24.04
name: Linux
# Both OpenCV majors are covered. Pinning only to opencv@4 would let
# a 5.x incompatibility land unnoticed; testing only 5 would drop the
# version most distributions still ship. See #56.
- os: macos-latest
name: macOS
name: macOS (OpenCV 4)
opencv: opencv@4
- os: macos-latest
name: macOS (OpenCV 5)
opencv: opencv

runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
Expand All @@ -37,11 +44,10 @@ jobs:
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install opencv@4 ffmpeg pkg-config x264 x265
# Homebrew's `opencv` formula is now 5.x, which CMakeLists.txt does
# not accept (see #56). Pin to the 4.x formula, which is keg-only and
# so needs an explicit prefix.
echo "CMAKE_PREFIX_PATH=$(brew --prefix opencv@4)" >> "$GITHUB_ENV"
brew install ${{ matrix.opencv }} ffmpeg pkg-config x264 x265
# opencv@4 is keg-only, so it needs an explicit prefix; the
# unversioned formula does not, but pointing at it is harmless.
echo "CMAKE_PREFIX_PATH=$(brew --prefix ${{ matrix.opencv }})" >> "$GITHUB_ENV"

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@ option(FRAMEWRIGHT_BUILD_PYTHON "Build Python bindings" OFF)
# ------------------------------------------------------------------------------
# Dependencies
# ------------------------------------------------------------------------------
find_package(OpenCV 4.0 REQUIRED)
# Deliberately unversioned. OpenCV's config treats major versions as
# incompatible, so find_package(OpenCV 4.0) rejects 5.x outright -- which is
# what broke macOS CI when Homebrew moved the opencv formula to 5.0. The
# floor is enforced below instead, so a genuinely too-old OpenCV still fails
# loudly while newer majors are allowed through. See #56.
find_package(OpenCV REQUIRED)

if(OpenCV_VERSION VERSION_LESS 4.0)
message(FATAL_ERROR
"framewright requires OpenCV 4.0 or newer, found ${OpenCV_VERSION}")
endif()

message(STATUS "OpenCV: ${OpenCV_VERSION}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(FFMPEG REQUIRED
libavformat>=58.29 # FFmpeg 4.2+
Expand Down
Loading