From 20b7e6b22204b034d204252c0475f292e830ff61 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Wed, 13 Nov 2002 15:59:40 -0500 Subject: [PATCH] ENH: space fixes and add a status option to message command --- Source/cmLocalUnixMakefileGenerator.cxx | 1 + Source/cmMakefile.cxx | 5 +++++ Source/cmMakefile.h | 2 ++ Source/cmMessageCommand.cxx | 18 +++++++++++++++++- Source/cmMessageCommand.h | 4 ++-- 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 55dea6aae..c89a4d64b 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/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") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bc8bf6bdc..5e8ec9800 100644 --- a/Source/cmMakefile.cxx +++ b/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); +} diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 2cba4946a..695243ab3 100644 --- a/Source/cmMakefile.h +++ b/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); diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 0fa2e83af..45c6dc9df 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -30,11 +30,20 @@ bool cmMessageCommand::InitialPass(std::vector const& argsIn) std::vector::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 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; diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index 2d0fc3883..a312edcee 100644 --- a/Source/cmMessageCommand.h +++ b/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);