def METHOD_NAME(ctx):
    print('→ building from ' + ctx.path.abspath())
    if len(ctx.env.EXAMPLE_LIST):
        def build_example(prog_name, other=None):
            files = ['%s.cpp' % f for f in [prog_name] + (other or [])]
            # If an `other` program has files in a directory we need
            # to add an additional includes
            includes = ['.', '..']
            ctx(features='c cxx cxxprogram check_static',
                source = ctx.path.ant_glob(' '.join(files)),
                target = 'essentia_' + prog_name,
                includes = includes,
                use = 'essentia ', # + ctx.env.USE_LIBS,
                install_path = '${PREFIX}/bin')
            @feature('check_static')
            @before_method('apply_link')
            def check_static(self):
                if ctx.env.WITH_STATIC_EXAMPLES:
                    if sys.platform != 'darwin':
                        # skip -static flag on OSX, otherwise it will complain because
                        # static linking to system libraries is not supported on OSX
                        self.env.LINKFLAGS = ['-static']
                        self.env.SHLIB_MARKER = self.env.STLIB_MARKER
        for e in example_sources_fileio + example_sources_with_gaia + example_sources_with_tensorflow:
            if e[0] in ctx.env.EXAMPLE_LIST:
                if len(e) == 1:
                    build_example(e[0])
                elif len(e) == 2:
                    build_example(e[0], e[1])
    if ctx.env.WITH_VAMP:
        ctx.env.INCLUDES += [ '3rdparty/vamp-plugin-sdk-2.4' ]
        vamp_sdk_files = ctx.path.parent.ant_glob('3rdparty/vamp-plugin-sdk-2.4/src/vamp-sdk/*.cpp')
        # remove this file, it is already included by FFT.cpp
        vamp_sdk_files = [ f for f in vamp_sdk_files if os.path.basename(f.srcpath()) != 'FFTimpl.cpp' ]
        if sys.platform == 'darwin':
            install_path = os.environ['HOME'] + '/Library/Audio/Plug-Ins/Vamp'
        elif sys.platform.startswith('linux'):
            install_path = '${PREFIX}/vamp'
        else:
            install_path = None
        vamp = ctx.shlib(
            source   = ctx.path.ant_glob('vamp*.cpp') + vamp_sdk_files,
            target   = 'vamp_essentia',
            includes = [ '.', '..', '../3rdparty/vamp-plugin-sdk-2.4' ],
            use      = 'essentia ', #+ ctx.env.USE_LIBS,
            install_path = install_path)