I am making a GUI program using Qt4, under git source control (Github page). Small part of project requires scanning and parsing. So I want to use flex and bison with the project. I can think of 3 ways-
我在git源代码控制(Github页面)下使用Qt4制作GUI程序。项目的一小部分需要扫描和解析。所以我想在项目中使用flex和bison。我可以想到3种方法 -
- To keep flex and bison files out of project and source control. Generate the C source files and add it to project.
- 保持flex和bison文件不受项目和源代码控制。生成C源文件并将其添加到项目中。
- Add flex and bison files to project, but run flex and bison commands separately.
- 将flex和bison文件添加到项目中,但分别运行flex和bison命令。
- Integrate properly with IDE (Qt Creator on Ubuntu 12.04) and source control, so that when I build the flex and bison is called to generate lexer and parser.
- 与IDE(Ubuntu 12.04上的Qt Creator)和源代码控制正确集成,以便在构建flex和bison时调用生成词法分析器和解析器。
I obviously want third option, but have no idea how to do it.
我显然想要第三种选择,但不知道该怎么做。
Please suggest the best option and the way to do it. Or there is any other way to do it?
请建议最好的选择和方法。或者还有其他方法吗?
Note - I want the project to be cross platform, to build for Windows as well.
注意 - 我希望项目是跨平台的,也可以为Windows构建。
1 个解决方案
#1
3
By following the link in @Bort's comment I was able to integrate Flex and Bison with my Qt project nicely. I added custom build steps in project settings. Below is the screenshot in Qt Creator.
通过关注@ Bort评论中的链接,我能够很好地将Flex和Bison与我的Qt项目集成。我在项目设置中添加了自定义构建步骤。以下是Qt Creator中的屏幕截图。
I asked a related question for this - Undefined reference error even though the functions are present
我问了一个相关的问题 - 即使函数存在,也会出现未定义的引用错误
#1
3
By following the link in @Bort's comment I was able to integrate Flex and Bison with my Qt project nicely. I added custom build steps in project settings. Below is the screenshot in Qt Creator.
通过关注@ Bort评论中的链接,我能够很好地将Flex和Bison与我的Qt项目集成。我在项目设置中添加了自定义构建步骤。以下是Qt Creator中的屏幕截图。
I asked a related question for this - Undefined reference error even though the functions are present
我问了一个相关的问题 - 即使函数存在,也会出现未定义的引用错误