openframeworks / openframeworks/projectGenerator

[feature] optional addon preprocessor flags

Open
#235 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
90
Forks
79
Avg merge
2d 9h
Merged PRs (30d)
5

Description

Hello, I wanted to share my solution to the problem referenced in this thread:

https://forum.openframeworks.cc/t/conditional-compiles-for-addons/1209/4

An example of this problem is a class abstraction addon I use for ofVideoPlayer, which optionally uses ofxHAPAVPlayer on MacOS and ofxOMXPlayer on RPi. On both they can default back to ofVideoPlayer, yet on other platforms the inclusion of the addons causes problems (or at least extra configuration).

https://github.com/Autr/projectGenerator/commits/addonflags

There are two changes in my fork here: the first adds an --addondefines, -D flag to the CLI. I've tried to be unobtrusive as the nested project parsing seems a bit fragile (perhaps a singleton pattern would be better?). The second adds a toggleable option for the flag when Advanced Options is selected in the frontend.

The end result is a list of addon flags added to the generated project, ie. OFXADDON_OFXHAPAVPLAYER OFXADDON_OFXOMXPLAYER.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the addonflags commits in the linked fork and the projectGenerator CLI and Advanced Options entry points. Confirm the -D/--addondefines input is carried into generated projects as OFXADDON_* definitions, and that the frontend toggle works when Advanced Options is selected.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.