[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-1029-g96b3231
Stephen Kelly
steveire at gmail.com
Mon Oct 26 17:46:17 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 96b3231f81778c7d7a7bcfdbc299dd0fbd47de3b (commit)
via d111fa6817c5974a9fb4bc3b0d604493fee12a19 (commit)
via 3ba6490b94f1268e6a9901bf5a78dec9459ec64e (commit)
via 3f2388be33118a6f17e7907347eba2b37b13d996 (commit)
from 3f2e77edfc78b4a1780a1f9b0cc8ece0f4f030c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96b3231f81778c7d7a7bcfdbc299dd0fbd47de3b
commit 96b3231f81778c7d7a7bcfdbc299dd0fbd47de3b
Merge: 3f2e77e d111fa6
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 17:46:16 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 26 17:46:16 2015 -0400
Merge topic 'use-generator-target' into next
d111fa68 cmLocalGenerator: Port Find method away from GetGeneratorTarget
3ba6490b cmMakefile: Add imported target accessor
3f2388be CMP0026: Port away from GetGeneratorTarget
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d111fa6817c5974a9fb4bc3b0d604493fee12a19
commit d111fa6817c5974a9fb4bc3b0d604493fee12a19
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:14:44 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 22:46:05 2015 +0100
cmLocalGenerator: Port Find method away from GetGeneratorTarget
Mirror the cmMakefile::FindTarget method.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5928fb5..d53f0e3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1583,10 +1583,12 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
- cmLocalGenerator *lg)
+void cmGlobalGenerator::CreateGeneratorTargets(
+ TargetTypes targetTypes,
+ cmMakefile *mf,
+ cmLocalGenerator *lg,
+ std::map<cmTarget*, cmGeneratorTarget*> const& importedMap)
{
- cmMakefile* mf = lg->GetMakefile();
if (targetTypes == AllTargets)
{
cmTargets& targets = mf->GetTargets();
@@ -1600,23 +1602,38 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
}
}
+ std::vector<cmTarget*> itgts = mf->GetImportedTargets();
+
for(std::vector<cmTarget*>::const_iterator
- j = mf->GetOwnedImportedTargets().begin();
- j != mf->GetOwnedImportedTargets().end(); ++j)
+ j = itgts.begin(); j != itgts.end(); ++j)
{
- cmGeneratorTarget* gt = new cmGeneratorTarget(*j, lg);
- this->GeneratorTargets[*j] = gt;
- lg->AddImportedGeneratorTarget(gt);
+ lg->AddImportedGeneratorTarget(importedMap.find(*j)->second);
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
{
+ std::map<cmTarget*, cmGeneratorTarget*> importedMap;
+ for(unsigned int i=0; i < this->Makefiles.size(); ++i)
+ {
+ cmMakefile* mf = this->Makefiles[i];
+ for(std::vector<cmTarget*>::const_iterator
+ j = mf->GetOwnedImportedTargets().begin();
+ j != mf->GetOwnedImportedTargets().end(); ++j)
+ {
+ cmGeneratorTarget* gt =
+ new cmGeneratorTarget(*j, this->LocalGenerators[i]);
+ this->GeneratorTargets[*j] = gt;
+ importedMap[*j] = gt;
+ }
+ }
+
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
- this->CreateGeneratorTargets(targetTypes, this->LocalGenerators[i]);
+ this->CreateGeneratorTargets(targetTypes, this->Makefiles[i],
+ this->LocalGenerators[i], importedMap);
}
}
@@ -2240,11 +2257,11 @@ cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
std::vector<cmGeneratorTarget*> tgts =
- this->LocalGenerators[i]->GetGeneratorTargets();
+ this->LocalGenerators[i]->GetImportedGeneratorTargets();
for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
it != tgts.end(); ++it)
{
- if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
+ if ((*it)->IsImportedGloballyVisible() && (*it)->GetName() == name)
{
return *it;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c52b209..0057d61 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -485,7 +485,9 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
friend class cmake;
- void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
+ void CreateGeneratorTargets(TargetTypes targetTypes, cmMakefile* mf,
+ cmLocalGenerator* lg,
+ std::map<cmTarget*, cmGeneratorTarget*> const& importedMap);
void CreateGeneratorTargets(TargetTypes targetTypes);
void ClearGeneratorMembers();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1bc7f81..ec7c29f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1821,11 +1821,21 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
cmGeneratorTarget*
cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const
{
- if (cmTarget *t = this->Makefile->FindTargetToUse(name))
+ std::vector<cmGeneratorTarget*>::const_iterator
+ imported = std::find_if(this->ImportedGeneratorTargets.begin(),
+ this->ImportedGeneratorTargets.end(),
+ NamedGeneratorTargetFinder(name));
+ if(imported != this->ImportedGeneratorTargets.end())
{
- return this->GetGlobalGenerator()->GetGeneratorTarget(t);
+ return *imported;
}
- return 0;
+
+ if(cmGeneratorTarget* t = this->FindGeneratorTarget(name))
+ {
+ return t;
+ }
+
+ return this->GetGlobalGenerator()->FindGeneratorTarget(name);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 7841d05..67383d7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -120,6 +120,11 @@ public:
return this->GeneratorTargets;
}
+ const std::vector<cmGeneratorTarget*> &GetImportedGeneratorTargets() const
+ {
+ return this->ImportedGeneratorTargets;
+ }
+
void AddGeneratorTarget(cmGeneratorTarget* gt);
void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ba6490b94f1268e6a9901bf5a78dec9459ec64e
commit 3ba6490b94f1268e6a9901bf5a78dec9459ec64e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 26 22:18:20 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 22:46:05 2015 +0100
cmMakefile: Add imported target accessor
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 10b9737..fc23760 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1766,6 +1766,18 @@ const char* cmMakefile::GetCurrentBinaryDirectory() const
return this->StateSnapshot.GetDirectory().GetCurrentBinary();
}
+std::vector<cmTarget*> cmMakefile::GetImportedTargets() const
+{
+ std::vector<cmTarget*> tgts;
+ tgts.reserve(this->ImportedTargets.size());
+ for (TargetMap::const_iterator it = this->ImportedTargets.begin();
+ it != this->ImportedTargets.end(); ++it)
+ {
+ tgts.push_back(it->second);
+ }
+ return tgts;
+}
+
//----------------------------------------------------------------------------
void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
bool before)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 01c4524..f1dd374 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -390,6 +390,7 @@ public:
{
return this->ImportedTargetsOwned;
}
+ std::vector<cmTarget*> GetImportedTargets() const;
cmTarget* FindTarget(const std::string& name,
bool excludeAliases = false) const;
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f2388be33118a6f17e7907347eba2b37b13d996
commit 3f2388be33118a6f17e7907347eba2b37b13d996
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Oct 25 13:19:54 2015 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 26 22:46:05 2015 +0100
CMP0026: Port away from GetGeneratorTarget
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f0f404c..1eebd12 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1602,7 +1602,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// CMake time.
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
gg->CreateGenerationObjects();
- cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+ cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
this->Properties.SetProperty(propLOCATION,
gt->GetLocationForBuild());
}
@@ -1627,7 +1627,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
{
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
gg->CreateGenerationObjects();
- cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+ cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
this->Properties.SetProperty(
prop, gt->GetFullPath(configName, false).c_str());
}
@@ -1651,7 +1651,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
{
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
gg->CreateGenerationObjects();
- cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
+ cmGeneratorTarget* gt = gg->FindGeneratorTarget(this->GetName());
this->Properties.SetProperty(
prop, gt->GetFullPath(configName, false).c_str());
}
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list