summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerator.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-04-06 09:43:21 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-04-06 15:37:12 (GMT)
commitf161cfe5a8fa00d6d203885e9c1985ec53d7d625 (patch)
tree422ddf42ba2cacdd9bb150960c19598991e0f624 /Source/cmQtAutoGenerator.cxx
parent7baec5e94b372cfc21e777488ecf993e4bce368e (diff)
downloadCMake-f161cfe5a8fa00d6d203885e9c1985ec53d7d625.zip
CMake-f161cfe5a8fa00d6d203885e9c1985ec53d7d625.tar.gz
CMake-f161cfe5a8fa00d6d203885e9c1985ec53d7d625.tar.bz2
Autogen: Move Logger and FileSystem member variables to generator classes
`cmQtAutoGenerator` automatically added `cmQtAutoGenerator::Logger` and `cmQtAutoGenerator::FileSystem` member variables to all inherited classes. This patch moves these members variable declarations to the inherited classes, where needed.
Diffstat (limited to 'Source/cmQtAutoGenerator.cxx')
-rw-r--r--Source/cmQtAutoGenerator.cxx52
1 files changed, 28 insertions, 24 deletions
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index f56f7c9..c1e6aab 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -20,6 +20,34 @@
// -- Class methods
+cmQtAutoGenerator::Logger::Logger()
+{
+ // Initialize logger
+ {
+ std::string verbose;
+ if (cmSystemTools::GetEnv("VERBOSE", verbose) && !verbose.empty()) {
+ unsigned long iVerbose = 0;
+ if (cmSystemTools::StringToULong(verbose.c_str(), &iVerbose)) {
+ SetVerbosity(static_cast<unsigned int>(iVerbose));
+ } else {
+ // Non numeric verbosity
+ SetVerbose(cmSystemTools::IsOn(verbose));
+ }
+ }
+ }
+ {
+ std::string colorEnv;
+ cmSystemTools::GetEnv("COLOR", colorEnv);
+ if (!colorEnv.empty()) {
+ SetColorOutput(cmSystemTools::IsOn(colorEnv));
+ } else {
+ SetColorOutput(true);
+ }
+ }
+}
+
+cmQtAutoGenerator::Logger::~Logger() = default;
+
void cmQtAutoGenerator::Logger::RaiseVerbosity(std::string const& value)
{
unsigned long verbosity = 0;
@@ -670,31 +698,7 @@ void cmQtAutoGenerator::ReadOnlyProcessT::UVTryFinish()
}
cmQtAutoGenerator::cmQtAutoGenerator()
- : FileSys_(&Logger_)
{
- // Initialize logger
- {
- 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));
- }
- }
- }
- {
- std::string colorEnv;
- cmSystemTools::GetEnv("COLOR", colorEnv);
- if (!colorEnv.empty()) {
- Logger_.SetColorOutput(cmSystemTools::IsOn(colorEnv));
- } else {
- Logger_.SetColorOutput(true);
- }
- }
-
// Initialize libuv loop
uv_disable_stdio_inheritance();
#ifdef CMAKE_UV_SIGNAL_HACK