def METHOD_NAME(path):
    if path.endswith('.app') and os.path.isdir(path):
        path = os.path.join(path, 'Contents', 'MacOS', os.path.basename(path))
    lines = check_string_output(['otool', '-L', path]).split('\n')[1:]
    outputs = []
    if path.endswith('.dylib'):
        outputs.append(path);
    for line in lines:
        name = line.split('(')[0].strip()
        if name.startswith('@executable_path/'):
            name = os.path.join(path, name[len('@executable_path/'):])
        if name.startswith('@loader_path/'):
            name = os.path.join(path, name[len('@loader_path/'):])
        # todo: search rpath
        if not name.startswith('/'):
            continue
        # skip system libraries
        if name.startswith('/usr/lib') or name.startswith('/System'):
            continue
        # skip Frameworks (TODO: support frameworks, except Qt's framewroks)
        if re.search(r'(\w+)\.framework/Versions/[A-Z0-9]/(\1)$', name):
            continue
        # if file not found
        if not os.path.exists(name):
            raise IOError('broken dependency: file %s not found' % name)
        outputs.append(os.path.normpath(name))
    return outputs