This is not the way you do it.
Homebrew’s gettext
formula is intentionally keg-only because it would otherwise conflict with stock MacOS software:
$ brew info gettext <...> ==> Caveats gettext is keg-only, which means it was not symlinked into /usr/local, because macOS provides the BSD gettext library & some software gets confused if both are in the library path. If you need to have gettext first in your PATH run: echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile For compilers to find gettext you may need to set: export LDFLAGS="-L/usr/local/opt/gettext/lib" export CPPFLAGS="-I/usr/local/opt/gettext/include"
CMake honors these envvars when configuring the compiler.