summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-21 13:03:54 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-05-21 13:03:54 (GMT)
commitdb90e7c6bcd40c2cdc27232f5305800ae215ce14 (patch)
tree62bc75f07ee3fd7d87ff187bd4e2cfa0b030d74b /Source
parent3e3a09d1d3c91a6522260734b4542b420152e21c (diff)
parente54d2fdf50d7e1170f9e3dcbcb62ebacc7205de6 (diff)
downloadCMake-db90e7c6bcd40c2cdc27232f5305800ae215ce14.zip
CMake-db90e7c6bcd40c2cdc27232f5305800ae215ce14.tar.gz
CMake-db90e7c6bcd40c2cdc27232f5305800ae215ce14.tar.bz2
Merge topic 'clean-up-cmLocalGenerator'
e54d2fdf Convert: Remove specification of default parameter. 20c2fe4d cmLocalGenerator: Get enabled languages from cmState. 7601a7b1 cmLocalGenerator: Implement IsRootMakefile in terms of cmState. 4080ca49 cmLocalGenerator: Inline ReadListFile method. ad706819 cmLocalGenerator: Devirtualize method.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx26
-rw-r--r--Source/cmLocalGenerator.h5
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx3
-rw-r--r--Source/cmake.cxx3
5 files changed, 13 insertions, 26 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 118d5a3..c2e996c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -76,7 +76,7 @@ cmLocalGenerator::~cmLocalGenerator()
bool cmLocalGenerator::IsRootMakefile() const
{
- return !this->GetParent();
+ return !this->StateSnapshot.GetParent().IsValid();
}
//----------------------------------------------------------------------------
@@ -115,8 +115,10 @@ void cmLocalGenerator::Configure()
filesDir += cmake::GetCMakeFilesDirectory();
cmSystemTools::MakeDirectory(filesDir.c_str());
- // find & read the list file
- this->ReadInputFile();
+ std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory();
+ currentStart += "/CMakeLists.txt";
+ assert(cmSystemTools::FileExists(currentStart.c_str(), true));
+ this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
// at the end of the ReadListFile handle any old style subdirs
// first get all the subdirectories
@@ -183,16 +185,6 @@ void cmLocalGenerator::ComputeObjectMaxPath()
this->ObjectMaxPathViolations.clear();
}
-//----------------------------------------------------------------------------
-void cmLocalGenerator::ReadInputFile()
-{
- // Look for the CMakeLists.txt file.
- std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory();
- currentStart += "/CMakeLists.txt";
- assert(cmSystemTools::FileExists(currentStart.c_str(), true));
- this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
-}
-
void cmLocalGenerator::ConfigureFinalPass()
{
this->Makefile->ConfigureFinalPass();
@@ -1003,8 +995,8 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
{
return this->Convert(cmSystemTools::GetCMakeCommand(), FULL, SHELL);
}
- std::vector<std::string> enabledLanguages;
- this->GlobalGenerator->GetEnabledLanguages(enabledLanguages);
+ std::vector<std::string> enabledLanguages =
+ this->GetState()->GetEnabledLanguages();
// loop over language specific replace variables
int pos = 0;
while(ruleReplaceVars[pos])
@@ -1846,7 +1838,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
fdi != fwDirs.end(); ++fdi)
{
frameworkPath += fwSearchFlag;
- frameworkPath += this->Convert(*fdi, NONE, shellFormat, false);
+ frameworkPath += this->Convert(*fdi, NONE, shellFormat);
frameworkPath += " ";
}
}
@@ -1900,7 +1892,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
ri != runtimeDirs.end(); ++ri)
{
rpath += cli.GetRuntimeFlag();
- rpath += this->Convert(*ri, NONE, shellFormat, false);
+ rpath += this->Convert(*ri, NONE, shellFormat);
rpath += " ";
}
fout << rpath;
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 67ac4fd..3fca225 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -395,7 +395,7 @@ public:
protected:
///! put all the libraries for a target on into the given stream
- virtual void OutputLinkLibraries(std::string& linkLibraries,
+ void OutputLinkLibraries(std::string& linkLibraries,
std::string& frameworkPath,
std::string& linkPath,
cmGeneratorTarget &,
@@ -447,9 +447,6 @@ protected:
definition. Issues a warning. */
virtual bool CheckDefinition(std::string const& define) const;
- /** Read the input CMakeLists.txt file. */
- void ReadInputFile();
-
cmMakefile *Makefile;
cmState::Snapshot StateSnapshot;
cmGlobalGenerator *GlobalGenerator;
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index c001622..450f573 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -626,7 +626,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
install_name_dir =
this->LocalGenerator->Convert(install_name_dir,
cmLocalGenerator::NONE,
- cmLocalGenerator::SHELL, false);
+ cmLocalGenerator::SHELL);
vars.TargetInstallNameDir = install_name_dir.c_str();
}
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 9407011..bbf03ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -525,8 +525,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
{
vars["INSTALLNAME_DIR"] = localGen.Convert(install_dir,
cmLocalGenerator::NONE,
- cmLocalGenerator::SHELL,
- false);
+ cmLocalGenerator::SHELL);
}
}
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index b2c603f..ebec923 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -456,8 +456,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::vector<std::string> includeDirs;
cmSystemTools::ExpandListArgument(includes, includeDirs);
- std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0,
- language, false);
+ std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language);
std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS");
printf("%s %s\n", includeFlags.c_str(), definitions.c_str());