This diff fixes a few issues with the current usage of the brew prefix:
- The brew prefix is added to the search path for the libraries files as HINTS, which cause it to be searched before system libraries. However this path does not follow the same rule as the other paths, as the include or lib subdirectories are not traversed. These suffixes needs to be added manually for the search to succeed.
- The find_brew_prefix() function checks if the variable name is defined to prevent calling brew multiple times. The find package modules all use the same BREW_HINT variable name, which can cause shadowing issues if they are called from the same scope (which happens).
- There is a copy/paste issue in the FindEvent package which looks for the wrong prefix.
These bugs have been revealed as some brew packages (namely Berkeley DB)
stopped putting symlinks to the standard system path, and caused the
macOS build to fail.