Modifying ADDON_SOURCES in

I’m having some trouble compiling my fork of ofxOpenNI (experimental branch, using OpenNI2 + Nite2) with the makefile system. For some reason any app I make that tries to include ofxOpenNI (by including it in can’t find ofxOpenNI’s src/ directory. E.g: make inside of the project errors with:

ofxOpenNI.h: No such file or directory
 #include "ofxOpenNI.h"

It seems like the simple fix would be to edit ADDON_SOURCES in ofxOpenNI’s file to explicitly include it’s src/ directory, but any of the following examples haven’t seemed to work:

ADDON_SOURCES = ../src/specific_file.h
ADDON_SOURCES = ../../../addons/ofxOpenNI/src/specific_fil.h

In all instances my app, in apps/myApps/OpenNI/ can’t find addons/ofxOpenNI/src/ files.

Hmm… Not quite sure what I changed but I’ve got it working now. Here is something that I noticed in the process, and maybe it is apparent to others… But maybe it could help someone in the future.

Adding MAKEFILE_DEBUG=true inside of the project’s config.make showed that only one of the four ofxOpenNI/src files are actually being included:


Where I thought it should read:


But apparently ADDONS_SOURCES only finds .cpp files, not .h files. For that you’ve got to use ADDONS_INCLUDES.

i think some old addons did something like:

# documentation coment

which now overwrites the sources (or any other variable) the correct syntax would be to leave those example variables commented, take a look at the opencv addon or the addon template:

# documentation coment
1 Like

Leaving them commented out was what worked :slight_smile: thanks!