Changing project structures and incldues problem?

This isn't actually a problem im having it is just something i've been wondering about for a while.

say i have a big project with a lot of headers and source files

and alot of the source files include headers that is in various specific directories

and now say i wanted to change the project structure completely, how would i go about that? i cant go in to every single file and change the include path, that would take forever? right?

What would one do in that situation?

Its something i've always been wondering about since i got introduced to includes. Since they kind of "tie" your code to the project structure
Last edited on
As long as a) there are no duplicate files in the project, and b) you can keep track of where the files were before you moved them and their hashes, it should be fairly easy to write a program that can repoint the include paths to the right locations.
It's probably wiser to sidestep this problem by not excessively subdividing your program into hundreds of files.

In my experience, though, moving files around to do reorganizations is unusual. It's much more common to move classes and functions from one file to another. For example you have classes A and B in src/foo.cpp, and you move them to src/A/A.cpp and and to src/B/B.cpp respectively.
Topic archived. No new replies allowed.