Merge topic 'clean-up-cmLocalGenerator'

74d565e0 Remove unused cmLocalGenerator include.
09466690 Add cmOutputConverter include where needed.
0a730445 cmake: Remove needless cmLocalGenerator creation.
3339a750 CTest: Port away from cmLocalGenerator.
6da4cd8f CTest: Remove needless cmLocalGenerator creation.
94cc4e74 CPack: Remove needless cmLocalGenerator creation.
This commit is contained in:
Brad King 2015-10-06 10:59:06 -04:00 committed by CMake Topic Stage
commit 53d90de3d9
31 changed files with 9 additions and 57 deletions

View File

@ -24,7 +24,6 @@
#include <cmsys/RegularExpression.hxx>
#include <cmGlobalGenerator.h>
#include <cmLocalGenerator.h>
#include <cmSystemTools.h>
#include <cmMakefile.h>
#include <cmGeneratedFileStream.h>

View File

@ -14,7 +14,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -14,7 +14,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -14,7 +14,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -16,7 +16,6 @@
#include "cmCPackLog.h"
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmGeneratedFileStream.h"
#include "cmCPackComponentGroup.h"
#include "cmXMLSafe.h"
@ -723,8 +722,6 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(
new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(
gg.CreateLocalGenerator(mf.get()));
std::string realInstallDirectory = tempInstallDirectory;
if ( !installSubDirectory.empty() && installSubDirectory != "/" )
{

View File

@ -13,7 +13,6 @@
#include "cmCPackNSISGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -13,7 +13,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -13,7 +13,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmGeneratedFileStream.h"

View File

@ -14,7 +14,6 @@
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmCPackLog.h"

View File

@ -18,7 +18,6 @@
#include "cmCPackGenerator.h"
#include "cmake.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmCPackLog.h"
@ -204,8 +203,6 @@ int main (int argc, char const* const* argv)
cmGlobalGenerator cmgg(&cminst);
cmsys::auto_ptr<cmMakefile> globalMF(
new cmMakefile(&cmgg, cminst.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> cmlg(
cmgg.CreateLocalGenerator(globalMF.get()));
#if defined(__CYGWIN__)
globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
#endif

View File

@ -15,7 +15,6 @@
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmGeneratedFileStream.h"
#include "cmXMLWriter.h"

View File

@ -728,7 +728,6 @@ int cmCTestLaunch::Main(int argc, const char* const argv[])
//----------------------------------------------------------------------------
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
#include <cmsys/auto_ptr.hxx>
@ -739,8 +738,6 @@ void cmCTestLaunch::LoadConfig()
cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(
gg.CreateLocalGenerator(mf.get()));
std::string fname = this->LogDir;
fname += "CTestLaunchConfig.cmake";
if(cmSystemTools::FileExists(fname.c_str()) &&

View File

@ -16,7 +16,6 @@
#include "cmake.h"
#include "cmFunctionBlocker.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmGeneratedFileStream.h"
@ -86,7 +85,6 @@ cmCTestScriptHandler::cmCTestScriptHandler()
this->EmptyBinDir = false;
this->EmptyBinDirOnce = false;
this->Makefile = 0;
this->LocalGenerator = 0;
this->CMake = 0;
this->GlobalGenerator = 0;
@ -128,9 +126,6 @@ void cmCTestScriptHandler::Initialize()
delete this->Makefile;
this->Makefile = 0;
delete this->LocalGenerator;
this->LocalGenerator = 0;
delete this->GlobalGenerator;
this->GlobalGenerator = 0;
@ -141,7 +136,6 @@ void cmCTestScriptHandler::Initialize()
cmCTestScriptHandler::~cmCTestScriptHandler()
{
delete this->Makefile;
delete this->LocalGenerator;
delete this->GlobalGenerator;
delete this->CMake;
}
@ -179,15 +173,14 @@ int cmCTestScriptHandler::ProcessHandler()
void cmCTestScriptHandler::UpdateElapsedTime()
{
if (this->LocalGenerator)
if (this->Makefile)
{
// set the current elapsed time
char timeString[20];
int itime = static_cast<unsigned int>(cmSystemTools::GetTime()
- this->ScriptStartTime);
sprintf(timeString,"%i",itime);
this->LocalGenerator->GetMakefile()->AddDefinition("CTEST_ELAPSED_TIME",
timeString);
this->Makefile->AddDefinition("CTEST_ELAPSED_TIME", timeString);
}
}
@ -316,7 +309,6 @@ void cmCTestScriptHandler::CreateCMake()
{
delete this->CMake;
delete this->GlobalGenerator;
delete this->LocalGenerator;
delete this->Makefile;
}
this->CMake = new cmake;
@ -327,8 +319,6 @@ void cmCTestScriptHandler::CreateCMake()
cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot();
this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot);
this->LocalGenerator =
this->GlobalGenerator->CreateLocalGenerator(this->Makefile);
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);

View File

@ -18,7 +18,6 @@
#include "cmListFileCache.h"
class cmMakefile;
class cmLocalGenerator;
class cmGlobalGenerator;
class cmake;
class cmCTestCommand;
@ -166,7 +165,6 @@ private:
double ScriptStartTime;
cmMakefile *Makefile;
cmLocalGenerator *LocalGenerator;
cmGlobalGenerator *GlobalGenerator;
cmake *CMake;
};

View File

@ -12,7 +12,6 @@
#include "cmCTestStartCommand.h"
#include "cmCTest.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmCTestVC.h"
#include "cmGeneratedFileStream.h"

View File

@ -24,7 +24,6 @@
#include <cmsys/FStream.hxx>
#include "cmMakefile.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmCommand.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
@ -1593,8 +1592,6 @@ void cmCTestTestHandler::GetListOfTests()
cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(
gg.CreateLocalGenerator(mf.get()));
mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
this->CTest->GetConfigType().c_str());

View File

@ -15,7 +15,6 @@
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmVersion.h"
#include "cmGeneratedFileStream.h"

View File

@ -10,7 +10,6 @@
See the License for more information.
============================================================================*/
#include "cmAddDependenciesCommand.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
// cmDependenciesCommand

View File

@ -11,7 +11,6 @@
============================================================================*/
#include "cmBuildCommand.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
//----------------------------------------------------------------------

View File

@ -14,7 +14,6 @@
#include "cmCTest.h"
#include "cmake.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
@ -520,7 +519,6 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator(mf.get()));
if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(),
mf.get()) )
{

View File

@ -10,7 +10,6 @@
See the License for more information.
============================================================================*/
#include "cmEnableTestingCommand.h"
#include "cmLocalGenerator.h"
// we do this in the final pass so that we now the subdirs have all
// been defined

View File

@ -11,7 +11,6 @@
============================================================================*/
#include "cmExportCommand.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmGeneratedFileStream.h"
#include "cmake.h"

View File

@ -15,7 +15,6 @@
#include "cmHexFileConverter.h"
#include "cmInstallType.h"
#include "cmFileTimeComparison.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmCryptoHash.h"
#include "cmAlgorithms.h"

View File

@ -12,7 +12,6 @@
#include "cmGetCMakePropertyCommand.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmake.h"
#include "cmState.h"
#include "cmAlgorithms.h"

View File

@ -15,7 +15,6 @@
#include "cmState.h"
#include "cmTest.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmSourceFile.h"
#include "cmPropertyDefinition.h"

View File

@ -11,6 +11,7 @@
============================================================================*/
#include "cmIfCommand.h"
#include "cmStringCommand.h"
#include "cmOutputConverter.h"
#include "cmConditionEvaluator.h"

View File

@ -12,7 +12,7 @@
#include "cmListFileCache.h"
#include "cmListFileLexer.h"
#include "cmLocalGenerator.h"
#include "cmOutputConverter.h"
#include "cmSystemTools.h"
#include "cmMakefile.h"
#include "cmVersion.h"

View File

@ -10,7 +10,6 @@
See the License for more information.
============================================================================*/
#include "cmSetTargetPropertiesCommand.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
// cmSetTargetPropertiesCommand

View File

@ -12,7 +12,6 @@
#include "cmSourceFile.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmake.h"

View File

@ -12,7 +12,6 @@
#include "cmSourceFileLocation.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmSystemTools.h"
#include "cmAlgorithms.h"

View File

@ -378,20 +378,19 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
cmState::Snapshot snapshot = this->GetCurrentSnapshot();
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get()));
lg->GetMakefile()->SetCurrentBinaryDirectory
mf->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetCurrentSourceDirectory
mf->SetCurrentSourceDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
if (this->GetWorkingMode() != NORMAL_MODE)
{
std::string file(cmSystemTools::CollapseFullPath(path));
cmSystemTools::ConvertToUnixSlashes(file);
lg->GetMakefile()->SetScriptModeFile(file.c_str());
mf->SetScriptModeFile(file.c_str());
lg->GetMakefile()->SetArgcArgv(args);
mf->SetArgcArgv(args);
}
if (!lg->GetMakefile()->ReadListFile(path))
if (!mf->ReadListFile(path))
{
cmSystemTools::Error("Error processing file: ", path);
}
@ -1906,7 +1905,6 @@ int cmake::CheckBuildSystem()
cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator(mf.get()));
if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
cmSystemTools::GetErrorOccuredFlag())
{