summaryrefslogtreecommitdiffstats
path: root/Source/cmparseMSBuildXML.py
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:42:58 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:18:39 (GMT)
commit7bbaa4283de26864b2e55e819db0884771585467 (patch)
treeecb748dbe41a13d8bdea77acd0049cde999d933e /Source/cmparseMSBuildXML.py
parentbe9db98946b7918f279812fd0616abb650eebed0 (diff)
downloadCMake-7bbaa4283de26864b2e55e819db0884771585467.zip
CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.gz
CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.bz2
Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
Diffstat (limited to 'Source/cmparseMSBuildXML.py')
-rwxr-xr-xSource/cmparseMSBuildXML.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py
index 4877e59..a0c7ec4 100755
--- a/Source/cmparseMSBuildXML.py
+++ b/Source/cmparseMSBuildXML.py
@@ -9,7 +9,7 @@
#
# BoolProperty <Name>true|false</Name>
# simple example:
-# <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers"
+# <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers"
# Category="Optimization" Switch="Oy">
# <BoolProperty.DisplayName> <BoolProperty.Description>
# <CLCompile>
@@ -67,7 +67,7 @@
# <Optimization>MaxSpeed</Optimization>
# example for O1 would be this:
# <Optimization>MinSpace</Optimization>
-#
+#
# StringListProperty
# <StringListProperty Name="PreprocessorDefinitions" Category="Preprocessor" Switch="D ">
# <StringListProperty.DisplayName>
@@ -130,7 +130,7 @@ class Property:
if document is not None:
self.populate(document)
pass
-
+
#document = the dom file that's root node is the Property node (ex. if you were parsing a BoolProperty the root node should be something like <BoolProperty Name="RegisterOutput" Category="General" IncludeInCommandLine="false">
#spaces = do not use
def populate(self,document, spaces = ""):
@@ -155,9 +155,9 @@ class Property:
self.populate(child,spaces+"----")
pass
- #toString function
+ #toString function
def __str__(self):
- toReturn = self.prefix_type+self.suffix_type+":"
+ toReturn = self.prefix_type+self.suffix_type+":"
for i in self.attributeNames:
toReturn += "\n "+i+": "+self.attributes[i]
if self.argumentProperty != "":
@@ -191,7 +191,7 @@ class MSBuildToCMake:
# self.<Name>Properties.append(Property("<Name>",[<List of attributes>],child))
#
#Replace <Name> with the name of the new property (ex. if property is StringProperty replace <Name> with String)
- #Replace <List of attributes> with a list of attributes in your property's root node
+ #Replace <List of attributes> with a list of attributes in your property's root node
#in the __init__ function add the line self.<Name>Properties = []
#
#That is all that is required to add new properties
@@ -236,7 +236,7 @@ class MSBuildToCMake:
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:
if i.argumentProperty == "":
@@ -254,7 +254,7 @@ class MSBuildToCMake:
if i.attributes["Switch"] != "":
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"
for i in self.stringListProperties:
if i.attributes["Switch"] == "":
@@ -289,7 +289,7 @@ class MSBuildToCMake:
for p in allList:
for i in p:
toReturn += "==================================================\n"+str(i).replace("\n","\n ")+"\n==================================================\n"
-
+
return toReturn
###########################################################################################
@@ -305,8 +305,8 @@ def main(argv):
for i in range(0,len(argv)):
if argv[i] == "-x":
xml_file = argv[i+1]
- if argv[i] == "-h":
- print help
+ if argv[i] == "-h":
+ print help
sys.exit(0)
pass
if xml_file == None: