evanmiller/ChicagoBoss — pull request #160 by bernardd (2012-10-04 02:42:03+00:00)
Title: Add include_dirs configuration option

This change adds a configuration option to allow -including of files from
directories other than the default directory. This is useful (indeed,
necessary) when using ChicagoBoss as part of a larger project with, say,
records defined externally that you want to pull in and use. To use, add a line
like this to boss.config in the 'boss' section:

{include_dirs, ["../app/src/include", "../some_other_app/include"]}

I realise that the reason something like this probably doesn't currently exist (unless I missed something) is that CB is designed to be used as the top-level system to look after everything that you write. However, in our situation we had an existing pile of code and wanted to add in a CB app (having also looked at a bunch of other web frameworks and not finding anything else that suited our needs quite as well). Our CB app, however, needed to be able to include files from outside its source tree and the include path for the compiler was hard coded and not able to be added to. Putting a full path in the -include directive worked for simple cases, but not where the included files in turn included ones of their own (at least, not without going and modifying all our headers, which already worked fine with the rest of our build system).

My point with all this at is that I understand (and won't be offended :)) if you reject this on the basis that it's not in keeping with how CB is meant to be used. But it might be useful to other crazy people like us :)