ofxAddons template understanding ADDON_INCLUDES_EXCLUDE for OSX

I have some code that I am using that I would like to turn into an addon, however I am having trouble creating the addon_config.mk so I can share this code. The GitHub - openframeworks/ofxAddonTemplate: an empty ofxAddon folder structure for easy creating your own addon for openFrameworks repo is out of data I think - that last changes are from 8 years ago.

When I look inside the source for the project generator I can find this section that seems show me all the optional varables:

case OSX:
		return (variable == "ADDON_DEPENDENCIES" || variable == "ADDON_INCLUDES" ||
				variable == "ADDON_CFLAGS" || variable == "ADDON_CPPFLAGS" ||
				variable == "ADDON_LDFLAGS"  || variable == "ADDON_LIBS" || variable == "ADDON_PKG_CONFIG_LIBRARIES" ||
				variable == "ADDON_FRAMEWORKS" ||
				variable == "ADDON_SOURCES" || variable == "ADDON_OBJC_SOURCES" || variable == "ADDON_CPP_SOURCES" || variable == "ADDON_HEADER_SOURCES" ||
				variable == "ADDON_DATA" ||
				variable == "ADDON_LIBS_EXCLUDE" || variable == "ADDON_SOURCES_EXCLUDE" || variable == "ADDON_INCLUDES_EXCLUDE" || variable == "ADDON_FRAMEWORKS_EXCLUDE" ||
				variable == "ADDON_DLLS_TO_COPY" ||
				variable == "ADDON_DEFINES");

But I am not sure what many of these mean or how to use them. I have tried several variations to achieve what I want but do not get the results.

Issue 1. The source folder I am working with is from another library. It needs some specific set- I can only actually have a single header file from that folder included and referenced in the project, but the folder needs to be added to header search paths. How can I exclude all the files except for one from a folder, and add that folder to header search paths in my xcode project?

Next there are some dylib lib files I need to add to the link binary with libraries, I have tried adding these using
ADDON_LIBS += path/to./lib.dylib

But the resulting project does not have the libs linked when I open it.

Are there some more comprehensive instructions somewhere that show how to use the addon_config.mk?

Any advice on these specific circumstances would also be great.

Cheers
Fred

I’ve always found the ofxOpenCv addon to be a decent reference

Thanks for the reply, yes I had looked at the openCV addon and it helped to clear things up.

I have things wokring now, just in case anyone else finds this helpful:

To add specific files to Xcode I used the following pattern:

ADDON_SOURCES =
ADDON_SOURCES += src/mongoc/mongoc.h
ADDON_SOURCES += src/libbson/bson.h
ADDON_SOURCES += src/ofxMongoDB.h
ADDON_SOURCES += src/ofxMongoDB.cpp

To add the folders that contain these and other files to the header files search paths I used this:

ADDON_HEADER_SOURCES = src/mongoc/
ADDON_HEADER_SOURCES += src/libbson/

To add the libraries I used this:

ADDON_LIBS = 
ADDON_LIBS += libs/libbson/libbson-1.0.0.0.0.dylib
ADDON_LIBS += libs/libmongoc/libmongoc-1.0.0.0.0.dylib

A note on the libraries, I had thought they would appear in the link binary with libraries section of the xcode settings. They dont appear there but they are found by the compiler using this pattern in the addon_config.mk.

It is not the most obvious system but I got it working. I guess due to lack of experience I find the disjunct between the parameters used by the project generator and the setting names in the compiler a little confusing. As always a bit of trial and error helped me along.

Cheers