Open bakercp opened 11 years ago
Hm, is there no way we can do this automatically, e.g. during the build process generate the defines from the list of parsed addons? The make-work character of this define (i.e. have a define which basically echoes the filename) makes me feel we should be able to automate this?
The problem I see is that we have to get every addon author to add this special include, and it will be "only" useful for a subset of users, i.e. people who write addons which depend on some special functionality in another addon. It would be better if we could have a system where the dependent addon author would be the only one who would have to do something (i.e. the ifded above) to make this work for him.
Good point @bilderbuchi -- it's very easy to do with the new makefile system, but wasn't sure how it would play out in other project files. I suppose an update project generator could also take care of this.
Hello, was the feature suggested by @bilderbuchi added?
@obviousjim and I were talking about conditional includes for addon header / impl files and thought that it might be useful to suggest that all addons specify a
#define
that announces the addon's presence to the system. That way other addons can conditionally include bridge classes. A proposal would be something like ... in the main classofxMyAddon.h
a define like:#define DEFINE_OFX_MYADDON
And then in the bridge classes of a dependent addon like
ofxMyAddonThatDependsOnofxMyAddon.h
one would do something like:Right now it is possible to specify required addon dependencies in
addon_config.mk
, but this is addressing the situation where an addon can optionally add features if an addon is present.@arturoc @atduskgreg @bilderbuchi