I want to run the following command
win_bison.exe --output="calc.tab.cpp" --defines="calc.tab.h" "calc.y"
and then create an executable from the products of this command with CMake
add_executable(Calc calc.tab.cpp calc.tab.h)
All the files (win_bison.exe, calc.y) are found in the CMakeLists.txt folder.
What is the correct way to do so? Please give the commands explanations.
If your project is indeed structured like that, then you can use the
FindBisonCMake moduleNotes
find_packagesearches by setting theBISON_DIRvariable in the command line invocation of CMake, i.e.-DBISON_DIR=[source dir], or you can place the Bison executable somwhere that is system-wide accessible/invocable.