[odb-users] Cannot suppress inline file creation

Boris Kolpackov boris at codesynthesis.com
Thu Feb 7 11:10:26 EST 2013


Hi Ben,

Ben Morgan <neembi at gmail.com> writes:

> Well... perhaps I am doing something very unnatural...

I would recommended the following way to handle multi-header
libraries:

1. Choose a header prefix. Normally, if your library is called,
   say, libfoo, then it will be foo/.

2. Always use this prefix to include headers from your library
   (both external users and internal source code files). And use
   bracket includes instead of quote includes. For example:

   #include <foo/bar.hpp>
   #include <foo/odb/bar.hpp>

3. Use -I option to specify the location of foo/. When installed,
   the headers go into /usr/include/foo/..., so no -I is required
   in this case.

It is quite easy to amend the ODB-generated files to follow this
scheme. Simply pass the following two options to the ODB compiler:

--include-prefix foo/ --include-with-brackets

Boris



More information about the odb-users mailing list