import os, os.path
projects = [("Swift", "Swift\QtUI\Swift.exe"), ("Slimber", "Slimber\Qt\Slimber.exe")]
for (project, outputbin) in projects :
if not os.path.exists(project) :
os.mkdir(project)
output = open(os.path.join(project, project + ".vcproj"), "w")
headers = []
sources = []
for root, dirs, files in os.walk(os.path.join("..", "..", project)) :
for file in files :
if file.endswith(".h") :
headers.append('')
elif file.endswith(".cpp") :
sources.append('')
output.write("""
%(sources)s
%(headers)s
""" % { "project": project, "output" : outputbin, "headers" : '\n'.join(headers), "sources": '\n'.join(sources) })
output.close()