summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmQtAutoGenInitializer.cxx16
-rw-r--r--Source/cmQtAutoGenInitializer.h1
-rw-r--r--Source/cmQtAutoGenerator.cxx22
-rw-r--r--Source/cmQtAutoGenerator.h11
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx1
-rw-r--r--Source/cmQtAutoGeneratorRcc.cxx1
6 files changed, 44 insertions, 8 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 34196d9..37155fa 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -210,6 +210,19 @@ void cmQtAutoGenInitializer::InitCustomTargets()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
+ // Verbosity
+ {
+ this->Verbosity = makefile->GetSafeDefinition("CMAKE_AUTOGEN_VERBOSE");
+ if (!this->Verbosity.empty()) {
+ unsigned long iVerb = 0;
+ if (!cmSystemTools::StringToULong(this->Verbosity.c_str(), &iVerb)) {
+ // Non numeric verbosity
+ this->Verbosity =
+ cmSystemTools::IsOn(this->Verbosity.c_str()) ? "1" : "0";
+ }
+ }
+ }
+
// Configurations
this->MultiConfig = globalGen->IsMultiConfig();
this->ConfigDefault = makefile->GetConfigurations(this->ConfigsList);
@@ -944,6 +957,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
ofs << "# Meta\n";
CWrite("AM_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
CWrite("AM_PARALLEL", this->Parallel);
+ CWrite("AM_VERBOSITY", this->Verbosity);
ofs << "# Directories\n";
CWrite("AM_CMAKE_SOURCE_DIR", MfDef("CMAKE_SOURCE_DIR"));
@@ -1036,7 +1050,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
// Write
ofs << "# Configurations\n";
CWrite("ARCC_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
-
+ CWrite("ARCC_VERBOSITY", this->Verbosity);
ofs << "# Settings file\n";
if (this->MultiConfig) {
std::map<std::string, std::string> settingsFiles;
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index 5fbf0cb..813c680 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -83,6 +83,7 @@ private:
std::string ConfigDefault;
std::vector<std::string> ConfigsList;
std::string Parallel;
+ std::string Verbosity;
// Names
std::string AutogenTargetName;
std::string AutogenFolder;
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 7aa792f..64ce0e3 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -17,9 +17,14 @@
// -- Class methods
-void cmQtAutoGenerator::Logger::SetVerbose(bool value)
+void cmQtAutoGenerator::Logger::RaiseVerbosity(std::string const& value)
{
- Verbose_ = value;
+ unsigned long verbosity = 0;
+ if (cmSystemTools::StringToULong(value.c_str(), &verbosity)) {
+ if (this->Verbosity_ < verbosity) {
+ this->Verbosity_ = static_cast<unsigned int>(verbosity);
+ }
+ }
}
void cmQtAutoGenerator::Logger::SetColorOutput(bool value)
@@ -632,7 +637,18 @@ cmQtAutoGenerator::cmQtAutoGenerator()
: FileSys_(&Logger_)
{
// Initialize logger
- Logger_.SetVerbose(cmSystemTools::HasEnv("VERBOSE"));
+ {
+ std::string verbose;
+ if (cmSystemTools::GetEnv("VERBOSE", verbose) && !verbose.empty()) {
+ unsigned long iVerbose = 0;
+ if (cmSystemTools::StringToULong(verbose.c_str(), &iVerbose)) {
+ Logger_.SetVerbosity(static_cast<unsigned int>(iVerbose));
+ } else {
+ // Non numeric verbosity
+ Logger_.SetVerbose(cmSystemTools::IsOn(verbose.c_str()));
+ }
+ }
+ }
{
std::string colorEnv;
cmSystemTools::GetEnv("COLOR", colorEnv);
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 4e38413..75143f5 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -33,8 +33,11 @@ public:
{
public:
// -- Verbosity
- bool Verbose() const { return this->Verbose_; }
- void SetVerbose(bool value);
+ unsigned int Verbosity() const { return this->Verbosity_; }
+ void SetVerbosity(unsigned int value) { this->Verbosity_ = value; }
+ void RaiseVerbosity(std::string const& value);
+ bool Verbose() const { return (this->Verbosity_ != 0); }
+ void SetVerbose(bool value) { this->Verbosity_ = value ? 1 : 0; }
bool ColorOutput() const { return this->ColorOutput_; }
void SetColorOutput(bool value);
// -- Log info
@@ -56,8 +59,8 @@ public:
private:
std::mutex Mutex_;
- bool volatile Verbose_ = false;
- bool volatile ColorOutput_ = false;
+ unsigned int Verbosity_ = 0;
+ bool ColorOutput_ = false;
};
/// @brief Thread safe file system interface
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index f196b97..a6b0247 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -1222,6 +1222,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
}
// -- Meta
+ Log().RaiseVerbosity(InfoGet("AM_VERBOSITY"));
Base_.MultiConfig = InfoGetBool("AM_MULTI_CONFIG");
{
unsigned long num = Base_.NumThreads;
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 3064895..e49599f 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -70,6 +70,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
}
// - Configurations
+ Log().RaiseVerbosity(InfoGet("ARCC_VERBOSITY"));
MultiConfig_ = makefile->IsOn("ARCC_MULTI_CONFIG");
// - Directories