Eclipse-CDT: Whats the best way to add a custom build step?

爷,独闯天下 提交于 2019-12-05 09:14:20
Alex Black

I got this working well by adding a 'Builder' of type 'Program'.

Right click on the project, Click Properties, Click New ..., Add the location of the file you want to execute, as well as any command line arguments.

I'm using cmake with eclipse cdt
it provides an generator to generate the whole eclipse cdt project

you just have to setup your CMakeLists.txt file and then run the following command in your project directory:
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug .
after that eclipse uses the cmake generated make file and regenerates it when you change the CMakeLists.txt

there exists tutorial for cmake and cdt

you have to check whether cmake suits your needs

Relatively early in our projects' lifetime, I felt like I was running into too many limitations of Eclipse CDT's managed builds, so I switched to Make.

This isn't as bad as it might sound; Eclipse CDT integrates well with make (running it with the configuration you chose and parsing its results), and you can use Eclipse CDT's generated makefiles as a starting point.

Once you're using make, you can easily add a custom build step.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!