root = '/path/to/project'
finit = '__init__.py'

def visitor(arg, dirname, fnames):
    fnames = [fname for fname in fnames if isdir(fname)]
print('adding %s to : %s' % (finit, dirname))
with open(join(dirname, finit), 'w') as file_:
    file_.write('')
walk(root, visitor, None)
Как сгенерировать __init__.py во всех подкаталогах текущего каталога в cmake?