Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is an addon present? #9

Open
bakercp opened this issue Jun 15, 2013 · 3 comments
Open

is an addon present? #9

bakercp opened this issue Jun 15, 2013 · 3 comments

Comments

@bakercp
Copy link
Member

bakercp commented Jun 15, 2013

@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 class ofxMyAddon.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:

#ifdef DEFINE_OFX_MYADDON`

my special class that required OFX_MYADDON

#endif

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

@bilderbuchi
Copy link
Member

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.

@bakercp
Copy link
Member Author

bakercp commented Jun 16, 2013

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.

@gsautr
Copy link

gsautr commented Jun 11, 2018

Hello, was the feature suggested by @bilderbuchi added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants