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

build-process, c++, eclipse-cdt

Solution

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

- Right click on the project

- Click "Properties", "Builders"

- Click "New", "Program", ...

- Add the location of the file you want to execute, as well as any command line arguments.

Problem

I have a file in my project which I need to compile using an external tool, and the output of that is a pair of .c and .h files. Whats the best way to integrate this into my Eclipse-CDT build? - Ideally I can reference the external tool using a relative path - Ideally Eclipse will know if I change this file that it needs to re-run the external tool I've tried out adding something to the 'Builders' section under Project Properties with mixed results. thx - Alex

Original source