I posted this at the end of this thread but it may have been lost in there and I think it deserves a request in its own right: How to Include an Entire Source Tree
I’m a big fan of the module format, apart from it being a really easy way to include code across projects, it quietly promotes a much better coding style of separating components and programming in a more generic, library orientated way.
However, the whole project re-builds can be annoying when you’re simply modifying some inlined methods or do a git-pull etc.
I’ve been wondering if there is way modules can be included on a more opt-in basis and I don’t think this would be too hard to do.
• In the Projucer you’d just have a box next to the module that you could tick to “Generate separate header”
• If this is ticked it wouldn’t get added to
JuceHeader.h but it’s own file would be created that looked like below:
module_name.h #pragma once #include "AppConfig.h" #include <module_name/module_name.h>
• Then, in your app code you could simply include the module where required, like you would boost or the STL. E.g.
• The search path would already be included because it’s within
JUCE_MODULE_AVAILABLE_module_name is still defined in
• An eventually we could ditch this an use C++17’s
I think this should work but I’ve not fully tested it yet. Can anyone spot any obvious holes?