From 2cf785ceddfa6aabe7f1bbfe52bcaca6ab9622bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 18 Apr 2025 13:37:50 +0200 Subject: [PATCH] package/homebrew: make the 2020.06 version still work with CMake 4. --- package/homebrew/magnum.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/homebrew/magnum.rb b/package/homebrew/magnum.rb index 914b8cfa6..e2d17c0b4 100644 --- a/package/homebrew/magnum.rb +++ b/package/homebrew/magnum.rb @@ -15,6 +15,11 @@ class Magnum < Formula # 2020.06 has the options unprefixed, current master has them prefixed. # Options not present in 2020.06 are prefixed always. option_prefix = build.head? ? 'MAGNUM_' : '' + # 2020.06 has CMake 3.5 as minimum required for backwards compatibility + # purposes, but it works with any newer. CMake 4.0 removed compatibility + # with it and suggests this as an override. + # TODO remove once a new release is finally made + extra_cmake_args = build.head? ? [] : ['-DCMAKE_POLICY_VERSION_MINIMUM=3.5'] system "mkdir build" cd "build" do @@ -26,7 +31,7 @@ class Magnum < Formula # add this, which ultimately results in `-DCMAKE_FIND_FRAMEWORK=FIRST` # being passed to CMake. No idea what's going on, the regular CI build # outside of Homebrew (although with CMake 3.26) doesn't need that. - *std_cmake_args(find_framework: "FIRST"), + *(std_cmake_args(find_framework: "FIRST") + extra_cmake_args), # Without this, ARM builds will try to look for dependencies in # /usr/local/lib and /usr/lib (which are the default locations) instead # of /opt/homebrew/lib which is dedicated for ARM binaries. Please