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

This commit is contained in:
Ken Martin 2002-11-13 15:59:40 -05:00
parent 19b144bdbf
commit 20b7e6b222
5 changed files with 27 additions and 3 deletions

View File

@ -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")

View File

@ -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);
}

View File

@ -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);

View File

@ -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)
{
@ -45,10 +54,17 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& argsIn)
{
cmSystemTools::Error(message.c_str());
}
else
{
if (status)
{
m_Makefile->DisplayStatus(message.c_str(), -1);
}
else
{
cmSystemTools::Message(message.c_str());
}
}
return true;
}

View File

@ -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);