Skip to content

Instantly share code, notes, and snippets.

@bakercp
Created June 19, 2013 15:55
Show Gist options
  • Save bakercp/5815450 to your computer and use it in GitHub Desktop.
Save bakercp/5815450 to your computer and use it in GitHub Desktop.
ofxSyphon addon_config.mk
################################################################################
# ADDON_CONFIG.MK
# This file is intended to be included in addons used with openFrameworks.
# The addon_config.mk file serves two primary purposes.
#
# 1. Addon Information and Metadata
#
# Addons are an incredibly popular way to extend the functionality of
# openFrameworks. By describing your addon using the metadata fields
# below, users will be able to find and understand your addon more easily,
# and sites such as http://ofxAddons.com will be able to parse and
# present the meta data more easily.
#
# 2. Addon Configuration
#
# Addons should first be formatted according to the standard ofxAddonTemplate
# found here:
#
# https://github.com/openFrameworks/ofxAddonTemplate
#
# The advantage of using this template is that in most cases, the makefile
# system will automatically discover all of the sources, headers, libraries
# etc. that are needed to compile your addon on any given platform.
#
# Of course there are exceptions and edge cases that are difficult to
# automatically configure. These might include addons that use
# third party libraries, frameworks or conditionally pre-installed libraries
# rather than including library binaries in the addon respository itself.
# Rules for linking order, search paths and custom flags can all be defined
# on a per-platform basis below. See each variable for more information.
#
# Each variable can be applied conditionally on a per-platform basis by
# placing the variable below each platform header below. For instance,
# if one wants to exclude the file $(PATH_OF_ADDON)/libs/fooLib/foo.a from
# ALL platforms, but only wants to exclude the file
# $(PATH_OF_ADDON)/libs/fooLib/fooBar.a from linux64, one might write the
# following:
#
# meta:
# [YOUR METADATA]
# ...
# [YOUR METADATA]
# common:
# ADDON_EXCLUSIONS = $(PATH_OF_ADDON)/libs/fooLib/foo.a
#
# linux64:
# ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/fooLib/fooBar.a
#
# If a platform-specific variable is assigned using an assignment operator
# such as (=) or (:=), variable assignments done in the "common:" section
# will be ignored.
#
# Any variables assigned in the addon_config.mk file will OVERRIDE the
# versions of that variable that might normally be auto-discovered based
# on the ofxAddonTemplate format.
#
################################################################################
meta:
ADDON_NAME = ofxSyphon
ADDON_DESCRIPTION = An OF add-on for using the Syphon framework.
ADDON_AUTHORS = astellato
ADDON_TAGS = "video" "gpu" "graphics"
ADDON_URL = https://github.com/astellato/ofxSyphon
ADDON_GIT_URL = https://github.com/astellato/ofxSyphon
ADDON_VERSION = 1.0.0
ADDON_LICENSE = MIT License
ADDON_MINIMUM_OF_VERSION = 0.7.4
ADDON_SUPPORTED_PLATFOMRS = android/armeabi
ADDON_SUPPORTED_PLATFOMRS += android/armeabi-v7a
ADDON_SUPPORTED_PLATFOMRS += ios
ADDON_SUPPORTED_PLATFOMRS += linux
ADDON_SUPPORTED_PLATFOMRS += linux64
ADDON_SUPPORTED_PLATFOMRS += linuxarmv6l
ADDON_SUPPORTED_PLATFOMRS += linuxarmv7l
ADDON_SUPPORTED_PLATFOMRS += osx
ADDON_SUPPORTED_PLATFOMRS += vs2010
ADDON_SUPPORTED_PLATFOMRS += win_cb
common:
################################################################################
# ADDON_DEPENDENCIES
# A space-separated list of ofxAddons required for THIS ofxAddon to compile.
# For instance, if this addon requires ofxXmlSettings and ofxOpenCv, one can
# define the following:
#
# ADDON_DEPENDENCIES := ofxOpenCv
# ADDON_DEPENDENCIES += ofxXmlSettings
#
# Note: Be sure to leave a leading space when using a += operator to add
# items to the list.
################################################################################
ADDON_DEPENDENCIES := ofxLibmagic
################################################################################
# ADDON_HEADER_SEARCH_PATHS
# A space-separated list of FULLY-QUALIFIED header search paths fo this addon.
# These can be formed using the directory or absolute paths
ADDON_HEADER_SEARCH_PATHS := /usr/local/include
ADDON_HEADER_SEARCH_PATHS += $(PATH_OF_ADDON)/thisOne
ADDON_LIBRARY_SEARCH_PATHS := $(PATH_OF_ADDON)/libs/JUNK
ADDON_FRAMEWORK_SEARCH_PATHS := $(PATH_OF_ADDON)/libs/Syphon/lib/osx/
ADDON_FRAMEWORK_SEARCH_PATHS += $(PATH_OF_ADDON)/JUNK
ADDON_SOURCES := $(PATH_OF_ADDON)/src/ofxSyphonServer.mm
ADDON_DEFINES :=
ADDON_FRAMEWORKS :=
ADDON_SHARED_LIBRARIES:=
ADDON_STATIC_LIBRARIES := JUNK_STATIC
ADDON_PKG_CONFIG_LIBRARIES := JUNK_PKG_CONFIG
# any special flag that should be passed to the compiler when using this
# addon
#ADDON_CFLAGS = -F$(OF_ADDONS_PATH)/ofxSyphon/libs/Syphon/lib/osx
ADDON_CFLAGS :=
ADDON_LDFLAGS :=
# some addons need resources to be copied to the bin/data folder of the project
# specify here any files that need to be copied, you can use wildcards like * and ?
ADDON_DATA := $(PATH_OF_ADDON)/libs/syphon/shared/XXX
# when parsing the file system looking for libraries exclude this for all or
# a specific platform
# FULLY QUALIFIED PATHH
ADDON_EXCLUSIONS := $(PATH_OF_ADDON)/libs/exclude%
ADDON_EXCLUSIONS := $(PATH_OF_ADDON)/libs/exclude%
ADDON_EXCLUSIONS := $(PATH_OF_ADDON)/src/IgnoreMe.cpp
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/Syphon/lib/osx/another%
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/Syphon/lib/osx/another
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/AnotherLib/include%
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/AnotherLib/include
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/AnotherLib/src%
ADDON_EXCLUSIONS += $(PATH_OF_ADDON)/libs/AnotherLib/src
ADDON_EXPORTS :=
osx:
# binary libraries, these will be usually parsed from the file system but some
# libraries need to passed to the linker in a specific order
ADDON_LIBRARIES :=
linux64:
linux:
win_cb:
linuxarmv6l:
linuxarmv7l:
android/armeabi:
android/armeabi-v7a:
@bilderbuchi
Copy link

@bakercp ADDON_GIT_URL = https://github.com/astellato/ofxSyphon - this is no git URL. please make it so that it takes the URL of a git repo, i.e. git://github.com/astellato/ofxSyphon.git, so that we are not dependent on Github page structure, and can take any git repo.

@bilderbuchi
Copy link

ADDON_DEPENDENCIES := ofxLibmagic - would be awesome to be able to specify versions here. I mean, we have addon versions in the metadata, would be great to make use of that. we could split at optional, mandatory version comparators e.g.
ADDON_DEPENDENCIES := ofxLibmagic > 0.2
ADDON_DEPENDENCIES := ofxLibmagic <= 0.2
ADDON_DEPENDENCIES := ofxLibmagic = 0.2
but ADDON_DEPENDENCIES := ofxLibmagic 0.2 will error out.

is that even possible with a sane amount of make magic? ^^

@bilderbuchi
Copy link

$(PATH_OF_ADDON) here's potential confusion if OF means openframeworks. maybe better to call it $(ADDON_ROOT)?

@bilderbuchi
Copy link

minor: indentation is funky here, i guess tabs and spaces are mixed?

@bilderbuchi
Copy link

ADDON_FRAMEWORK_SEARCH_PATHS := $(PATH_OF_ADDON)/libs/Syphon/lib/osx/: I know syphon is mac-only, but in principle, this line should go into the osx section (with a += operator). would this then override the ADDON_FRAMEWORK_SEARCH_PATHS := $(PATH_OF_ADDON)/JUNK that will still be left in the common section, or be added to it?
it might be good to clarify that where you talk about the assignment operators and the common section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment