aboutsummaryrefslogtreecommitdiff
path: root/scripts/build/glob_recursive.py
blob: db6eb80d37977e6fd1f5e80b3bd81575c3690cd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def GlobRecursive(pattern, nodes=['.']):
    import SCons
    import glob
    fs = SCons.Node.FS.get_default_fs()
    Glob = fs.Glob

    results = []
    for node in nodes:
        nnodes = []
        for f in Glob(str(node) + '/*', source=True):
            if type(f) is SCons.Node.FS.Dir:
                nnodes.append(f)
        results += GlobRecursive(pattern, nnodes)
        results += Glob(str(node) + '/' + pattern, source=True)
    return results