I'm curious about how C++ developers like to lay out their projects. I'm speaking specifically about the directory layout on the file system. The best guidance I have found on this is here:
http://stackoverflow.com/questions/1398445/directory-structure-for-a-c-library
The number one answer recommends having directories for src, include, lib, bin, tools, and test. That sort of falls short of what I had in mind.
I'm trying to imagine my project when it's large, having hundreds (possibly thousands) of files in the src directory. Since I'm coming from java and maven, I'm used to having a well defined directory structure. For example, I would have something like this: src/main/java/rootPackage/subPackage/MyClass.java
I consider java packages to be similar to C++ namespaces, except for the restrictions that packages place on the directory layout. The one problem I foresee with trying that in C++ is that if you move the files into different directories, you will also be forced to update your include statements. Maybe there is a shortcut to do that, I don't know.
So I guess my first question is:
Do C++ projects tend to have a sub-directory per namespace? Or do you instead have sub-directories based on what you think helps? Or do you generally avoid having sub-directories in your src directory?
Also, what files do you tend to keep under src? Obviously you keep the .cpp files there, but do you also keep the .o files there? I know there is a separate include directory for headers, do you tend to have the include directory mirror the layout of your source directory?
If you are in the habit of just keeping all source files immediately inside src, what do you do when you have hundreds of files?