Jelajahi Sumber

ENH: some more cleanup

Ken Martin 19 tahun lalu
induk
melakukan
c53b26baf2

+ 3 - 3
Source/cmAddCustomTargetCommand.cxx

@@ -73,13 +73,13 @@ bool cmAddCustomTargetCommand::InitialPass(
   tdoing doing = doing_command;
 
   // Look for the ALL option.
-  bool all = false;
+  bool excludeFromAll = true;
   unsigned int start = 1;
   if(args.size() > 1)
     {
     if(args[1] == "ALL")
       {
-      all = true;
+      excludeFromAll = false;
       start = 2;
       }
     }
@@ -160,7 +160,7 @@ bool cmAddCustomTargetCommand::InitialPass(
 
   // Add the utility target to the makefile.
   bool escapeOldStyle = !verbatim;
-  this->Makefile->AddUtilityCommand(args[0].c_str(), all,
+  this->Makefile->AddUtilityCommand(args[0].c_str(), excludeFromAll,
                                     working_directory.c_str(), depends,
                                     commandLines, escapeOldStyle, comment);
 

+ 1 - 1
Source/cmCPluginAPI.cxx

@@ -236,7 +236,7 @@ void CCONV cmAddUtilityCommand(void *arg, const char* utilityName,
     }
 
   // Pass the call to the makefile instance.
-  mf->AddUtilityCommand(utilityName, (all ? true : false),
+  mf->AddUtilityCommand(utilityName, (all ? false : true),
                         0, depends2, commandLines);
 }
 void CCONV cmAddCustomCommand(void *arg, const char* source,

+ 1 - 1
Source/cmGlobalVisualStudio6Generator.cxx

@@ -171,7 +171,7 @@ void cmGlobalVisualStudio6Generator::Generate()
     // add the ALL_BUILD to the first local generator of each project
     if(gen.size())
       {
-      gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", false, 
+      gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", true, 
                                                no_depends, 
                                                no_working_dir,
                                                "echo", "Build all projects");

+ 1 - 1
Source/cmGlobalVisualStudio7Generator.cxx

@@ -226,7 +226,7 @@ void cmGlobalVisualStudio7Generator::Generate()
     if(gen.size())
       {
       gen[0]->GetMakefile()->
-        AddUtilityCommand("ALL_BUILD", false, no_depends,
+        AddUtilityCommand("ALL_BUILD", true, no_depends,
                           no_working_dir,
                           "echo", "Build all projects");
       std::string cmake_command = 

+ 1 - 1
Source/cmGlobalVisualStudio8Generator.cxx

@@ -91,7 +91,7 @@ void cmGlobalVisualStudio8Generator::Generate()
       cmMakefile* mf = lg->GetMakefile();
       std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND");
       cmCustomCommandLines noCommandLines;
-      mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true,
+      mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false,
                             no_working_directory, no_depends,
                             noCommandLines);
       cmTarget* tgt = mf->FindTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET);

+ 2 - 2
Source/cmGlobalXCodeGenerator.cxx

@@ -252,7 +252,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
   // Add ALL_BUILD
   const char* no_working_directory = 0;
   std::vector<std::string> no_depends;
-  mf->AddUtilityCommand("ALL_BUILD", false, no_depends,
+  mf->AddUtilityCommand("ALL_BUILD", true, no_depends,
                         no_working_directory,
                         "echo", "Build all projects");
   cmTarget* allbuild = mf->FindTarget("ALL_BUILD");
@@ -275,7 +275,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
     }
   cmCustomCommandLines commandLines;
   commandLines.push_back(makecommand);
-  mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false,
+  mf->AddUtilityCommand("XCODE_DEPEND_HELPER", true,
                         no_working_directory,
                         no_depends,
                         commandLines);

+ 9 - 5
Source/cmMakefile.cxx

@@ -771,7 +771,8 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
 }
 
 //----------------------------------------------------------------------------
-void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
+void cmMakefile::AddUtilityCommand(const char* utilityName, 
+                                   bool excludeFromAll,
                                    const std::vector<std::string>& depends,
                                    const char* workingDirectory,
                                    const char* command,
@@ -803,12 +804,13 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
   commandLines.push_back(commandLine);
 
   // Call the real signature of this method.
-  this->AddUtilityCommand(utilityName, all, workingDirectory, 
+  this->AddUtilityCommand(utilityName, excludeFromAll, workingDirectory, 
                           depends, commandLines);
 }
 
 //----------------------------------------------------------------------------
-void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
+void cmMakefile::AddUtilityCommand(const char* utilityName, 
+                                   bool excludeFromAll,
                                    const char* workingDirectory,
                                    const std::vector<std::string>& depends,
                                    const cmCustomCommandLines& commandLines,
@@ -818,8 +820,10 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
   cmTarget target;
   target.SetMakefile(this);
   target.SetType(cmTarget::UTILITY, utilityName);
-  target.SetProperty("EXCLUDE_FROM_ALL", (all) ?"FALSE" : "TRUE");
-
+  if (excludeFromAll)
+    {
+    target.SetProperty("EXCLUDE_FROM_ALL", "TRUE");
+    }
   if(!comment)
     {
     // Use an empty comment to avoid generation of default comment.

+ 2 - 2
Source/cmMakefile.h

@@ -176,7 +176,7 @@ public:
    * Add a utility to the build.  A utiltity target is a command that
    * is run every time the target is built.
    */
-  void AddUtilityCommand(const char* utilityName, bool all,
+  void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
                          const std::vector<std::string>& depends,
                          const char* workingDirectory,
                          const char* command,
@@ -184,7 +184,7 @@ public:
                          const char* arg2=0,
                          const char* arg3=0,
                          const char* arg4=0);
-  void AddUtilityCommand(const char* utilityName, bool all,
+  void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
                          const char* workingDirectory,
                          const std::vector<std::string>& depends,
                          const cmCustomCommandLines& commandLines,