How to integrate flex and bison with a Qt project?

I am making a GUI program using Qt4, under git source control ( Github page ). A small part of the project requires scanning and parsing. So I want to use flex and bison with a project. I can think of 3 ways -

  • Keep flex and bison files out of project and source control. Create C source files and add them to your project.
  • Add flex and bison files to your project, but run flex and bison separately.
  • Integrate properly with the IDE (Qt Creator on Ubuntu 12.04) and the original control, so that when I create flex and bison, the lexer and parser are called to generate.

I obviously want the third option, but have no idea how.

Please suggest a better option and a way to do this. Or is there another way to do this?

Note. I want the project to be cross platform, build for Windows.

+3


source to share


1 answer


By following the link in @ Bort's comment I was able to integrate Flex and Bison well with my Qt project. I have added custom build steps in project settings. Below is a screenshot in Qt Creator.

enter image description here



I asked a related question for this - Undefined reference error even though functions are present

+3


source







All Articles