I have a sub-dir tree with varying number of branches and most of the branches contain .cpp files (many of them). I have a header-file at the root of the tree that I want to have as a
#include "<constructed-relative-path-to-root>/headerfile.h"
as the first line of each .cpp.
an alternative to constructed-relative-path-to-root would be the
hard-coded path, which would have to be adjusted whenever the project is relocated)
a second alternative would be to copy the content of the header-file in at the top of each .cpp file
I have no idea how to write such a script. Can anyone please help?
#include <headerfile.h>everywhere? – Jim Paris Nov 28 '12 at 19:12#include <headerfile.h>in each .cpp in all the sub-dirs - there are hundreds - This would be solved by Doug O'Neal's answer :) – slashmais Nov 29 '12 at 5:54-include headerfile.hon the command line. No source code changes at all! – Jim Paris Nov 29 '12 at 6:47