From 134d8dee1e3e5258eefd88e1a9f28e3cf16d09cc Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Tue, 27 Oct 2009 11:35:37 -0400 Subject: [PATCH] BUG: hardcore some values so output matches cmVS10CLFlagTable.h (addresses bug #9753) --- Source/cmparseMSBuildXML.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py index 45190e918..4877e5913 100755 --- a/Source/cmparseMSBuildXML.py +++ b/Source/cmparseMSBuildXML.py @@ -217,11 +217,25 @@ class MSBuildToCMake: def toCMake(self): toReturn = "static cmVS7FlagTable cmVS10CxxTable[] =\n{\n" toReturn += "\n //Enum Properties\n" + lastProp = {} for i in self.enumProperties: + if i.attributes["Name"] == "CompileAsManaged": + #write these out after the rest of the enumProperties + lastProp = i + continue for j in i.values: - toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n" + #hardcore Brad King's manual fixes for cmVS10CLFlagTable.h + if i.attributes["Name"] == "PrecompiledHeader" and j.attributes["Switch"] != "": + toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n" + else: + #default (normal, non-hardcoded) case + toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n" toReturn += "\n" + if lastProp != {}: + for j in lastProp.values: + toReturn+=" {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n" + toReturn += "\n" toReturn += "\n //Bool Properties\n" for i in self.boolProperties: @@ -251,7 +265,16 @@ class MSBuildToCMake: toReturn += "\n //String Properties\n" for i in self.stringProperties: if i.attributes["Switch"] == "": - toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n"; + if i.attributes["Name"] == "PrecompiledHeaderFile": + #more hardcoding + toReturn += " {\"PrecompiledHeaderFile\", \"Yc\",\n" + toReturn += " \"Precompiled Header Name\",\n" + toReturn += " \"\", cmVS7FlagTable::UserValueRequired},\n" + toReturn += " {\"PrecompiledHeaderFile\", \"Yu\",\n" + toReturn += " \"Precompiled Header Name\",\n" + toReturn += " \"\", cmVS7FlagTable::UserValueRequired},\n" + else: + toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n"; else: toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+i.attributes["Separator"]+"\",\n \""+i.DisplayName+"\",\n \"\", cmVS7FlagTable::UserValue},\n"