Regarding the files layout there are not too many alternatives.
The partitioning is typically one of the following (package here is a single library or binary):
- .../project/.../package/module.{c,h}
- .../project/.../{src,include}/package/module.{c,h} // non-interface headers go to src
- .../project/.../package/{src,include}/module.{c,h} // non-interface headers go to src
The partitioning (1) is convenient in that all files belonging to particular package are stored in a single directory, so package can be easily moved around, but with this approach detaching API headers from private ones and detecting API changes is not trivial.
(2) and (3) are very similar, they make API release and API changes detection trivial, while (2) is slightly easier for the case when you always release the whole project and (3) is slightly better when you release individial packages (e.g. for patching purposes)
In any C/C++ project there is typically the following common packages:
- Common macros, and data types
- Logging package
- Application bootstrap package (in case there are
more than 1 binaries in the project).