user3385623
user3385623

Reputation: 41

Unknown CMake command "BISON_TARGET"

I am trying to configure and generate a source code in Cmake to be able to run in MS Visual Studio 2010 but all I am getting is this error -Unknown CMake command "BISON_TARGET"-. Following is the output and the list of errors. I have BISON installed. Does anyone have any idea how to fix it?

The C compiler identification is MSVC 16.0.30319.1
The CXX compiler identification is MSVC 16.0.30319.1
Check for working C compiler using: Visual Studio 10
Check for working C compiler using: Visual Studio 10 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 10
Check for working CXX compiler using: Visual Studio 10 -- works
Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done
Could NOT find BISON (missing:  BISON_EXECUTABLE)  CMake Error at
src/parameters/CMakeLists.txt:16 (BISON_TARGET):   Unknown CMake command "BISON_TARGET".

Upvotes: 4

Views: 5387

Answers (3)

Stefan
Stefan

Reputation: 1309

Windows:

I'm using Windows 10 and I had to download WinBisonFlex binaries, extract the zip, and add the resulting folder to my system's path.

Note that you need to restart the application which generated the error (in your case Visual Studio).

Docker:

In my Docker container I needed to add:

# Install Bison Flex.
RUN apt-get update && \
    apt-get install -y \
    bison \
    flex

Linux:

The packages mentioned in the Docker container can off course also be installed in a Linux distro to solve the problem on a Linux machine.

Upvotes: 1

user1534144
user1534144

Reputation: 11

In my windows 10 environment, I had to rename the following files:

  • win_flex.exe --> flex.exe
  • win_bison.exe --> bison.exe

Upvotes: 1

arrowd
arrowd

Reputation: 34411

Set BISON_EXECUTABLE from CMake GUI to proper executable path and reconfigure the cache.

Upvotes: 3

Related Questions