summaryrefslogtreecommitdiff
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-24 11:42:39 -0400
committerBrad King <brad.king@kitware.com>2014-06-24 13:11:45 -0400
commitabebcd235c94e05a20003430981a1b46b0fb7f95 (patch)
treec2ae34e12157047ce2ab8f0e2c16dc4f5c3610d1 /Source/cmFileCommand.cxx
parent464567a577555659610b2a26f9c1733d672583de (diff)
downloadcmake-abebcd235c94e05a20003430981a1b46b0fb7f95.tar.gz
file(INSTALL): Add undocumented options to control output verbosity
Create options "MESSAGE_ALWAYS", "MESSAGE_LAZY", and "MESSAGE_NEVER" to specify whether to print the "Installing" and "Up-to-date" messages. Extend the RunCMake.file test with cases covering these options.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx61
1 files changed, 58 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 99c7ad13ea..61c6eb34f9 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1705,6 +1705,9 @@ struct cmFileInstaller: public cmFileCopier
cmFileCopier(command, "INSTALL"),
InstallType(cmInstallType_FILES),
Optional(false),
+ MessageAlways(false),
+ MessageLazy(false),
+ MessageNever(false),
DestDirLength(0)
{
// Installation does not use source permissions by default.
@@ -1726,6 +1729,9 @@ struct cmFileInstaller: public cmFileCopier
protected:
cmInstallType InstallType;
bool Optional;
+ bool MessageAlways;
+ bool MessageLazy;
+ bool MessageNever;
int DestDirLength;
std::string Rename;
@@ -1741,9 +1747,12 @@ protected:
virtual void ReportCopy(const char* toFile, Type type, bool copy)
{
- std::string message = (copy? "Installing: " : "Up-to-date: ");
- message += toFile;
- this->Makefile->DisplayStatus(message.c_str(), -1);
+ if(!this->MessageNever && (copy || !this->MessageLazy))
+ {
+ std::string message = (copy? "Installing: " : "Up-to-date: ");
+ message += toFile;
+ this->Makefile->DisplayStatus(message.c_str(), -1);
+ }
if(type != TypeDir)
{
// Add the file to the manifest.
@@ -1829,6 +1838,16 @@ bool cmFileInstaller::Parse(std::vector<std::string> const& args)
return false;
}
+ if(((this->MessageAlways?1:0) +
+ (this->MessageLazy?1:0) +
+ (this->MessageNever?1:0)) > 1)
+ {
+ this->FileCommand->SetError("INSTALL options MESSAGE_ALWAYS, "
+ "MESSAGE_LAZY, and MESSAGE_NEVER "
+ "are mutually exclusive.");
+ return false;
+ }
+
return true;
}
@@ -1880,6 +1899,42 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg)
this->Optional = true;
}
}
+ else if(arg == "MESSAGE_ALWAYS")
+ {
+ if(this->CurrentMatchRule)
+ {
+ this->NotAfterMatch(arg);
+ }
+ else
+ {
+ this->Doing = DoingNone;
+ this->MessageAlways = true;
+ }
+ }
+ else if(arg == "MESSAGE_LAZY")
+ {
+ if(this->CurrentMatchRule)
+ {
+ this->NotAfterMatch(arg);
+ }
+ else
+ {
+ this->Doing = DoingNone;
+ this->MessageLazy = true;
+ }
+ }
+ else if(arg == "MESSAGE_NEVER")
+ {
+ if(this->CurrentMatchRule)
+ {
+ this->NotAfterMatch(arg);
+ }
+ else
+ {
+ this->Doing = DoingNone;
+ this->MessageNever = true;
+ }
+ }
else if(arg == "PERMISSIONS")
{
if(this->CurrentMatchRule)