summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx11
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalGenerator.h1
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
10 files changed, 20 insertions, 14 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index cca3858706..fdfa35e001 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -497,7 +497,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
std::string sourceLinkedResourceName = "[Source directory]";
std::string linkSourceDirectory = this->GetEclipsePath(
- mf->GetCurrentSourceDirectory());
+ lg->GetCurrentSourceDirectory());
// .project dir can't be subdir of a linked resource dir
if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
linkSourceDirectory))
@@ -638,7 +638,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
++it)
{
std::string linkSourceDirectory = this->GetEclipsePath(
- it->second[0]->GetMakefile()->GetCurrentSourceDirectory());
+ it->second[0]->GetCurrentSourceDirectory());
// a linked resource must not point to a parent directory of .project or
// .project itself
if ((baseDir != linkSourceDirectory) &&
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c7e09b9834..8693785218 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2105,7 +2105,7 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
for(std::vector<cmLocalGenerator*>::const_iterator it =
this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it)
{
- std::string sd = (*it)->GetMakefile()->GetCurrentSourceDirectory();
+ std::string sd = (*it)->GetCurrentSourceDirectory();
if (sd == start_dir)
{
return *it;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b2d8f4a658..04441ebdf8 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -412,8 +412,9 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
{
this->CurrentProject = root->GetProjectName();
this->SetCurrentLocalGenerator(root);
- cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
- this->ProjectSourceDirectoryComponents);
+ cmSystemTools::SplitPath(
+ this->CurrentLocalGenerator->GetCurrentSourceDirectory(),
+ this->ProjectSourceDirectoryComponents);
cmSystemTools::SplitPath(
this->CurrentLocalGenerator->GetCurrentBinaryDirectory(),
this->ProjectOutputDirectoryComponents);
@@ -461,7 +462,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
mf->AddGeneratorTarget(allbuild, allBuildGt);
// Refer to the main build configuration file for easy editing.
- std::string listfile = mf->GetCurrentSourceDirectory();
+ std::string listfile = root->GetCurrentSourceDirectory();
listfile += "/";
listfile += "CMakeLists.txt";
allBuildGt->AddSource(listfile.c_str());
@@ -557,7 +558,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmGeneratorTarget* targetGT = this->GetGeneratorTarget(&target);
// Refer to the build configuration file for easy editing.
- listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
+ listfile = lg->GetCurrentSourceDirectory();
listfile += "/";
listfile += "CMakeLists.txt";
targetGT->AddSource(listfile.c_str());
@@ -3372,7 +3373,7 @@ bool cmGlobalXCodeGenerator
// Point Xcode at the top of the source tree.
{
std::string pdir =
- this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory());
+ this->RelativeToBinary(root->GetCurrentSourceDirectory());
this->RootObject->AddAttribute("projectDirPath",
this->CreateString(pdir.c_str()));
this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8096bd7192..c0c50c4bbc 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2883,6 +2883,11 @@ const char* cmLocalGenerator::GetCurrentBinaryDirectory() const
return this->StateSnapshot.GetDirectory().GetCurrentBinary();
}
+const char* cmLocalGenerator::GetCurrentSourceDirectory() const
+{
+ return this->StateSnapshot.GetDirectory().GetCurrentSource();
+}
+
//----------------------------------------------------------------------------
std::string
cmLocalGenerator::GetTargetDirectory(cmTarget const&) const
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7ca587e602..80706673c0 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -259,6 +259,7 @@ public:
const char* GetBinaryDirectory() const;
const char* GetCurrentBinaryDirectory() const;
+ const char* GetCurrentSourceDirectory() const;
/**
* Generate a Mac OS X application bundle Info.plist file.
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index c226b46ad7..4d024e1e71 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -215,7 +215,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
dspname += ".dsp.cmake";
cmCustomCommandLine commandLine;
commandLine.push_back(cmSystemTools::GetCMakeCommand());
- std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
+ std::string makefileIn = this->GetCurrentSourceDirectory();
makefileIn += "/";
makefileIn += "CMakeLists.txt";
if(!cmSystemTools::FileExists(makefileIn.c_str()))
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a94113a62a..082b7c3d20 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -282,7 +282,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
stampName += "generate.stamp";
cmCustomCommandLine commandLine;
commandLine.push_back(cmSystemTools::GetCMakeCommand());
- std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
+ std::string makefileIn = this->GetCurrentSourceDirectory();
makefileIn += "/";
makefileIn += "CMakeLists.txt";
makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9c71a10bf4..7bee268fa1 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1114,7 +1114,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< this->Convert(this->LocalGenerator->GetSourceDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " "
- << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
+ << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " "
<< this->Convert(this->LocalGenerator->GetBinaryDirectory(),
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d792ba7154..133d2ffc7b 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -45,8 +45,7 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
// We only want to process global targets that live in the home
// (i.e. top-level) directory. CMake creates copies of these targets
// in every directory, which we don't need.
- cmMakefile *mf = target->Target->GetMakefile();
- if (strcmp(mf->GetCurrentSourceDirectory(),
+ if (strcmp(target->GetLocalGenerator()->GetCurrentSourceDirectory(),
target->GetLocalGenerator()->GetSourceDirectory()) == 0)
return new cmNinjaUtilityTargetGenerator(target);
// else fallthrough
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8cefd7cc0a..92b7a57e27 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2243,7 +2243,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
{
// Look through the sources for AndroidManifest.xml and use
// its location as the root source directory.
- std::string rootDir = this->Makefile->GetCurrentSourceDirectory();
+ std::string rootDir = this->LocalGenerator->GetCurrentSourceDirectory();
{
std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources, "");