[Cmake-commits] [cmake-commits] king committed cmLocalVisualStudio10Generator.cxx 1.4 1.5 cmLocalVisualStudioGenerator.cxx 1.18 1.19 cmLocalVisualStudioGenerator.h 1.11 1.12 cmVisualStudio10TargetGenerator.cxx 1.13 1.14

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 7 10:11:25 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv9496/Source

Modified Files:
	cmLocalVisualStudio10Generator.cxx 
	cmLocalVisualStudioGenerator.cxx 
	cmLocalVisualStudioGenerator.h 
	cmVisualStudio10TargetGenerator.cxx 
Log Message:
Do Windows command line escapes for VS 10 too

Until now the VS 10 generator did no Windows command-line escaping and
just did XML escapes.  This commit teaches the generator to use the same
command-line escape addition code used by other generators.  The script
construction method cmLocalVisualStudioGenerator::ConstructScript need
not do XML escapes.  Each VS generator version adds the XML escapes
necessary for that version.


Index: cmLocalVisualStudio10Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio10Generator.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmLocalVisualStudio10Generator.cxx	14 Jul 2009 18:16:46 -0000	1.4
--- cmLocalVisualStudio10Generator.cxx	7 Sep 2009 14:11:11 -0000	1.5
***************
*** 69,73 ****
  cmLocalVisualStudio10Generator::cmLocalVisualStudio10Generator()
  {
-   this->NeedXMLEscape = true;
  }
  
--- 69,72 ----

Index: cmLocalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** cmLocalVisualStudioGenerator.cxx	10 Jul 2009 13:12:37 -0000	1.18
--- cmLocalVisualStudioGenerator.cxx	7 Sep 2009 14:11:15 -0000	1.19
***************
*** 27,31 ****
    this->WindowsShell = true;
    this->WindowsVSIDE = true;
-   this->NeedXMLEscape = false;
  }
  
--- 27,30 ----
***************
*** 233,256 ****
        else
          {
!         if(this->NeedXMLEscape)
!           {
!           std::string arg = commandLine[j];
!           cmSystemTools::ReplaceString(arg, "&", "&");
!           cmSystemTools::ReplaceString(arg, "<", "&lt;");
!           cmSystemTools::ReplaceString(arg, ">", "&gt;");
!           if(arg.find(" ") != arg.npos)
!             {
!             std::string q("\"");
!             arg = q + arg +q;
!             }
!           script += arg;
!           //script += this->EscapeForShell(arg.c_str(),
!           //escapeAllowMakeVars);
!           }
!         else
!           {
!           script += this->EscapeForShell(commandLine[j].c_str(),
                                         escapeAllowMakeVars);
-           }
          }
        }
--- 232,237 ----
        else
          {
!         script += this->EscapeForShell(commandLine[j].c_str(),
                                         escapeAllowMakeVars);
          }
        }

Index: cmVisualStudio10TargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmVisualStudio10TargetGenerator.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -C 2 -d -r1.13 -r1.14
*** cmVisualStudio10TargetGenerator.cxx	5 Aug 2009 14:45:10 -0000	1.13
--- cmVisualStudio10TargetGenerator.cxx	7 Sep 2009 14:11:20 -0000	1.14
***************
*** 28,31 ****
--- 28,38 ----
  #include "cmVS10LibFlagTable.h"
  
+ static std::string cmVS10EscapeXML(std::string arg)
+ {
+   cmSystemTools::ReplaceString(arg, "&", "&amp;");
+   cmSystemTools::ReplaceString(arg, "<", "&lt;");
+   cmSystemTools::ReplaceString(arg, ">", "&gt;");
+   return arg;
+ }
  
  cmVisualStudio10TargetGenerator::
***************
*** 290,299 ****
        i != configs->end(); ++i)
      {
!     std::string script = 
!       lg->ConstructScript(command.GetCommandLines(),
!                           command.GetWorkingDirectory(),
!                           i->c_str(),
!                           command.GetEscapeOldStyle(),
!                           command.GetEscapeAllowMakeVars());
      this->WritePlatformConfigTag("Message",i->c_str(), 3);
      (*this->BuildFileStream ) << comment << "</Message>\n";
--- 297,308 ----
        i != configs->end(); ++i)
      {
!     std::string script =
!       cmVS10EscapeXML(
!         lg->ConstructScript(command.GetCommandLines(),
!                             command.GetWorkingDirectory(),
!                             i->c_str(),
!                             command.GetEscapeOldStyle(),
!                             command.GetEscapeAllowMakeVars())
!         );
      this->WritePlatformConfigTag("Message",i->c_str(), 3);
      (*this->BuildFileStream ) << comment << "</Message>\n";
***************
*** 1203,1212 ****
      script += pre;
      pre = "\n";
!     script += 
!       lg->ConstructScript(command.GetCommandLines(),
!                           command.GetWorkingDirectory(),
!                           configName.c_str(),
!                           command.GetEscapeOldStyle(),
!                           command.GetEscapeAllowMakeVars());
      }
    this->WriteString("<Message>",3);
--- 1212,1223 ----
      script += pre;
      pre = "\n";
!     script +=
!       cmVS10EscapeXML(
!         lg->ConstructScript(command.GetCommandLines(),
!                             command.GetWorkingDirectory(),
!                             configName.c_str(),
!                             command.GetEscapeOldStyle(),
!                             command.GetEscapeAllowMakeVars())
!         );
      }
    this->WriteString("<Message>",3);

Index: cmLocalVisualStudioGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudioGenerator.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C 2 -d -r1.11 -r1.12
*** cmLocalVisualStudioGenerator.h	10 Jul 2009 13:12:38 -0000	1.11
--- cmLocalVisualStudioGenerator.h	7 Sep 2009 14:11:18 -0000	1.12
***************
*** 57,61 ****
    void InsertNeedObjectNames(const std::vector<cmSourceGroup>& groups,
                               std::map<cmStdString, int>& count);
-   bool NeedXMLEscape;
    std::set<const cmSourceFile*> NeedObjectName;
    friend class cmVisualStudio10TargetGenerator;
--- 57,60 ----



More information about the Cmake-commits mailing list