Xcode import $PATH from bash

I want to import the bash

$PATH
environment variable (where it is set in
~/.bash_profile
) into one particular Xcode project (I'm using Xcode 11).

This is because I want to use a Makefile compile that Xcode project, and the Makefile uses the bash

PATH
environment variable. Specifically I use compilers and libraries that I installed using MacPorts, so I want Xcode to look in
/opt/local/bin:/opt/local/sbin
, like the Makefile does.


In Xcode I've tried adding these in

Edit scheme > Environment Variables
, and in
Build Settings
for both the project and its (external-build) target, as described in the answers to <a href="https://stackoverflow.com/questions/932424/where-is-path-set-in-xcode">this question</a>, but it hasn't appeared to have made a difference.


(The specific problem that I'm trying to fix is described in <a href="https://stackoverflow.com/questions/60920197/using-a-makefile-in-xcode-or-alternative-ide">my question here</a>.)


Can anyone help?