Just an FYI about a tool I just wrote (because I needed it myself).
You can now run this:
Introjucer --fix-broken-include-paths [folder]
What it does is:
- Find all the source-files within that folder (recursively)
- Look at all the #includes in those files
- If any of those #includes are broken - i.e. if the path doesn't resolve to a file that exists - then it will search for the filename amongst all the other files in the folder, and if it finds a match, it'll fix that #include to use the correct relative path to this file
The point is that if you have a big project with lots of sub-folders, this will automatically fix any broken includes paths in them. So if you're refactoring a project by moving files or folders around, or renaming the folders, then rather than manually fixing all the broken paths, this will just sort them all out in one go!
Obviously it ain't perfect.. If you have multiple files in the same folder with the same name then it stands a chance of picking the wrong one. And it's not a real preprocessor, it just naively looks for "#include" as a string, so any #ifdefs are ignored. But I've found it very useful for some restructuring I've been doing.