From 1a0024aabed9f798b1656ac3f7079db874825a51 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 7 Jun 2021 12:27:49 -0700 Subject: [PATCH] makefile: add support on MacOS for alternate location of HomeBrew components As discussed in #1048 --- makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index f0f5101e..4fcef2c9 100644 --- a/makefile +++ b/makefile @@ -350,9 +350,14 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) LIBPATH += /opt/local/lib OS_LDFLAGS += -L/opt/local/lib endif - ifeq (HomeBrew,$(shell if ${TEST} -d /usr/local/Cellar; then echo HomeBrew; fi)) - INCPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/include) - LIBPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/lib) + ifeq (HomeBrew,$(or $(shell if ${TEST} -d /usr/local/Cellar; then echo HomeBrew; fi),$(shell if ${TEST} -d /opt/homebrew/Cellar; then echo HomeBrew; fi))) + ifeq (local,$(shell if $(TEST) -d /usr/local/Cellar; then echo local; fi)) + HBPATH = /usr/local + else + HBPATH = /opt/homebrew + endif + INCPATH += $(foreach dir,$(wildcard $(HBPATH)/Cellar/*/*),$(dir)/include) + LIBPATH += $(foreach dir,$(wildcard $(HBPATH)/Cellar/*/*),$(dir)/lib) endif else ifeq (Linux,$(OSTYPE))