Browse Source

ENH: change InitialPass to take a const reference to the argument string, to avoid changes to the file cache

Bill Hoffman 24 năm trước cách đây
mục cha
commit
baa28efd10
100 tập tin đã thay đổi với 143 bổ sung137 xóa
  1. 2 2
      Source/cmAbstractFilesCommand.cxx
  2. 1 1
      Source/cmAbstractFilesCommand.h
  3. 2 1
      Source/cmAddCustomTargetCommand.cxx
  4. 1 1
      Source/cmAddCustomTargetCommand.h
  5. 2 2
      Source/cmAddDefinitionsCommand.cxx
  6. 1 1
      Source/cmAddDefinitionsCommand.h
  7. 2 2
      Source/cmAddDependenciesCommand.cxx
  8. 1 1
      Source/cmAddDependenciesCommand.h
  9. 2 2
      Source/cmAddExecutableCommand.cxx
  10. 1 1
      Source/cmAddExecutableCommand.h
  11. 2 2
      Source/cmAddLibraryCommand.cxx
  12. 1 1
      Source/cmAddLibraryCommand.h
  13. 1 1
      Source/cmAddTestCommand.cxx
  14. 1 1
      Source/cmAddTestCommand.h
  15. 1 1
      Source/cmAuxSourceDirectoryCommand.cxx
  16. 1 1
      Source/cmAuxSourceDirectoryCommand.h
  17. 2 2
      Source/cmBuildCommand.cxx
  18. 1 1
      Source/cmBuildCommand.h
  19. 1 1
      Source/cmBuildNameCommand.cxx
  20. 1 1
      Source/cmBuildNameCommand.h
  21. 3 3
      Source/cmCableClassSetCommand.cxx
  22. 1 1
      Source/cmCableClassSetCommand.h
  23. 3 2
      Source/cmCableWrapTclCommand.cxx
  24. 1 1
      Source/cmCableWrapTclCommand.h
  25. 1 1
      Source/cmCommand.h
  26. 1 1
      Source/cmConfigureFileCommand.cxx
  27. 1 1
      Source/cmConfigureFileCommand.h
  28. 1 1
      Source/cmConfigureGccXmlCommand.cxx
  29. 1 1
      Source/cmConfigureGccXmlCommand.h
  30. 2 2
      Source/cmElseCommand.cxx
  31. 1 1
      Source/cmElseCommand.h
  32. 1 1
      Source/cmEnableTestingCommand.h
  33. 1 1
      Source/cmEndForEachCommand.cxx
  34. 1 1
      Source/cmEndForEachCommand.h
  35. 1 1
      Source/cmEndIfCommand.cxx
  36. 1 1
      Source/cmEndIfCommand.h
  37. 2 1
      Source/cmExecProgramCommand.cxx
  38. 1 1
      Source/cmExecProgramCommand.h
  39. 2 2
      Source/cmFindFileCommand.cxx
  40. 1 1
      Source/cmFindFileCommand.h
  41. 2 1
      Source/cmFindLibraryCommand.cxx
  42. 1 1
      Source/cmFindLibraryCommand.h
  43. 1 1
      Source/cmFindPathCommand.cxx
  44. 1 1
      Source/cmFindPathCommand.h
  45. 3 2
      Source/cmFindProgramCommand.cxx
  46. 1 1
      Source/cmFindProgramCommand.h
  47. 2 2
      Source/cmForEachCommand.cxx
  48. 1 1
      Source/cmForEachCommand.h
  49. 1 1
      Source/cmGetFilenameComponentCommand.cxx
  50. 1 1
      Source/cmGetFilenameComponentCommand.h
  51. 2 2
      Source/cmIfCommand.cxx
  52. 1 1
      Source/cmIfCommand.h
  53. 3 3
      Source/cmIncludeCommand.cxx
  54. 1 1
      Source/cmIncludeCommand.h
  55. 2 2
      Source/cmIncludeDirectoryCommand.cxx
  56. 1 1
      Source/cmIncludeDirectoryCommand.h
  57. 1 1
      Source/cmIncludeRegularExpressionCommand.cxx
  58. 1 1
      Source/cmIncludeRegularExpressionCommand.h
  59. 2 2
      Source/cmInstallFilesCommand.cxx
  60. 1 1
      Source/cmInstallFilesCommand.h
  61. 2 2
      Source/cmInstallProgramsCommand.cxx
  62. 1 1
      Source/cmInstallProgramsCommand.h
  63. 2 2
      Source/cmInstallTargetsCommand.cxx
  64. 1 1
      Source/cmInstallTargetsCommand.h
  65. 1 1
      Source/cmLibraryCommand.h
  66. 2 2
      Source/cmLinkDirectoriesCommand.cxx
  67. 1 1
      Source/cmLinkDirectoriesCommand.h
  68. 2 2
      Source/cmLinkLibrariesCommand.cxx
  69. 1 1
      Source/cmLinkLibrariesCommand.h
  70. 3 2
      Source/cmLoadCacheCommand.cxx
  71. 1 1
      Source/cmLoadCacheCommand.h
  72. 4 3
      Source/cmMakeDirectoryCommand.cxx
  73. 1 1
      Source/cmMakeDirectoryCommand.h
  74. 3 5
      Source/cmMakefile.cxx
  75. 2 2
      Source/cmMakefile.h
  76. 2 2
      Source/cmMessageCommand.cxx
  77. 1 1
      Source/cmMessageCommand.h
  78. 1 1
      Source/cmOptionCommand.cxx
  79. 1 1
      Source/cmOptionCommand.h
  80. 1 1
      Source/cmOutputRequiredFilesCommand.cxx
  81. 1 1
      Source/cmOutputRequiredFilesCommand.h
  82. 1 1
      Source/cmProjectCommand.cxx
  83. 1 1
      Source/cmProjectCommand.h
  84. 2 2
      Source/cmSetCommand.cxx
  85. 1 1
      Source/cmSetCommand.h
  86. 1 1
      Source/cmSiteNameCommand.cxx
  87. 1 1
      Source/cmSiteNameCommand.h
  88. 2 2
      Source/cmSourceFilesCommand.cxx
  89. 1 1
      Source/cmSourceFilesCommand.h
  90. 2 2
      Source/cmSourceFilesRemoveCommand.cxx
  91. 1 1
      Source/cmSourceFilesRemoveCommand.h
  92. 1 1
      Source/cmSourceGroupCommand.cxx
  93. 1 1
      Source/cmSourceGroupCommand.h
  94. 2 2
      Source/cmSubdirCommand.cxx
  95. 1 1
      Source/cmSubdirCommand.h
  96. 1 1
      Source/cmSubdirDependsCommand.cxx
  97. 1 1
      Source/cmSubdirDependsCommand.h
  98. 2 2
      Source/cmTargetLinkLibrariesCommand.cxx
  99. 1 1
      Source/cmTargetLinkLibrariesCommand.h
  100. 3 2
      Source/cmUseMangledMesaCommand.cxx

+ 2 - 2
Source/cmAbstractFilesCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmAbstractFilesCommand.h"
 
 // cmAbstractFilesCommand
-bool cmAbstractFilesCommand::InitialPass(std::vector<std::string>& args)
+bool cmAbstractFilesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -49,7 +49,7 @@ bool cmAbstractFilesCommand::InitialPass(std::vector<std::string>& args)
     return false;
     }
   cmMakefile::SourceMap &Classes = m_Makefile->GetSources();
-  for(std::vector<std::string>::iterator j = args.begin();
+  for(std::vector<std::string>::const_iterator j = args.begin();
       j != args.end(); ++j)
     {   
     for(cmMakefile::SourceMap::iterator l = Classes.begin(); 

+ 1 - 1
Source/cmAbstractFilesCommand.h

@@ -56,7 +56,7 @@ public:
    * This is called when the command is first encountered in
    * the input file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 1
Source/cmAddCustomTargetCommand.cxx

@@ -41,8 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmAddCustomTargetCommand.h"
 
 // cmAddCustomTargetCommand
-bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
+  std::vector<std::string> args = argsIn;
   bool all = false;
   
   if(args.size() < 2 )

+ 1 - 1
Source/cmAddCustomTargetCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmAddDefinitionsCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmAddDefinitionsCommand.h"
 
 // cmAddDefinitionsCommand
-bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = args.begin();
+  for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
     {
     std::string str = *i;

+ 1 - 1
Source/cmAddDefinitionsCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmAddDependenciesCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmDependenciesCommand
-bool cmAddDependenciesCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddDependenciesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {
@@ -53,7 +53,7 @@ bool cmAddDependenciesCommand::InitialPass(std::vector<std::string>& args)
   cmTargets &tgts = m_Makefile->GetTargets();
   if (tgts.find(args[0]) != tgts.end())
     {
-    std::vector<std::string>::iterator s = args.begin();
+    std::vector<std::string>::const_iterator s = args.begin();
     ++s;
     for (; s != args.end(); ++s)
       {

+ 1 - 1
Source/cmAddDependenciesCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmAddExecutableCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmExecutableCommand
-bool cmAddExecutableCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {
@@ -50,7 +50,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string>& args)
     return false;
     }
 
-  std::vector<std::string>::iterator s = args.begin();
+  std::vector<std::string>::const_iterator s = args.begin();
   ++s;
   if (*s == "WIN32")
     {

+ 1 - 1
Source/cmAddExecutableCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmAddLibraryCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmLibraryCommand
-bool cmAddLibraryCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -54,7 +54,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string>& args)
   // otherwise it defaults to static library.
   int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS"));
   
-  std::vector<std::string>::iterator s = args.begin();
+  std::vector<std::string>::const_iterator s = args.begin();
   ++s;
   
   // If the second argument is "SHARED" or "STATIC", then it controls

+ 1 - 1
Source/cmAddLibraryCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmAddTestCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmExecutableCommand
-bool cmAddTestCommand::InitialPass(std::vector<std::string>& args)
+bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
 {
   // First argument is the name of the test
   // Second argument is the name of the executable to run (a target or external

+ 1 - 1
Source/cmAddTestCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This is called at the end after all the information

+ 1 - 1
Source/cmAuxSourceDirectoryCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmDirectory.h"
 
 // cmAuxSourceDirectoryCommand
-bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string>& args)
+bool cmAuxSourceDirectoryCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 || args.size() > 2)
     {

+ 1 - 1
Source/cmAuxSourceDirectoryCommand.h

@@ -68,7 +68,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmBuildCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmBuildCommand.h"
 
 // cmBuildCommand
-bool cmBuildCommand::InitialPass(std::vector<std::string>& args)
+bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {
@@ -56,7 +56,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string>& args)
     return true;
     }
   std::string makecommand;
-  std::string& makeprogram = args[1];
+  std::string makeprogram = args[1];
   m_Makefile->ExpandVariablesInString(makeprogram);
   if(makeprogram.find("msdev") != std::string::npos ||
      makeprogram.find("MSDEV") != std::string::npos )

+ 1 - 1
Source/cmBuildCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmBuildNameCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmBuildNameCommand.h"
 
 // cmBuildNameCommand
-bool cmBuildNameCommand::InitialPass(std::vector<std::string>& args)
+bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {

+ 1 - 1
Source/cmBuildNameCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 3 - 3
Source/cmCableClassSetCommand.cxx

@@ -43,14 +43,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmTarget.h"
 
 // cmCableClassSetCommand
-bool cmCableClassSetCommand::InitialPass(std::vector<std::string>& args)
+bool cmCableClassSetCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if(args.size() < 2)
+  if(argsIn.size() < 2)
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  
+  std::vector<std::string> args = argsIn;
   // First, we want to expand all CMAKE variables in all arguments.
   for(std::vector<std::string>::iterator a = args.begin();
       a != args.end(); ++a)

+ 1 - 1
Source/cmCableClassSetCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 3 - 2
Source/cmCableWrapTclCommand.cxx

@@ -118,13 +118,14 @@ cmCableWrapTclCommand::~cmCableWrapTclCommand()
 
 
 // cmCableWrapTclCommand
-bool cmCableWrapTclCommand::InitialPass(std::vector<std::string>& args)
+bool cmCableWrapTclCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if(args.size() < 2)
+  if(argsIn.size() < 2)
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+  std::vector<std::string>  args = argsIn;
 
   // First, we want to expand all CMAKE variables in all arguments.
   for(std::vector<std::string>::iterator a = args.begin();

+ 1 - 1
Source/cmCableWrapTclCommand.h

@@ -68,7 +68,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);  
+  virtual bool InitialPass(std::vector<std::string> const& args);  
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmCommand.h

@@ -78,7 +78,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args) = 0;
+  virtual bool InitialPass(std::vector<std::string> const& args) = 0;
 
   /**
    * This is called at the end after all the information

+ 1 - 1
Source/cmConfigureFileCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmConfigureFileCommand.h"
 
 // cmConfigureFileCommand
-bool cmConfigureFileCommand::InitialPass(std::vector<std::string>& args)
+bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {

+ 1 - 1
Source/cmConfigureFileCommand.h

@@ -56,7 +56,7 @@ public:
    * This is called when the command is first encountered in
    * the input file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmConfigureGccXmlCommand.cxx

@@ -50,7 +50,7 @@ cmConfigureGccXmlCommand::~cmConfigureGccXmlCommand()
 }
 
 // cmConfigureGccXmlCommand
-bool cmConfigureGccXmlCommand::InitialPass(std::vector<std::string>& args)
+bool cmConfigureGccXmlCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() != 2)
     {

+ 1 - 1
Source/cmConfigureGccXmlCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);  
+  virtual bool InitialPass(std::vector<std::string> const& args);  
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmElseCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmElseCommand.h"
 #include "cmCacheManager.h"
 
-bool cmElseCommand::InitialPass(std::vector<std::string>& args)
+bool cmElseCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -109,7 +109,7 @@ bool cmElseCommand::InitialPass(std::vector<std::string>& args)
   // if we created a function blocker then set its args
   if (f)
     {
-    for(std::vector<std::string>::iterator j = args.begin();
+    for(std::vector<std::string>::const_iterator j = args.begin();
         j != args.end(); ++j)
       {   
       f->m_Args.push_back(*j);

+ 1 - 1
Source/cmElseCommand.h

@@ -63,7 +63,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmEnableTestingCommand.h

@@ -76,7 +76,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args) {
+  virtual bool InitialPass(std::vector<std::string> const& args) {
     return true;};
 
   /**

+ 1 - 1
Source/cmEndForEachCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmEndForEachCommand.h"
 #include "cmCacheManager.h"
 
-bool cmEndForEachCommand::InitialPass(std::vector<std::string>& args)
+bool cmEndForEachCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {

+ 1 - 1
Source/cmEndForEachCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmEndIfCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmEndIfCommand.h"
 #include "cmCacheManager.h"
 
-bool cmEndIfCommand::InitialPass(std::vector<std::string>& args)
+bool cmEndIfCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {

+ 1 - 1
Source/cmEndIfCommand.h

@@ -63,7 +63,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 1
Source/cmExecProgramCommand.cxx

@@ -42,8 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSystemTools.h"
 
 // cmExecProgramCommand
-bool cmExecProgramCommand::InitialPass(std::vector<std::string>& args)
+bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
+  std::vector<std::string>  args = argsIn;
   if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");

+ 1 - 1
Source/cmExecProgramCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmFindFileCommand.cxx

@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   
 
 // cmFindFileCommand
-bool cmFindFileCommand::InitialPass(std::vector<std::string>& args)
+bool cmFindFileCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {
@@ -53,7 +53,7 @@ bool cmFindFileCommand::InitialPass(std::vector<std::string>& args)
     return false;
     }
 
-  std::vector<std::string>::iterator i = args.begin();
+  std::vector<std::string>::const_iterator i = args.begin();
   // Use the first argument as the name of something to be defined
   const char* define = (*i).c_str();
   i++; // move iterator to next arg

+ 1 - 1
Source/cmFindFileCommand.h

@@ -67,7 +67,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 1
Source/cmFindLibraryCommand.cxx

@@ -42,8 +42,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmFindLibraryCommand
-bool cmFindLibraryCommand::InitialPass(std::vector<std::string>& args)
+bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
+  std::vector<std::string>  args = argsIn;
   if(args.size() < 2)
     {
     this->SetError("called with incorrect number of arguments");

+ 1 - 1
Source/cmFindLibraryCommand.h

@@ -67,7 +67,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmFindPathCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmFindPathCommand
-bool cmFindPathCommand::InitialPass(std::vector<std::string>& args)
+bool cmFindPathCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {

+ 1 - 1
Source/cmFindPathCommand.h

@@ -42,7 +42,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 3 - 2
Source/cmFindProgramCommand.cxx

@@ -45,13 +45,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   
 
 // cmFindProgramCommand
-bool cmFindProgramCommand::InitialPass(std::vector<std::string>& args)
+bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if(args.size() < 2 )
+  if(argsIn.size() < 2 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+  std::vector<std::string> args = argsIn;
   std::vector<std::string>::iterator i = args.begin();
   // Use the first argument as the name of something to be defined
   const char* define = (*i).c_str();

+ 1 - 1
Source/cmFindProgramCommand.h

@@ -67,7 +67,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmForEachCommand.cxx

@@ -109,7 +109,7 @@ ScopeEnded(cmMakefile &mf)
                        mf.GetCurrentDirectory());
 }
 
-bool cmForEachCommand::InitialPass(std::vector<std::string>& args)
+bool cmForEachCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {
@@ -119,7 +119,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string>& args)
   
   // create a function blocker
   cmForEachFunctionBlocker *f = new cmForEachFunctionBlocker();
-  for(std::vector<std::string>::iterator j = args.begin();
+  for(std::vector<std::string>::const_iterator j = args.begin();
       j != args.end(); ++j)
     {   
     f->m_Args.push_back(*j);

+ 1 - 1
Source/cmForEachCommand.h

@@ -88,7 +88,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmGetFilenameComponentCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSystemTools.h"
 
 // cmGetFilenameComponentCommand
-bool cmGetFilenameComponentCommand::InitialPass(std::vector<std::string>& args)
+bool cmGetFilenameComponentCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 3)
     {

+ 1 - 1
Source/cmGetFilenameComponentCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmIfCommand.cxx

@@ -69,7 +69,7 @@ ScopeEnded(cmMakefile &mf)
                        mf.GetCurrentDirectory());
 }
 
-bool cmIfCommand::InitialPass(std::vector<std::string>& args)
+bool cmIfCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -137,7 +137,7 @@ bool cmIfCommand::InitialPass(std::vector<std::string>& args)
   // if we created a function blocker then set its args
   if (f)
     {
-    for(std::vector<std::string>::iterator j = args.begin();
+    for(std::vector<std::string>::const_iterator j = args.begin();
         j != args.end(); ++j)
       {   
       f->m_Args.push_back(*j);

+ 1 - 1
Source/cmIfCommand.h

@@ -86,7 +86,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 3 - 3
Source/cmIncludeCommand.cxx

@@ -17,14 +17,14 @@
 
 
 // cmIncludeCommand
-bool cmIncludeCommand::InitialPass(std::vector<std::string>& args)
+bool cmIncludeCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if (args.size()< 1 || args.size() > 2)
+  if (argsIn.size()< 1 || argsIn.size() > 2)
     {
       this->SetError("called with wrong number of arguments.  "
                      "Include only takes one file.");
     }
-
+  std::vector<std::string> args = argsIn;
   m_Makefile->ExpandVariablesInString( args[0]);
   bool exists = cmSystemTools::FileExists(args[0].c_str());
   if(args.size() == 2 && args[1] == "OPTIONAL" && !exists)

+ 1 - 1
Source/cmIncludeCommand.h

@@ -42,7 +42,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmIncludeDirectoryCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmIncludeDirectoryCommand.h"
 #include "cmCacheManager.h"
 // cmIncludeDirectoryCommand
-bool cmIncludeDirectoryCommand::InitialPass(std::vector<std::string>& args)
+bool cmIncludeDirectoryCommand::InitialPass(std::vector<std::string> const& args)
 {
  if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = args.begin();
+  for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
     {
     m_Makefile->AddIncludeDirectory((*i).c_str());

+ 1 - 1
Source/cmIncludeDirectoryCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmIncludeRegularExpressionCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmIncludeRegularExpressionCommand.h"
 
 // cmIncludeRegularExpressionCommand
-bool cmIncludeRegularExpressionCommand::InitialPass(std::vector<std::string>& args)
+bool cmIncludeRegularExpressionCommand::InitialPass(std::vector<std::string> const& args)
 {
   if((args.size() < 1) || (args.size() > 2))
     {

+ 1 - 1
Source/cmIncludeRegularExpressionCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmInstallFilesCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmExecutableCommand
-bool cmInstallFilesCommand::InitialPass(std::vector<std::string>& args)
+bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {
@@ -58,7 +58,7 @@ bool cmInstallFilesCommand::InitialPass(std::vector<std::string>& args)
   target.SetInstallPath(args[0].c_str());
   m_Makefile->GetTargets().insert(cmTargets::value_type(m_TargetName, target));
 
-  std::vector<std::string>::iterator s = args.begin();
+  std::vector<std::string>::const_iterator s = args.begin();
   for (++s;s != args.end(); ++s)
     {
     m_FinalArgs.push_back(*s);

+ 1 - 1
Source/cmInstallFilesCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmInstallProgramsCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmExecutableCommand
-bool cmInstallProgramsCommand::InitialPass(std::vector<std::string>& args)
+bool cmInstallProgramsCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {
@@ -58,7 +58,7 @@ bool cmInstallProgramsCommand::InitialPass(std::vector<std::string>& args)
   target.SetInstallPath(args[0].c_str());
   m_Makefile->GetTargets().insert(cmTargets::value_type(m_TargetName, target));
 
-  std::vector<std::string>::iterator s = args.begin();
+  std::vector<std::string>::const_iterator s = args.begin();
   for (++s;s != args.end(); ++s)
     {
     m_FinalArgs.push_back(*s);

+ 1 - 1
Source/cmInstallProgramsCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmInstallTargetsCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmExecutableCommand
-bool cmInstallTargetsCommand::InitialPass(std::vector<std::string>& args)
+bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {
@@ -51,7 +51,7 @@ bool cmInstallTargetsCommand::InitialPass(std::vector<std::string>& args)
     }
 
   cmTargets &tgts = m_Makefile->GetTargets();
-  std::vector<std::string>::iterator s = args.begin();
+  std::vector<std::string>::const_iterator s = args.begin();
   ++s;
   for (;s != args.end(); ++s)
     {

+ 1 - 1
Source/cmInstallTargetsCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmLibraryCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmLinkDirectoriesCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmLinkDirectoriesCommand.h"
 
 // cmLinkDirectoriesCommand
-bool cmLinkDirectoriesCommand::InitialPass(std::vector<std::string>& args)
+bool cmLinkDirectoriesCommand::InitialPass(std::vector<std::string> const& args)
 {
  if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = args.begin();
+  for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
     {
     m_Makefile->AddLinkDirectory((*i).c_str());

+ 1 - 1
Source/cmLinkDirectoriesCommand.h

@@ -67,7 +67,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmLinkLibrariesCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmLinkLibrariesCommand.h"
 
 // cmLinkLibrariesCommand
-bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string>& args)
+bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -50,7 +50,7 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string>& args)
     }
   // add libraries, nothe that there is an optional prefix 
   // of debug and optimized than can be used
-  for(std::vector<std::string>::iterator i = args.begin();
+  for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
     {
     if (*i == "debug")

+ 1 - 1
Source/cmLinkLibrariesCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 3 - 2
Source/cmLoadCacheCommand.cxx

@@ -17,12 +17,13 @@
 
 
 // cmLoadcacheCommand
-bool cmLoadCacheCommand::InitialPass(std::vector<std::string>& args)
+bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& argsIn)
 {
-  if (args.size()< 1)
+  if (argsIn.size()< 1)
     {
     this->SetError("called with wrong number of arguments.");
     }
+  std::vector<std::string> args = argsIn;
   
   // Cache entries to be excluded from the import list.
   // If this set is empty, all cache entries are brought in

+ 1 - 1
Source/cmLoadCacheCommand.h

@@ -61,7 +61,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 4 - 3
Source/cmMakeDirectoryCommand.cxx

@@ -42,15 +42,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmDirectory.h"
 
 // cmMakeDirectoryCommand
-bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string>& args)
+bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  m_Makefile->ExpandVariablesInString(args[0]);
-  cmSystemTools::MakeDirectory(args[0].c_str());
+  std::string arg = args[0];
+  m_Makefile->ExpandVariablesInString(arg);
+  cmSystemTools::MakeDirectory(arg.c_str());
   return true;
 }
 

+ 1 - 1
Source/cmMakeDirectoryCommand.h

@@ -68,7 +68,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 3 - 5
Source/cmMakefile.cxx

@@ -217,7 +217,7 @@ void cmMakefile::Print() const
 
       
 void cmMakefile::ExecuteCommand(std::string &name,
-                                std::vector<std::string> &arguments)
+                                std::vector<std::string> const& arguments)
 {
   RegisteredCommandsMap::iterator pos = m_Commands.find(name);
   if(pos != m_Commands.end())
@@ -336,16 +336,14 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external)
   // add this list file to the list of dependencies
   m_ListFiles.push_back( filenametoread);
   const int numberFunctions = lf->m_Functions.size();
-  std::vector<std::string> argumentsCopy;
   for(int i =0; i < numberFunctions; ++i)
     {
     cmListFileFunction& curFunction = lf->m_Functions[i];
     if(!this->IsFunctionBlocked(curFunction.m_Name.c_str(),
                                 curFunction.m_Arguments))
       {
-      argumentsCopy = curFunction.m_Arguments;
       this->ExecuteCommand(curFunction.m_Name,
-                           argumentsCopy);
+                           curFunction.m_Arguments);
       }
     }
 
@@ -1149,7 +1147,7 @@ cmMakefile::FindSourceGroup(const char* source,
 
 
 bool cmMakefile::IsFunctionBlocked(const char *name,
-                                   std::vector<std::string> &args)
+                                   std::vector<std::string> const&args)
 {
   // loop over all function blockers to see if any block this command
   std::set<cmFunctionBlocker *>::const_iterator pos;

+ 2 - 2
Source/cmMakefile.h

@@ -540,7 +540,7 @@ public:
   /**
    * execute a single CMake command
    */
-  void ExecuteCommand(std::string &name, std::vector<std::string> &args);
+  void ExecuteCommand(std::string &name, std::vector<std::string> const& args);
   
     
 protected:
@@ -590,7 +590,7 @@ protected:
   RegisteredCommandsMap m_Commands;
   std::vector<cmCommand*> m_UsedCommands;
   cmMakefileGenerator* m_MakefileGenerator;
-  bool IsFunctionBlocked(const char *name, std::vector<std::string> &args);
+  bool IsFunctionBlocked(const char *name, std::vector<std::string> const& args);
   
 private:
   /**

+ 2 - 2
Source/cmMessageCommand.cxx

@@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmCacheManager.h"
 
 // cmLibraryCommand
-bool cmMessageCommand::InitialPass(std::vector<std::string>& args)
+bool cmMessageCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -53,7 +53,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string>& args)
   if (args.size() >= 2)
     {
     std::string message;
-    std::vector<std::string>::iterator i = args.begin();
+    std::vector<std::string>::const_iterator i = args.begin();
     ++i;
     for(;i != args.end(); ++i)
       {

+ 1 - 1
Source/cmMessageCommand.h

@@ -63,7 +63,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmOptionCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmOptionCommand.h"
 
 // cmOptionCommand
-bool cmOptionCommand::InitialPass(std::vector<std::string>& args)
+bool cmOptionCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {

+ 1 - 1
Source/cmOptionCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmOutputRequiredFilesCommand.cxx

@@ -181,7 +181,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
 }
 
 // cmOutputRequiredFilesCommand
-bool cmOutputRequiredFilesCommand::InitialPass(std::vector<std::string>& args)
+bool cmOutputRequiredFilesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2 )
     {

+ 1 - 1
Source/cmOutputRequiredFilesCommand.h

@@ -63,7 +63,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   virtual void FinalPass();
 

+ 1 - 1
Source/cmProjectCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmProjectCommand.h"
 
 // cmProjectCommand
-bool cmProjectCommand::InitialPass(std::vector<std::string>& args)
+bool cmProjectCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 || args.size() > 1)
     {

+ 1 - 1
Source/cmProjectCommand.h

@@ -67,7 +67,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmSetCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSetCommand.h"
 
 // cmSetCommand
-bool cmSetCommand::InitialPass(std::vector<std::string>& args)
+bool cmSetCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {
@@ -90,7 +90,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string>& args)
     message += "Syntax error in SET:\n";
     message += "CACHE requires TYPE and document string SET command:\n";
     message += "SET (";
-    for(std::vector<std::string>::iterator i = args.begin();
+    for(std::vector<std::string>::const_iterator i = args.begin();
         i != args.end(); ++i)
       {
       message += *i;

+ 1 - 1
Source/cmSetCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 1 - 1
Source/cmSiteNameCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSiteNameCommand.h"
 
 // cmSiteNameCommand
-bool cmSiteNameCommand::InitialPass(std::vector<std::string>& args)
+bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 1 )
     {

+ 1 - 1
Source/cmSiteNameCommand.h

@@ -64,7 +64,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * This determines if the command gets propagated down

+ 2 - 2
Source/cmSourceFilesCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSourceFilesCommand.h"
 
 // cmSourceFilesCommand
-bool cmSourceFilesCommand::InitialPass(std::vector<std::string>& args)
+bool cmSourceFilesCommand::InitialPass(std::vector<std::string> const& args)
 {
  if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = (args.begin() + 1);
+  for(std::vector<std::string>::const_iterator i = (args.begin() + 1);
       i != args.end(); ++i)
     {
     std::string copy = *i;

+ 1 - 1
Source/cmSourceFilesCommand.h

@@ -70,7 +70,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmSourceFilesRemoveCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSourceFilesRemoveCommand.h"
 
 // cmSourceFilesRemoveCommand
-bool cmSourceFilesRemoveCommand::InitialPass(std::vector<std::string>& args)
+bool cmSourceFilesRemoveCommand::InitialPass(std::vector<std::string> const& args)
 {
  if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = (args.begin() + 1);
+  for(std::vector<std::string>::const_iterator i = (args.begin() + 1);
       i != args.end(); ++i)
     {
     cmSourceFile file;

+ 1 - 1
Source/cmSourceFilesRemoveCommand.h

@@ -70,7 +70,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmSourceGroupCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSourceGroupCommand.h"
 
 // cmSourceGroupCommand
-bool cmSourceGroupCommand::InitialPass(std::vector<std::string>& args)
+bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() != 2)
     {

+ 1 - 1
Source/cmSourceGroupCommand.h

@@ -65,7 +65,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
   
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmSubdirCommand.cxx

@@ -41,14 +41,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSubdirCommand.h"
 
 // cmSubdirCommand
-bool cmSubdirCommand::InitialPass(std::vector<std::string>& args)
+bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args)
 {
  if(args.size() < 1 )
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  for(std::vector<std::string>::iterator i = args.begin();
+  for(std::vector<std::string>::const_iterator i = args.begin();
       i != args.end(); ++i)
     {
     m_Makefile->AddSubDirectory((*i).c_str());

+ 1 - 1
Source/cmSubdirCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 1 - 1
Source/cmSubdirDependsCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSubdirDependsCommand.h"
 
 // cmSubdirDependsCommand
-bool cmSubdirDependsCommand::InitialPass(std::vector<std::string>& args)
+bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {

+ 1 - 1
Source/cmSubdirDependsCommand.h

@@ -70,7 +70,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 2 - 2
Source/cmTargetLinkLibrariesCommand.cxx

@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmTargetLinkLibrariesCommand.h"
 
 // cmTargetLinkLibrariesCommand
-bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string>& args)
+bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
 {
   if(args.size() < 2)
     {
@@ -50,7 +50,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string>& args)
     }
   // add libraries, nothe that there is an optional prefix 
   // of debug and optimized than can be used
-  std::vector<std::string>::iterator i = args.begin();
+  std::vector<std::string>::const_iterator i = args.begin();
   
   for(++i; i != args.end(); ++i)
     {

+ 1 - 1
Source/cmTargetLinkLibrariesCommand.h

@@ -66,7 +66,7 @@ public:
    * This is called when the command is first encountered in
    * the CMakeLists.txt file.
    */
-  virtual bool InitialPass(std::vector<std::string>& args);
+  virtual bool InitialPass(std::vector<std::string> const& args);
 
   /**
    * The name of the command as specified in CMakeList.txt.

+ 3 - 2
Source/cmUseMangledMesaCommand.cxx

@@ -42,16 +42,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "cmSystemTools.h"
 
 // cmUseMangledMesaCommand
-bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string>& args)
+bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& argsIn)
 { 
   // expected two arguments:
   // arguement one: the full path to gl_mangle.h
   // arguement two : directory for output of edited headers
-  if(args.size() < 2)
+  if(argsIn.size() < 2)
     {
     this->SetError("called with incorrect number of arguments");
     return false;
     }
+  std::vector<std::string>  args = argsIn;
   m_Makefile->ExpandVariablesInString(args[0]);
   m_Makefile->ExpandVariablesInString(args[1]);
   const char* inputDir = args[0].c_str();

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác