summaryrefslogtreecommitdiff
path: root/Source/cmparseMSBuildXML.py
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmparseMSBuildXML.py')
-rwxr-xr-xSource/cmparseMSBuildXML.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py
index 4e3f34e42b..4877e59134 100755
--- a/Source/cmparseMSBuildXML.py
+++ b/Source/cmparseMSBuildXML.py
@@ -3,7 +3,9 @@
# more information see here:
# http://blogs.msdn.com/vcblog/archive/2008/12/16/msbuild-task.aspx
-# cl.xml
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/cl.xml"
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/lib.xml"
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/link.xml"
#
# BoolProperty <Name>true|false</Name>
# simple example:
@@ -215,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:
@@ -233,10 +249,10 @@ class MSBuildToCMake:
for i in self.boolProperties:
if i.argumentProperty != "":
if i.attributes["ReverseSwitch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \"\", \"false\", cmVS7FlagTable::Continue},\n"
+ toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \"\", \"false\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \""+i.DisplayName+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
if i.attributes["Switch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\", cmVS7FlagTable::Continue},\n"
+ toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
toReturn += " {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.DisplayName+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
toReturn += "\n //String List Properties\n"
@@ -249,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"