Modifying ADDON_SOURCES in addons_config.mk

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 addons.mk) 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 addons_config.mk file to explicitly include it’s src/ directory, but any of the following examples haven’t seemed to work:

ADDON_SOURCES = ../src
--or--
ADDON_SOURCES = ../src/specific_file.h
--or--
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:

---PROJECT_ADDONS_SOURCE_FILES---
/home/brannondorsey/Documents/code/of_v0.9.0_linux64_release/addons/ofxOpenNI/src/ofxOpenNI.cpp

Where I thought it should read:

/home/brannondorsey/Documents/code/of_v0.9.0_linux64_release/addons/ofxOpenNI/src/ofxOpenNI.cpp
/home/brannondorsey/Documents/code/of_v0.9.0_linux64_release/addons/ofxOpenNI/src/ofxOpenNI.h
/home/brannondorsey/Documents/code/of_v0.9.0_linux64_release/addons/ofxOpenNI/src/ofxOpenNITypes.h
/home/brannondorsey/Documents/code/of_v0.9.0_linux64_release/addons/ofxOpenNI/src/ofxOpenNIUtils.h

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
ADDON_SOURCES = 

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
# ADDON_SOURCES = 
1 Like

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