[vlc-commits] [Git][videolan/vlc][master] contrib: CMake: Ignore 3rd party package locations on Darwin

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Jul 7 15:55:38 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
b051dbef by Marvin Scholz at 2026-07-07T17:01:55+02:00
contrib: CMake: Ignore 3rd party package locations on Darwin

CMake adds 3rd party package locations like Homebrew, MacPorts
or Fink packages to the system search paths, without a way to opt-out,
so instead we need to explicitly ignore the paths for those here.

- - - - -


1 changed file:

- contrib/src/main.mak


Changes:

=====================================
contrib/src/main.mak
=====================================
@@ -5,6 +5,9 @@
 
 all: install
 
+NULL  :=
+SPACE := $(NULL) #
+
 SRC := $(TOPSRC)/src
 SRC_BUILT := $(TOPSRC_BUILT)/src
 TARBALLS := $(TOPSRC)/tarballs
@@ -547,6 +550,19 @@ ifdef MSYS_BUILD
 CMAKE = PKG_CONFIG_LIBDIR="$(PKG_CONFIG_PATH)" $(CMAKE)
 CMAKE += -DCMAKE_LINK_LIBRARY_SUFFIX:STRING=.a
 endif
+ifdef HAVE_DARWIN_OS
+# Ignore 3rd party packager paths in CMakes find_*
+# functions, to avoid finding non-system deps
+CMAKE_IGNORE_PREFIX_PATHS := /sw /opt/local
+HOMEBREW_PREFIX := $(shell brew --prefix 2>/dev/null)
+ifneq ($(strip $(HOMEBREW_PREFIX)),)
+CMAKE_IGNORE_PREFIX_PATHS += $(HOMEBREW_PREFIX)
+endif
+CMAKE_IGNORE_PATHS := \
+	$(addsuffix /lib,$(CMAKE_IGNORE_PREFIX_PATHS)) \
+	$(addsuffix /include,$(CMAKE_IGNORE_PREFIX_PATHS))
+CMAKE += -DCMAKE_IGNORE_PATH="$(subst $(SPACE),;,$(strip $(CMAKE_IGNORE_PATHS)))"
+endif
 
 MESONFLAGS = $(BUILD_DIR) $< --default-library static --prefix "$(PREFIX)" \
 	--backend ninja -Dlibdir=lib -Dcmake_prefix_path="$(PREFIX)"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b051dbefb0f997e6c9c120e0c93ecd20323067c6

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b051dbefb0f997e6c9c120e0c93ecd20323067c6
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list