from pathlib import Path


def findFiles(basedir, patterns):
    """find files relative to a base directory according to a list of patterns.
    Returns a set of file names."""
    files = set()
    path = Path(basedir)
    for pattern in patterns:
        files.update([m.relative_to(basedir).as_posix() for m in path.glob(pattern)])
    return files