def search_path(roots):
    """
    Generate a list of entries for the search path from a list of siteroot
    dirs.
    """
    from os.path import join
    suffixes = ['lhcb', join('lcg', 'releases'), join('lcg', 'app',
        'releases'), join('lcg', 'external'), 'contrib', 'cmake']
    for root in roots:
        for suff in suffixes:
            yield join(root, suff)
    try:
        from LbDevTools import DATA_DIR
        yield join(DATA_DIR, 'cmake')
    except ImportError:
        pass
