I'm running macOS 10.14 and I installed bison version 3.2 with brew, but it refuses to link:
$ brew link bison --force
Warning: Refusing to link macOS-provided software: bison
If you need to have bison first in your PATH run:
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
For compilers to find bison you may need to set:
export LDFLAGS="-L/usr/local/opt/bison/lib"
My CMakeLists.txt has the following lines:
find_package(BISON 3.2 REQUIRED)
...
message(STATUS "Found bison ${BISON_VERSION} at: ${BISON_EXECUTABLE}")
cmake fails with the following output:
Could NOT find BISON: Found unsuitable version "2.3", but required is at
least "3.2" (found /usr/bin/bison)
The system-installed bison is at version 2.3, and I know that the Homebrew-installed version is at version 3.2.
The FindBISON module apparently uses the find_program CMake directive, and I've tried adding /usr/local/opt/bison/bin to CMAKE_PROGRAM_PATH, but /usr/bin/bison is always selected first no matter what. How can I force CMake to favor the Homebrew installed version of the Bison executable?