I'm trying to import a C project to eclipse (CDT) that is managed by waf. There is a list of predefines generated by waf (when running ./waf configure
). That list has to be imported to Project->Properties->C/C++ General/Paths and Symbols/Symbols/GNU C
so that the indexer knows about them and does not print errors. That list (when using the GUI) is stored to the .cproject
file. I created a Build Target that runs ./waf configure
and stores the list to a file named DEFINES.txt
. How do I automatically update the list of .cproject
with the values of DEFINES.txt
after running the Build Target?
I thought about the following solutions and their follow-up problems:
- Solution: Writing a plug-in.
Problem: What is the appropriate extension point? - Solution: Writing an external program that calls
./waf configure
readsDEFINES.txt
and writes the list to.cproject
. That program replaces the old Build Target.
Problem: How safe is this? Am I allowed to change the.cproject
file by an external program without causing any problems? - Solution: Implementing the
.cproject
updating algorithm inwscript
file.
Problem: This is not a solution for me, because the project is used by others, too, that do not use eclipse as IDE. So the modifiedwscript
will cause errors if the other developers want to build the project.
Does anybody have better ideas or some advice?