I'm using GNU autotools to build a library (let's call it libfoo) which will probably contain lots of header files, as I use a "one header per source file" approach.
If I were to use libfoo in another project, I would probably not want to include them at the granularity in which they are defined in the source, but would want to include them in larger chunks.
My first approach to this was to make a header foo.h
and include the other headers into that header, so a user would only have to include foo.h
, but this would still require installing the smaller headers (thus cluttering up the users include directory), as includes in foo.h
aren't handled during libfoo's build, but only when the header is used.
I know I could just define everything that is part of the public API in foo.h
, but that would result in a big cluttered header file and I prefer not to do that.
What is the usual approach to this?