summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-23 13:08:20 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-06-23 13:08:20 (GMT)
commit56e5d4e18095734a4418159f05dfc1e5c53f2877 (patch)
tree1f679a3139764963af0c788f21d4c3f4236747df
parent5ab7dd544e2d10bf6b05ab046a852b84eee63126 (diff)
parente77142350de1dec03ca788e3d3e278b7b9358fb5 (diff)
downloadCMake-56e5d4e18095734a4418159f05dfc1e5c53f2877.zip
CMake-56e5d4e18095734a4418159f05dfc1e5c53f2877.tar.gz
CMake-56e5d4e18095734a4418159f05dfc1e5c53f2877.tar.bz2
Merge topic 'use-generator-target'
e7714235 Get the local generator from the GeneratorTarget. 5aa556be cmMakefileTargetGenerator: Require cmGeneratorTarget. bb88668a cmNinjaGenerator: Require cmGeneratorTarget. a3b210fd cmGeneratorTarget: Require a cmLocalGenerator to construct. 8ec60c67 cmGlobalGenerator: Create GeneratorTargets with a local generator. dee197fe GHS: Use a cmGeneratorTarget in generator API. b2b41b83 cmGeneratorTarget: Add accessor for cmLocalGenerator. 2e9333a1 C::B: Get the Makefile from the LocalGenerator, not vice-versa.
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx24
-rw-r--r--Source/cmExtraCodeBlocksGenerator.h5
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmGeneratorTarget.h4
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx18
-rw-r--r--Source/cmGhsMultiTargetGenerator.h3
-rw-r--r--Source/cmGlobalGenerator.cxx9
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx2
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx13
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx11
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx2
-rw-r--r--Source/cmOSXBundleGenerator.cxx2
-rw-r--r--Source/cmQtAutoGenerators.cxx6
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
-rw-r--r--Source/cmake.cxx2
22 files changed, 70 insertions, 57 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index e374387..a31e832 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -313,7 +313,7 @@ void cmExtraCodeBlocksGenerator
" "<<virtualFolders<<"\n"
" <Build>\n";
- this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
+ this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
// add all executable and library targets and some of the GLOBAL
// and UTILITY targets
@@ -335,7 +335,7 @@ void cmExtraCodeBlocksGenerator
makefile->GetHomeOutputDirectory())==0)
{
this->AppendTarget(fout, ti->first, 0,
- make.c_str(), makefile, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str());
}
}
break;
@@ -351,7 +351,7 @@ void cmExtraCodeBlocksGenerator
}
this->AppendTarget(fout, ti->first, 0,
- make.c_str(), makefile, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str());
break;
case cmTarget::EXECUTABLE:
case cmTarget::STATIC_LIBRARY:
@@ -360,11 +360,11 @@ void cmExtraCodeBlocksGenerator
case cmTarget::OBJECT_LIBRARY:
{
this->AppendTarget(fout, ti->first, &ti->second,
- make.c_str(), makefile, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str());
std::string fastTarget = ti->first;
fastTarget += "/fast";
this->AppendTarget(fout, fastTarget, &ti->second,
- make.c_str(), makefile, compiler.c_str());
+ make.c_str(), *lg, compiler.c_str());
}
break;
default:
@@ -519,14 +519,16 @@ void cmExtraCodeBlocksGenerator
// Write a dummy file for OBJECT libraries, so C::B can reference some file
std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
- cmMakefile* mf, cmTarget* target) const
+ cmLocalGenerator* lg,
+ cmTarget* target) const
{
+ cmMakefile *mf = lg->GetMakefile();
// this file doesn't seem to be used by C::B in custom makefile mode,
// but we generate a unique file for each OBJECT library so in case
// C::B uses it in some way, the targets don't interfere with each other.
std::string filename = mf->GetCurrentBinaryDirectory();
filename += "/";
- filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
+ filename += lg->GetTargetDirectory(*target);
filename += "/";
filename += target->GetName();
filename += ".objlib";
@@ -547,9 +549,10 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
const std::string& targetName,
cmTarget* target,
const char* make,
- const cmMakefile* makefile,
+ const cmLocalGenerator* lg,
const char* compiler)
{
+ cmMakefile const* makefile = lg->GetMakefile();
std::string makefileName = makefile->GetCurrentBinaryDirectory();
makefileName += "/Makefile";
@@ -583,7 +586,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::string location;
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
{
- location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
+ location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
target);
}
else
@@ -618,8 +621,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::set<std::string> uniqIncludeDirs;
std::vector<std::string> includes;
- target->GetMakefile()->GetLocalGenerator()->
- GetIncludeDirectories(includes, gtgt, "C", buildType);
+ lg->GetIncludeDirectories(includes, gtgt, "C", buildType);
uniqIncludeDirs.insert(includes.begin(), includes.end());
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 97da1b8..e5ede9a 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -48,7 +48,8 @@ private:
void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
const std::string& filename);
- std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
+ std::string CreateDummyTargetFile(cmLocalGenerator* lg,
+ cmTarget* target) const;
std::string GetCBCompilerId(const cmMakefile* mf);
int GetCBTargetType(cmTarget* target);
@@ -58,7 +59,7 @@ private:
const std::string& targetName,
cmTarget* target,
const char* make,
- const cmMakefile* makefile,
+ const cmLocalGenerator* lg,
const char* compiler);
};
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2f68ab0..4494553 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -220,14 +220,20 @@ struct TagVisitor
};
//----------------------------------------------------------------------------
-cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t),
+cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
+ : Target(t),
SourceFileFlagsConstructed(false)
{
this->Makefile = this->Target->GetMakefile();
- this->LocalGenerator = this->Makefile->GetLocalGenerator();
+ this->LocalGenerator = lg;
this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
}
+cmLocalGenerator* cmGeneratorTarget::GetLocalGenerator() const
+{
+ return this->LocalGenerator;
+}
+
//----------------------------------------------------------------------------
int cmGeneratorTarget::GetType() const
{
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index a8edcb8..675ee9f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -24,7 +24,9 @@ class cmTarget;
class cmGeneratorTarget
{
public:
- cmGeneratorTarget(cmTarget*);
+ cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
+
+ cmLocalGenerator* GetLocalGenerator() const;
int GetType() const;
std::string GetName() const;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 01e2011..14efc3e 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -21,23 +21,24 @@
std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
-cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget *target)
- : Target(target)
+cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget *target)
+ : Target(target->Target)
+ , GeneratorTarget(target)
, LocalGenerator(static_cast<cmLocalGhsMultiGenerator *>(
- target->GetMakefile()->GetLocalGenerator()))
- , Makefile(target->GetMakefile())
- , TargetGroup(DetermineIfTargetGroup(target))
+ target->GetLocalGenerator()))
+ , Makefile(target->Target->GetMakefile())
+ , TargetGroup(DetermineIfTargetGroup(target->Target))
, DynamicDownload(false)
{
- this->RelBuildFilePath = this->GetRelBuildFilePath(target);
+ this->RelBuildFilePath = this->GetRelBuildFilePath(target->Target);
this->RelOutputFileName =
this->RelBuildFilePath + this->Target->GetName() + ".a";
this->RelBuildFileName = this->RelBuildFilePath;
- this->RelBuildFileName += this->GetBuildFileName(target);
+ this->RelBuildFileName += this->GetBuildFileName(target->Target);
- std::string absPathToRoot = this->GetAbsPathToRoot(target);
+ std::string absPathToRoot = this->GetAbsPathToRoot(target->Target);
absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
@@ -373,7 +374,6 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries()
cmTarget *tg(GetGlobalGenerator()->FindTarget(libName));
if (NULL != tg)
{
- cmGhsMultiTargetGenerator gmtg(tg);
libName = tg->GetName() + ".a";
}
*this->GetFolderBuildStreams() << " -l\"" << libName << "\""
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 8e81db8..c29a31e 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -27,7 +27,7 @@ class cmCustomCommand;
class cmGhsMultiTargetGenerator
{
public:
- cmGhsMultiTargetGenerator(cmTarget *target);
+ cmGhsMultiTargetGenerator(cmGeneratorTarget* target);
virtual ~cmGhsMultiTargetGenerator();
@@ -100,6 +100,7 @@ private:
const std::string &language);
cmTarget *Target;
+ cmGeneratorTarget* GeneratorTarget;
cmLocalGhsMultiGenerator *LocalGenerator;
cmMakefile *Makefile;
std::string AbsBuildFilePath;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a462113..14eaeac 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1456,15 +1456,16 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
+void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
{
cmGeneratorTargetsType generatorTargets;
+ cmMakefile* mf = lg->GetMakefile();
cmTargets& targets = mf->GetTargets();
for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmTarget* t = &ti->second;
- cmGeneratorTarget* gt = new cmGeneratorTarget(t);
+ cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
this->ComputeTargetObjectDirectory(gt);
this->GeneratorTargets[t] = gt;
generatorTargets[t] = gt;
@@ -1474,7 +1475,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
j = mf->GetOwnedImportedTargets().begin();
j != mf->GetOwnedImportedTargets().end(); ++j)
{
- cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
+ cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
this->GeneratorTargets[*j] = gt;
generatorTargets[*j] = gt;
}
@@ -1487,7 +1488,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
- this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
+ this->CreateGeneratorTargets(this->LocalGenerators[i]);
}
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index f02df90..d606cc9 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -483,7 +483,7 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
friend class cmake;
- void CreateGeneratorTargets(cmMakefile* mf);
+ void CreateGeneratorTargets(cmLocalGenerator* lg);
void CreateGeneratorTargets();
void ClearGeneratorMembers();
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 870b9b9..8e498dd 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -37,7 +37,7 @@ void cmLocalGhsMultiGenerator::Generate()
{
continue;
}
- cmGhsMultiTargetGenerator tg(l->second->Target);
+ cmGhsMultiTargetGenerator tg(l->second);
tg.Generate();
}
}
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 37b297e..416063f 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -22,7 +22,7 @@
//----------------------------------------------------------------------------
cmMakefileExecutableTargetGenerator
::cmMakefileExecutableTargetGenerator(cmGeneratorTarget* target):
- cmMakefileTargetGenerator(target->Target)
+ cmMakefileTargetGenerator(target)
{
this->CustomCommandDriver = OnDepends;
this->Target->GetExecutableNames(
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 450f573..660027c 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -22,7 +22,7 @@
//----------------------------------------------------------------------------
cmMakefileLibraryTargetGenerator
::cmMakefileLibraryTargetGenerator(cmGeneratorTarget* target):
- cmMakefileTargetGenerator(target->Target)
+ cmMakefileTargetGenerator(target)
{
this->CustomCommandDriver = OnDepends;
if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 402dfc6..09fad5c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -32,7 +32,7 @@
#include <ctype.h>
-cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
+cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
: OSXBundleGenerator(0)
, MacOSXContentGenerator(0)
{
@@ -41,16 +41,15 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmTarget* target)
this->FlagFileStream = 0;
this->CustomCommandDriver = OnBuild;
this->FortranModuleDirectoryComputed = false;
- this->Target = target;
+ this->Target = target->Target;
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator =
- static_cast<cmLocalUnixMakefileGenerator3*>(
- this->Makefile->GetLocalGenerator());
+ static_cast<cmLocalUnixMakefileGenerator3*>(target->GetLocalGenerator());
this->ConfigName = this->LocalGenerator->ConfigurationName.c_str();
this->GlobalGenerator =
static_cast<cmGlobalUnixMakefileGenerator3*>(
this->LocalGenerator->GetGlobalGenerator());
- this->GeneratorTarget = this->GlobalGenerator->GetGeneratorTarget(target);
+ this->GeneratorTarget = target;
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
this->NoRuleMessages = false;
if(const char* ruleStatus = cm->GetState()
@@ -1174,8 +1173,10 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
&& linkee->GetType() != cmTarget::INTERFACE_LIBRARY
&& emitted.insert(linkee).second)
{
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(linkee);
+ cmLocalGenerator* lg = gt->GetLocalGenerator();
cmMakefile* mf = linkee->GetMakefile();
- cmLocalGenerator* lg = mf->GetLocalGenerator();
std::string di = mf->GetCurrentBinaryDirectory();
di += "/";
di += lg->GetTargetDirectory(*linkee);
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 2e1b052..9182236 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -34,7 +34,7 @@ class cmMakefileTargetGenerator
{
public:
// constructor to set the ivars
- cmMakefileTargetGenerator(cmTarget* target);
+ cmMakefileTargetGenerator(cmGeneratorTarget* target);
virtual ~cmMakefileTargetGenerator();
// construct using this factory call
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 25d929c..303ca63 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
//----------------------------------------------------------------------------
cmMakefileUtilityTargetGenerator
::cmMakefileUtilityTargetGenerator(cmGeneratorTarget* target):
- cmMakefileTargetGenerator(target->Target)
+ cmMakefileTargetGenerator(target)
{
this->CustomCommandDriver = OnUtility;
this->OSXBundleGenerator = new cmOSXBundleGenerator(target,
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index bbf03ff..2fe53bf 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -32,7 +32,7 @@
cmNinjaNormalTargetGenerator::
cmNinjaNormalTargetGenerator(cmGeneratorTarget* target)
- : cmNinjaTargetGenerator(target->Target)
+ : cmNinjaTargetGenerator(target)
, TargetNameOut()
, TargetNameSO()
, TargetNameReal()
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6e35cd4..b18f368 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -57,19 +57,18 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
}
}
-cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmTarget* target)
+cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
:
MacOSXContentGenerator(0),
OSXBundleGenerator(0),
MacContentFolders(),
- Target(target),
- Makefile(target->GetMakefile()),
+ Target(target->Target),
+ Makefile(target->Makefile),
LocalGenerator(
- static_cast<cmLocalNinjaGenerator*>(Makefile->GetLocalGenerator())),
+ static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator())),
Objects()
{
- this->GeneratorTarget =
- this->GetGlobalGenerator()->GetGeneratorTarget(target);
+ this->GeneratorTarget = target;
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 4e7d8b3..fc361b2 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -33,7 +33,7 @@ public:
static cmNinjaTargetGenerator* New(cmGeneratorTarget* target);
/// Build a NinjaTargetGenerator.
- cmNinjaTargetGenerator(cmTarget* target);
+ cmNinjaTargetGenerator(cmGeneratorTarget* target);
/// Destructor.
virtual ~cmNinjaTargetGenerator();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 42d6b46..c3bf011 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -21,7 +21,7 @@
cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
cmGeneratorTarget *target)
- : cmNinjaTargetGenerator(target->Target) {}
+ : cmNinjaTargetGenerator(target) {}
cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() {}
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index a8eef82..3bc0eb7 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -22,7 +22,7 @@ cmOSXBundleGenerator(cmGeneratorTarget* target,
const std::string& configName)
: GT(target)
, Makefile(target->Target->GetMakefile())
- , LocalGenerator(Makefile->GetLocalGenerator())
+ , LocalGenerator(target->GetLocalGenerator())
, ConfigName(configName)
, MacContentFolders(0)
{
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index f05b382..32b9566 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -504,10 +504,10 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
std::string &defs)
{
cmMakefile* makefile = target->GetMakefile();
- cmLocalGenerator* localGen = makefile->GetLocalGenerator();
+ cmGlobalGenerator* globalGen = makefile->GetGlobalGenerator();
std::vector<std::string> includeDirs;
- cmGeneratorTarget *gtgt = localGen->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
+ cmGeneratorTarget *gtgt = globalGen->GetGeneratorTarget(target);
+ cmLocalGenerator *localGen = gtgt->GetLocalGenerator();
// Get the include dirs for this target, without stripping the implicit
// include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9b78df3..12a1e42 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -176,7 +176,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->Makefile->GetConfigurations(this->Configurations);
this->LocalGenerator =
(cmLocalVisualStudio7Generator*)
- this->Makefile->GetLocalGenerator();
+ this->GeneratorTarget->GetLocalGenerator();
this->Name = this->Target->GetName();
this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str());
this->Platform = gg->GetPlatformName();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e51b260..0570399 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -483,7 +483,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::string linkPath;
std::string flags;
std::string linkFlags;
- gg->CreateGeneratorTargets(mf);
+ gg->CreateGeneratorTargets(lg.get());
cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
gtgt, false);