1
0
Эх сурвалжийг харах

ENH: space fixes and add a status option to message command

Ken Martin 23 жил өмнө
parent
commit
20b7e6b222

+ 1 - 0
Source/cmLocalUnixMakefileGenerator.cxx

@@ -924,6 +924,7 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout,
   std::string flags;
   std::string target = m_ExecutableOutputPath + name 
     + cmSystemTools::GetExecutableExtension(); 
+  target = cmSystemTools::ConvertToOutputPath(target.c_str());
   std::string objs = "$(" + this->CreateMakeVariable(name, "_SRC_OBJS") + ") ";
   std::string depend = "$(";
   depend += this->CreateMakeVariable(name, "_SRC_OBJS") 

+ 5 - 0
Source/cmMakefile.cxx

@@ -1443,3 +1443,8 @@ bool cmMakefile::GetLocal() const
 {
   return m_LocalGenerator->GetGlobalGenerator()->GetCMakeInstance()->GetLocal();
 }
+void cmMakefile::DisplayStatus(const char* message, float s)
+{
+  this->GetLocalGenerator()->GetGlobalGenerator()
+    ->GetCMakeInstance()->UpdateProgress(message, s);
+}

+ 2 - 0
Source/cmMakefile.h

@@ -522,6 +522,8 @@ public:
   //! Determine wether this is a local or global build.
   bool GetLocal() const;
 
+  ///! Display progress or status message.
+  void DisplayStatus(const char*, float);
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const char* name, cmTarget& target);

+ 17 - 1
Source/cmMessageCommand.cxx

@@ -30,11 +30,20 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& argsIn)
   std::vector<std::string>::const_iterator i = args.begin();
 
   bool send_error = false;
+  bool status = false;
   if (*i == "SEND_ERROR")
     {
     send_error = true;
     ++i;
     }
+  else
+    {
+      if (*i == "STATUS")
+        {
+          status = true;
+          ++i;
+        }
+    }
 
   for(;i != args.end(); ++i)
     {
@@ -47,7 +56,14 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& argsIn)
     }
   else
     {
-    cmSystemTools::Message(message.c_str());
+      if (status)
+        {
+          m_Makefile->DisplayStatus(message.c_str(), -1);
+        }
+      else
+        {
+          cmSystemTools::Message(message.c_str());
+        }
     }
 
   return true;

+ 2 - 2
Source/cmMessageCommand.h

@@ -60,8 +60,8 @@ public:
   virtual const char* GetFullDocumentation()
     {
     return
-      "MESSAGE([SEND_ERROR] \"message to display\"...)\n"
-      "The arguments are messages to display. If the first argument is SEND_ERROR then an error is raised.";
+      "MESSAGE([SEND_ERROR | STATUS] \"message to display\"...)\n"
+      "The arguments are messages to display. If the first argument is SEND_ERROR then an error is raised. If the first argument is STATUS then the message is diaplyed in the progress line for the GUI";
     }
   
   cmTypeMacro(cmMessageCommand, cmCommand);