Commit 634343c3 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

STYLE: Fix some style issues

parent f01afc89
......@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -39,7 +39,7 @@ cmCPackGenerators::cmCPackGenerators()
cmCPackGenerators::~cmCPackGenerators()
{
std::vector<cmCPackGenericGenerator*>::iterator it;
for ( it = m_Generators.begin(); it != m_Generators.end(); ++ it )
for ( it = this->Generators.begin(); it != this->Generators.end(); ++ it )
{
delete *it;
}
......@@ -53,8 +53,8 @@ cmCPackGenericGenerator* cmCPackGenerators::NewGenerator(const char* name)
{
return 0;
}
m_Generators.push_back(gen);
gen->SetLogger(m_Logger);
this->Generators.push_back(gen);
gen->SetLogger(this->Logger);
return gen;
}
......@@ -67,8 +67,8 @@ cmCPackGenericGenerator* cmCPackGenerators::NewGeneratorInternal(
return 0;
}
cmCPackGenerators::t_GeneratorCreatorsMap::iterator it
= m_GeneratorCreators.find(name);
if ( it == m_GeneratorCreators.end() )
= this->GeneratorCreators.find(name);
if ( it == this->GeneratorCreators.end() )
{
return 0;
}
......@@ -81,9 +81,9 @@ void cmCPackGenerators::RegisterGenerator(const char* name,
{
if ( !name || !createGenerator )
{
cmCPack_Log(m_Logger, cmCPackLog::LOG_ERROR, "Cannot register generator"
<< std::endl);
cmCPack_Log(this->Logger, cmCPackLog::LOG_ERROR,
"Cannot register generator" << std::endl);
return;
}
m_GeneratorCreators[name] = createGenerator;
this->GeneratorCreators[name] = createGenerator;
}
......@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -44,15 +44,15 @@ public:
void RegisterGenerator(const char* name,
CreateGeneratorCall* createGenerator);
void SetLogger(cmCPackLog* logger) { m_Logger = logger; }
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
private:
cmCPackGenericGenerator* NewGeneratorInternal(const char* name);
std::vector<cmCPackGenericGenerator*> m_Generators;
std::vector<cmCPackGenericGenerator*> Generators;
typedef std::map<cmStdString, CreateGeneratorCall*> t_GeneratorCreatorsMap;
t_GeneratorCreatorsMap m_GeneratorCreators;
cmCPackLog* m_Logger;
t_GeneratorCreatorsMap GeneratorCreators;
cmCPackLog* Logger;
};
#endif
......@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -31,21 +31,21 @@
//----------------------------------------------------------------------
cmCPackGenericGenerator::cmCPackGenericGenerator()
{
m_GeneratorVerbose = false;
m_MakefileMap = 0;
m_Logger = 0;
this->GeneratorVerbose = false;
this->MakefileMap = 0;
this->Logger = 0;
}
//----------------------------------------------------------------------
cmCPackGenericGenerator::~cmCPackGenericGenerator()
{
m_MakefileMap = 0;
this->MakefileMap = 0;
}
//----------------------------------------------------------------------
int cmCPackGenericGenerator::PrepareNames()
{
this->SetOption("CPACK_GENERATOR", m_Name.c_str());
this->SetOption("CPACK_GENERATOR", this->Name.c_str());
std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
tempDirectory += "/_CPack_Packages/";
tempDirectory += this->GetOption("CPACK_GENERATOR");
......@@ -157,7 +157,7 @@ int cmCPackGenericGenerator::InstallProject()
std::string output;
int retVal = 1;
bool resB = cmSystemTools::RunSingleCommand(it->c_str(), &output,
&retVal, 0, m_GeneratorVerbose, 0);
&retVal, 0, this->GeneratorVerbose, 0);
if ( !resB || retVal )
{
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
......@@ -272,12 +272,12 @@ void cmCPackGenericGenerator::SetOption(const char* op, const char* value)
}
if ( !value )
{
m_MakefileMap->RemoveDefinition(op);
this->MakefileMap->RemoveDefinition(op);
return;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, this->GetNameOfClass()
<< "::SetOption(" << op << ", " << value << ")" << std::endl);
m_MakefileMap->AddDefinition(op, value);
this->MakefileMap->AddDefinition(op, value);
}
//----------------------------------------------------------------------
......@@ -346,15 +346,15 @@ int cmCPackGenericGenerator::ProcessGenerator()
//----------------------------------------------------------------------
int cmCPackGenericGenerator::Initialize(const char* name, cmMakefile* mf)
{
m_MakefileMap = mf;
m_Name = name;
this->MakefileMap = mf;
this->Name = name;
return 1;
}
//----------------------------------------------------------------------
const char* cmCPackGenericGenerator::GetOption(const char* op)
{
return m_MakefileMap->GetDefinition(op);
return this->MakefileMap->GetDefinition(op);
}
//----------------------------------------------------------------------
......@@ -363,18 +363,18 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
int found = 0;
// Find our own executable.
std::vector<cmStdString> failures;
m_CPackSelf = arg0;
cmSystemTools::ConvertToUnixSlashes(m_CPackSelf);
failures.push_back(m_CPackSelf);
m_CPackSelf = cmSystemTools::FindProgram(m_CPackSelf.c_str());
if(!cmSystemTools::FileExists(m_CPackSelf.c_str()))
this->CPackSelf = arg0;
cmSystemTools::ConvertToUnixSlashes(this->CPackSelf);
failures.push_back(this->CPackSelf);
this->CPackSelf = cmSystemTools::FindProgram(this->CPackSelf.c_str());
if(!cmSystemTools::FileExists(this->CPackSelf.c_str()))
{
failures.push_back(m_CPackSelf);
m_CPackSelf = "/usr/local/bin/ctest";
failures.push_back(this->CPackSelf);
this->CPackSelf = "/usr/local/bin/ctest";
}
if(!cmSystemTools::FileExists(m_CPackSelf.c_str()))
if(!cmSystemTools::FileExists(this->CPackSelf.c_str()))
{
failures.push_back(m_CPackSelf);
failures.push_back(this->CPackSelf);
cmOStringStream msg;
msg << "CTEST can not find the command line program ctest.\n";
msg << " argv[0] = \"" << arg0 << "\"\n";
......@@ -388,33 +388,33 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
}
std::string dir;
std::string file;
if(cmSystemTools::SplitProgramPath(m_CPackSelf.c_str(),
if(cmSystemTools::SplitProgramPath(this->CPackSelf.c_str(),
dir, file, true))
{
m_CMakeSelf = dir += "/cmake";
m_CMakeSelf += cmSystemTools::GetExecutableExtension();
if(cmSystemTools::FileExists(m_CMakeSelf.c_str()))
this->CMakeSelf = dir += "/cmake";
this->CMakeSelf += cmSystemTools::GetExecutableExtension();
if(cmSystemTools::FileExists(this->CMakeSelf.c_str()))
{
found = 1;
}
}
if ( !found )
{
failures.push_back(m_CMakeSelf);
failures.push_back(this->CMakeSelf);
#ifdef CMAKE_BUILD_DIR
std::string intdir = ".";
#ifdef CMAKE_INTDIR
intdir = CMAKE_INTDIR;
#endif
m_CMakeSelf = CMAKE_BUILD_DIR;
m_CMakeSelf += "/bin/";
m_CMakeSelf += intdir;
m_CMakeSelf += "/cmake";
m_CMakeSelf += cmSystemTools::GetExecutableExtension();
this->CMakeSelf = CMAKE_BUILD_DIR;
this->CMakeSelf += "/bin/";
this->CMakeSelf += intdir;
this->CMakeSelf += "/cmake";
this->CMakeSelf += cmSystemTools::GetExecutableExtension();
#endif
if(!cmSystemTools::FileExists(m_CMakeSelf.c_str()))
if(!cmSystemTools::FileExists(this->CMakeSelf.c_str()))
{
failures.push_back(m_CMakeSelf);
failures.push_back(this->CMakeSelf);
cmOStringStream msg;
msg << "CTEST can not find the command line program cmake.\n";
msg << " argv[0] = \"" << arg0 << "\"\n";
......@@ -439,14 +439,14 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
if(modules.empty() || !cmSystemTools::FileExists(modules.c_str()))
{
// next try exe/..
cMakeRoot = cmSystemTools::GetProgramPath(m_CMakeSelf.c_str());
cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str());
std::string::size_type slashPos = cMakeRoot.rfind("/");
if(slashPos != std::string::npos)
if(slashPos != std::string::npos)
{
cMakeRoot = cMakeRoot.substr(0, slashPos);
}
// is there no Modules direcory there?
modules = cMakeRoot + "/Modules/CMake.cmake";
modules = cMakeRoot + "/Modules/CMake.cmake";
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: "
<< modules.c_str() << std::endl);
}
......@@ -481,8 +481,8 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
#endif
if (!cmSystemTools::FileExists(modules.c_str()))
{
// try
cMakeRoot = cmSystemTools::GetProgramPath(m_CMakeSelf.c_str());
// try
cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str());
cMakeRoot += CMAKE_DATA_DIR;
modules = cMakeRoot + "/Modules/CMake.cmake";
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: "
......@@ -491,9 +491,9 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
if(!cmSystemTools::FileExists(modules.c_str()))
{
// next try exe
cMakeRoot = cmSystemTools::GetProgramPath(m_CMakeSelf.c_str());
cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str());
// is there no Modules direcory there?
modules = cMakeRoot + "/Modules/CMake.cmake";
modules = cMakeRoot + "/Modules/CMake.cmake";
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: "
<< modules.c_str() << std::endl);
}
......@@ -506,10 +506,10 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
cMakeRoot.c_str());
return 0;
}
m_CMakeRoot = cMakeRoot;
this->CMakeRoot = cMakeRoot;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: "
<< m_CMakeRoot.c_str() << std::endl);
this->SetOption("CMAKE_ROOT", m_CMakeRoot.c_str());
<< this->CMakeRoot.c_str() << std::endl);
this->SetOption("CMAKE_ROOT", this->CMakeRoot.c_str());
return 1;
}
......@@ -526,34 +526,34 @@ int cmCPackGenericGenerator::CompressFiles(const char* outFileName,
//----------------------------------------------------------------------
const char* cmCPackGenericGenerator::GetInstallPath()
{
if ( !m_InstallPath.empty() )
if ( !this->InstallPath.empty() )
{
return m_InstallPath.c_str();
return this->InstallPath.c_str();
}
#if defined(_WIN32) && !defined(__CYGWIN__)
const char* prgfiles = cmsys::SystemTools::GetEnv("ProgramFiles");
const char* sysDrive = cmsys::SystemTools::GetEnv("SystemDrive");
if ( prgfiles )
{
m_InstallPath = prgfiles;
this->InstallPath = prgfiles;
}
else if ( sysDrive )
{
m_InstallPath = sysDrive;
m_InstallPath += "/Program Files";
this->InstallPath = sysDrive;
this->InstallPath += "/Program Files";
}
else
else
{
m_InstallPath = "c:/Program Files";
this->InstallPath = "c:/Program Files";
}
m_InstallPath += "/";
m_InstallPath += this->GetOption("CPACK_PACKAGE_NAME");
m_InstallPath += "-";
m_InstallPath += this->GetOption("CPACK_PACKAGE_VERSION");
this->InstallPath += "/";
this->InstallPath += this->GetOption("CPACK_PACKAGE_NAME");
this->InstallPath += "-";
this->InstallPath += this->GetOption("CPACK_PACKAGE_VERSION");
#else
m_InstallPath = "/usr/local/";
this->InstallPath = "/usr/local/";
#endif
return m_InstallPath.c_str();
return this->InstallPath.c_str();
}
//----------------------------------------------------------------------
......@@ -561,7 +561,7 @@ std::string cmCPackGenericGenerator::FindTemplate(const char* name)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: "
<< name << std::endl);
std::string ffile = m_MakefileMap->GetModulesFile(name);
std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
<< ffile.c_str() << std::endl);
return ffile;
......@@ -571,6 +571,6 @@ std::string cmCPackGenericGenerator::FindTemplate(const char* name)
bool cmCPackGenericGenerator::ConfigureFile(const char* inName,
const char* outName)
{
return m_MakefileMap->ConfigureFile(inName, outName,
return this->MakefileMap->ConfigureFile(inName, outName,
false, true, false) == 1;
}
......@@ -29,7 +29,7 @@
do { \
cmOStringStream cmCPackLog_msg; \
cmCPackLog_msg << msg; \
m_Logger->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\
this->Logger->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\
} while ( 0 )
#ifdef cerr
......@@ -56,7 +56,7 @@ public:
/**
* If verbose then more informaiton is printed out
*/
void SetVerbose(bool val) { m_GeneratorVerbose = val; }
void SetVerbose(bool val) { this->GeneratorVerbose = val; }
/**
* Do the actual processing. Subclass has to override it.
......@@ -83,7 +83,7 @@ public:
int FindRunningCMake(const char* arg0);
//! Set the logger
void SetLogger(cmCPackLog* log) { m_Logger = log; }
void SetLogger(cmCPackLog* log) { this->Logger = log; }
protected:
int PrepareNames();
......@@ -99,19 +99,19 @@ protected:
virtual std::string FindTemplate(const char* name);
virtual bool ConfigureFile(const char* inName, const char* outName);
bool m_GeneratorVerbose;
std::string m_Name;
bool GeneratorVerbose;
std::string Name;
std::string m_InstallPath;
std::string InstallPath;
std::string m_CPackSelf;
std::string m_CMakeSelf;
std::string m_CMakeRoot;
std::string CPackSelf;
std::string CMakeSelf;
std::string CMakeRoot;
cmCPackLog* m_Logger;
cmCPackLog* Logger;
private:
cmMakefile* m_MakefileMap;
cmMakefile* MakefileMap;
};
#endif
......@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -22,19 +22,19 @@
//----------------------------------------------------------------------
cmCPackLog::cmCPackLog()
{
m_Verbose = false;
m_Debug = false;
m_Quiet = false;
m_NewLine = true;
this->Verbose = false;
this->Debug = false;
this->Quiet = false;
this->NewLine = true;
m_LastTag = cmCPackLog::NOTAG;
this->LastTag = cmCPackLog::NOTAG;
#undef cerr
#undef cout
m_DefaultOutput = &std::cout;
m_DefaultError = &std::cerr;
m_LogOutput = 0;
m_LogOutputCleanup = false;
this->DefaultOutput = &std::cout;
this->DefaultError = &std::cerr;
this->LogOutput = 0;
this->LogOutputCleanup = false;
}
//----------------------------------------------------------------------
......@@ -46,12 +46,12 @@ cmCPackLog::~cmCPackLog()
//----------------------------------------------------------------------
void cmCPackLog::SetLogOutputStream(std::ostream* os)
{
if ( m_LogOutputCleanup && m_LogOutput )
if ( this->LogOutputCleanup && this->LogOutput )
{
delete m_LogOutput;
delete this->LogOutput;
}
m_LogOutputCleanup = false;
m_LogOutput = os;
this->LogOutputCleanup = false;
this->LogOutput = os;
}
//----------------------------------------------------------------------
......@@ -72,7 +72,7 @@ bool cmCPackLog::SetLogOutputFile(const char* fname)
{
return false;
}
m_LogOutputCleanup = true;
this->LogOutputCleanup = true;
return true;
}
......@@ -84,7 +84,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
bool display = false;
// Display file and line number if debug
bool useFileAndLine = m_Debug;
bool useFileAndLine = this->Debug;
bool output = false;
bool debug = false;
......@@ -95,7 +95,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
// When writing in file, add list of tags whenever tag changes.
std::string tagString;
bool needTagString = false;
if ( m_LogOutput && m_LastTag != tag )
if ( this->LogOutput && this->LastTag != tag )
{
needTagString = true;
}
......@@ -130,7 +130,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
tagString = "ERROR";
}
}
if ( tag & LOG_DEBUG && m_Debug )
if ( tag & LOG_DEBUG && this->Debug )
{
debug = true;
display = true;
......@@ -141,7 +141,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
}
useFileAndLine = true;
}
if ( tag & LOG_VERBOSE && m_Verbose )
if ( tag & LOG_VERBOSE && this->Verbose )
{
verbose = true;
display = true;
......@@ -151,73 +151,74 @@ void cmCPackLog::Log(int tag, const char* file, int line,
tagString = "VERBOSE";
}
}
if ( m_Quiet )
if ( this->Quiet )
{
display = false;
}
if ( m_LogOutput )
if ( this->LogOutput )
{
if ( needTagString )
{
*m_LogOutput << "[" << file << ":" << line << " " << tagString << "] ";
*this->LogOutput << "[" << file << ":" << line << " "
<< tagString << "] ";
}
m_LogOutput->write(msg, length);
this->LogOutput->write(msg, length);
}
m_LastTag = tag;
this->LastTag = tag;
if ( !display )
{
return;
}
if ( m_NewLine )
if ( this->NewLine )
{
if ( error && !m_ErrorPrefix.empty() )
if ( error && !this->ErrorPrefix.empty() )
{
*m_DefaultError << m_ErrorPrefix.c_str();
*this->DefaultError << this->ErrorPrefix.c_str();
}
else if ( warning && !m_WarningPrefix.empty() )
else if ( warning && !this->WarningPrefix.empty() )
{
*m_DefaultError << m_WarningPrefix.c_str();
*this->DefaultError << this->WarningPrefix.c_str();
}
else if ( output && !m_OutputPrefix.empty() )
else if ( output && !this->OutputPrefix.empty() )
{
*m_DefaultOutput << m_OutputPrefix.c_str();
*this->DefaultOutput << this->OutputPrefix.c_str();
}
else if ( verbose && !m_VerbosePrefix.empty() )
else if ( verbose && !this->VerbosePrefix.empty() )
{
*m_DefaultOutput << m_VerbosePrefix.c_str();
*this->DefaultOutput << this->VerbosePrefix.c_str();
}
else if ( debug && !m_DebugPrefix.empty() )
else if ( debug && !this->DebugPrefix.empty() )
{
*m_DefaultOutput << m_DebugPrefix.c_str();
*this->DefaultOutput << this->DebugPrefix.c_str();
}
else if ( !m_Prefix.empty() )
else if ( !this->Prefix.empty() )
{
*m_DefaultOutput << m_Prefix.c_str();
*this->DefaultOutput << this->Prefix.c_str();
}
if ( useFileAndLine )
{
if ( error || warning )
{
*m_DefaultError << file << ":" << line << " ";
*this->DefaultError << file << ":" << line << " ";
}
else
{
*m_DefaultOutput << file << ":" << line << " ";
*this->DefaultOutput << file << ":" << line << " ";
}
}
}
if ( error || warning )
{
m_DefaultError->write(msg, length);
m_DefaultError->flush();
this->DefaultError->write(msg, length);
this->DefaultError->flush();
}
else
{
m_DefaultOutput->write(msg, length);
m_DefaultOutput->flush();
this->DefaultOutput->write(msg, length);
this->DefaultOutput->flush();
}
if ( msg[length-1] == '\n' || length > 2 )
{
m_NewLine = true;
this->NewLine = true;
}