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 88b9b0a6f138fa933cd9d286c02fe5a7e255080a (commit) via 636bcd6428f4c05ff7c0c7d41668e306e2d1789e (commit) via 8766741e7fefceb2302243e8fcc16def63756c64 (commit) via 4283faa2f135cafba8481a0ba617b81ee126dd9b (commit) via 55e1200a87f9775d159906d52955c2055e30560a (commit) via c0389992b2be8bd4e458a86e066c28380d26ea96 (commit) via 0fef3c54a68b279bd8f7bc4135886ceb01ea10c7 (commit) via dd2a1c8d230d2e142aa4ff81f4e1c34c938dd4fe (commit) via 96e918c6b10483cae8a67b7afd44bcabca39ced4 (commit) via 065e54e569f7bb47665ec69564e3fccf3dfa0db9 (commit) via 8778d695e411d65611e38a4cb6e258dba14c93bd (commit) via b09b42f168772d781d6e80568ed8c986343cf915 (commit) via 7b9ac9cc4805d2be79364ce2a18baf66e7415110 (commit) via 650938a289cc5da9304aeaaab6ee3fb85710a204 (commit) from 22bded47beb0417d004d152ab35e2b57b9e3c338 (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=88b9b0a6f138fa933cd9d286c02fe5a7e255080a commit 88b9b0a6f138fa933cd9d286c02fe5a7e255080a Merge: 22bded4 636bcd6 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 12:31:56 2015 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Oct 23 12:31:56 2015 -0400 Merge topic 'use-generator-target' into next 636bcd64 VS: Port interface to cmGeneratorTarget 8766741e VS: Port WriteUtilityDepends to cmGeneratorTarget 4283faa2 VS: Port utility depends to cmGeneratorTarget 55e1200a VS: Port target depends to cmGeneratorTarget c0389992 VS: Port PorjectDepends to cmGeneratorTarget. 0fef3c54 VS: Port TargetIsFortranOnly to cmGeneratorTarget dd2a1c8d VS: Port WriteProject to cmGeneratorTarget 96e918c6 VS: Port loop to cmGeneratorTarget 065e54e5 VS: Port ImplibDir to cmGeneratorTarget 8778d695 VS: Port LinkClosure to cmGeneratorTarget b09b42f1 VS: Port ComputeLongestObjectDirectory to cmGeneratorTarget 7b9ac9cc VS7: Port to cmGeneratorTarget 650938a2 VS10: Port to cmGeneratorTarget. https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=636bcd6428f4c05ff7c0c7d41668e306e2d1789e commit 636bcd6428f4c05ff7c0c7d41668e306e2d1789e Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:48 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:30:52 2015 +0200 VS: Port interface to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index bc91e87..6a0e5e9 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -94,7 +94,8 @@ public: /** Return true if the target project file should have the option LinkLibraryDependencies and link to .sln dependencies. */ - virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; } + virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget*) + { return false; } const char* GetIntelProjectVersion(); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 9b8b9fd..e185c8e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -460,14 +460,15 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends( //---------------------------------------------------------------------------- bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies( - cmTarget& target) + cmGeneratorTarget *target) { // Look for utility dependencies that magically link. for(std::set<std::string>::const_iterator ui = - target.GetUtilities().begin(); - ui != target.GetUtilities().end(); ++ui) + target->Target->GetUtilities().begin(); + ui != target->Target->GetUtilities().end(); ++ui) { - if(cmTarget* depTarget = this->FindTarget(ui->c_str())) + if(cmGeneratorTarget* depTarget = + this->FindGeneratorTarget(ui->c_str())) { if(depTarget->GetType() != cmState::INTERFACE_LIBRARY && depTarget->GetProperty("EXTERNAL_MSPROJECT")) diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index c05e5fa..b3093cc 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -60,7 +60,7 @@ public: /** Return true if the target project file should have the option LinkLibraryDependencies and link to .sln dependencies. */ - virtual bool NeedLinkLibraryDependencies(cmTarget& target); + virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget* target); /** Return true if building for Windows CE */ virtual bool TargetsWindowsCE() const { diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 0ba0ccb..7ee5dd0 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -338,7 +338,8 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) //---------------------------------------------------------------------------- void cmGlobalVisualStudioGenerator::FollowLinkDepends( - cmTarget const* target, std::set<cmTarget const*>& linked) + const cmGeneratorTarget *target, + std::set<const cmGeneratorTarget *> &linked) { if(target->GetType() == cmState::INTERFACE_LIBRARY) { @@ -349,14 +350,13 @@ void cmGlobalVisualStudioGenerator::FollowLinkDepends( { // Static library targets do not list their link dependencies so // we must follow them transitively now. - cmGeneratorTarget* gt = this->GetGeneratorTarget(target); - TargetDependSet const& depends = this->GetTargetDirectDepends(gt); + TargetDependSet const& depends = this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { if(di->IsLink()) { - this->FollowLinkDepends((*di)->Target, linked); + this->FollowLinkDepends(*di, linked); } } } @@ -431,7 +431,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( // Collect implicit link dependencies (target_link_libraries). // Static libraries cannot depend on their link implementation // due to behavior (2), but they do not really need to. - std::set<cmTarget const*> linkDepends; + std::set<cmGeneratorTarget const*> linkDepends; if(target->GetType() != cmState::STATIC_LIBRARY) { for(TargetDependSet::const_iterator di = depends.begin(); @@ -440,20 +440,20 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( cmTargetDepend dep = *di; if(dep.IsLink()) { - this->FollowLinkDepends(dep->Target, linkDepends); + this->FollowLinkDepends(*di, linkDepends); } } } // Collect explicit util dependencies (add_dependencies). - std::set<cmTarget const*> utilDepends; + std::set<cmGeneratorTarget const*> utilDepends; for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { cmTargetDepend dep = *di; if(dep.IsUtil()) { - this->FollowLinkDepends(dep->Target, utilDepends); + this->FollowLinkDepends(*di, utilDepends); } } @@ -466,23 +466,22 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( } // Emit link dependencies. - for(std::set<cmTarget const*>::iterator di = linkDepends.begin(); + for(std::set<cmGeneratorTarget const*>::iterator di = linkDepends.begin(); di != linkDepends.end(); ++di) { - cmTarget const* dep = *di; + cmGeneratorTarget const* dep = *di; vsTargetDepend.insert(dep->GetName()); } // Emit util dependencies. Possibly use intermediate targets. - for(std::set<cmTarget const*>::iterator di = utilDepends.begin(); + for(std::set<cmGeneratorTarget const*>::iterator di = utilDepends.begin(); di != utilDepends.end(); ++di) { - cmTarget const* dep = *di; - cmGeneratorTarget* dgt = this->GetGeneratorTarget(dep); - if(allowLinkable || !VSLinkable(dgt) || linked.count(dep)) + cmGeneratorTarget const* dgt = *di; + if(allowLinkable || !VSLinkable(dgt) || linked.count(dgt)) { // Direct dependency allowed. - vsTargetDepend.insert(dep->GetName()); + vsTargetDepend.insert(dgt->GetName()); } else { @@ -892,9 +891,7 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet for (TargetSet::const_iterator it = targets.begin(); it != targets.end(); ++it) { - cmGeneratorTarget* gt = - (*it)->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(*it); - this->insert(gt); + this->insert(*it); } } diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index c81ddda..f827f26 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -88,7 +88,7 @@ public: /** Return true if building for Windows CE */ virtual bool TargetsWindowsCE() const { return false; } - class TargetSet: public std::set<cmTarget const*> {}; + class TargetSet: public std::set<cmGeneratorTarget const*> {}; class TargetCompare { std::string First; @@ -126,8 +126,9 @@ protected: VSDependMap VSTargetDepends; void ComputeVSTargetDepends(cmGeneratorTarget *); - bool CheckTargetLinks(cmTarget& target, const std::string& name); - std::string GetUtilityForTarget(cmTarget& target, const std::string&); + bool CheckTargetLinks(cmGeneratorTarget& target, const std::string& name); + std::string GetUtilityForTarget(cmGeneratorTarget& target, + const std::string&); virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0; std::string GetUtilityDepend(const cmGeneratorTarget *target); typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap; @@ -141,13 +142,14 @@ private: void PrintCompilerAdvice(std::ostream&, std::string const&, const char*) const {} - void FollowLinkDepends(cmTarget const* target, - std::set<cmTarget const*>& linked); + void FollowLinkDepends(cmGeneratorTarget const* target, + std::set<cmGeneratorTarget const*>& linked); - class TargetSetMap: public std::map<cmTarget*, TargetSet> {}; + class TargetSetMap: public std::map<cmGeneratorTarget*, TargetSet> {}; TargetSetMap TargetLinkClosure; - void FillLinkClosure(cmGeneratorTarget const* target, TargetSet& linked); - TargetSet const& GetTargetLinkClosure(cmGeneratorTarget *target); + void FillLinkClosure(const cmGeneratorTarget *target, + TargetSet& linked); + TargetSet const& GetTargetLinkClosure(cmGeneratorTarget* target); }; class cmGlobalVisualStudioGenerator::OrderedTargetDependSet: diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 5ba59ee..ca8d697 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1186,7 +1186,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - if(!gg->NeedLinkLibraryDependencies(*target->Target)) + if(!gg->NeedLinkLibraryDependencies(target)) { fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n"; } @@ -1285,7 +1285,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - if(!gg->NeedLinkLibraryDependencies(*target->Target)) + if(!gg->NeedLinkLibraryDependencies(target)) { fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n"; } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2bb67fd..9c9f5ab 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2677,7 +2677,7 @@ cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) this->WriteString("</Link>\n", 2); if(!this->GlobalGenerator->NeedLinkLibraryDependencies( - *this->GeneratorTarget->Target)) + this->GeneratorTarget)) { this->WriteString("<ProjectReference>\n", 2); this->WriteString( https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8766741e7fefceb2302243e8fcc16def63756c64 commit 8766741e7fefceb2302243e8fcc16def63756c64 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:47 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:30:31 2015 +0200 VS: Port WriteUtilityDepends to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index dd4e871..bb494f1 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -383,12 +383,14 @@ void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout) //---------------------------------------------------------------------------- std::string -cmGlobalVisualStudio6Generator::WriteUtilityDepend(const cmTarget *target) +cmGlobalVisualStudio6Generator::WriteUtilityDepend( + const cmGeneratorTarget *target) { std::string pname = target->GetName(); pname += "_UTILITY"; pname = GetVS6TargetName(pname.c_str()); - std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory(); + std::string fname = + target->GetLocalGenerator()->GetCurrentBinaryDirectory(); fname += "/"; fname += pname; fname += ".dsp"; diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index edf637f..993a48f 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -97,7 +97,7 @@ private: const std::string& name, const char* path, const std::set<std::string>& dependencies); void WriteDSWFooter(std::ostream& fout); - virtual std::string WriteUtilityDepend(cmTarget const* target); + virtual std::string WriteUtilityDepend(const cmGeneratorTarget *target); std::string MSDevCommand; bool MSDevCommandInitialized; std::string const& GetMSDevCommand(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 37f509a..5473247 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -888,13 +888,14 @@ void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout) //---------------------------------------------------------------------------- std::string -cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target) +cmGlobalVisualStudio7Generator::WriteUtilityDepend( + cmGeneratorTarget const* target) { std::vector<std::string> configs; - target->GetMakefile()->GetConfigurations(configs); + target->Target->GetMakefile()->GetConfigurations(configs); std::string pname = target->GetName(); pname += "_UTILITY"; - std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory(); + std::string fname = target->GetLocalGenerator()->GetCurrentBinaryDirectory(); fname += "/"; fname += pname; fname += ".vcproj"; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index eed6f49..bc91e87 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -136,7 +136,7 @@ protected: cmLocalGenerator* root); virtual void WriteSLNFooter(std::ostream& fout); virtual void WriteSLNHeader(std::ostream& fout); - virtual std::string WriteUtilityDepend(cmTarget const* target); + virtual std::string WriteUtilityDepend(const cmGeneratorTarget *target); virtual void WriteTargetsToSolution( std::ostream& fout, diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 3e25559..0ba0ccb 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -514,7 +514,7 @@ cmGlobalVisualStudioGenerator::GetUtilityDepend( UtilityDependsMap::iterator i = this->UtilityDepends.find(target); if(i == this->UtilityDepends.end()) { - std::string name = this->WriteUtilityDepend(target->Target); + std::string name = this->WriteUtilityDepend(target); UtilityDependsMap::value_type entry(target, name); i = this->UtilityDepends.insert(entry).first; } diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 6d804d8..c81ddda 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -128,7 +128,7 @@ protected: bool CheckTargetLinks(cmTarget& target, const std::string& name); std::string GetUtilityForTarget(cmTarget& target, const std::string&); - virtual std::string WriteUtilityDepend(cmTarget const*) = 0; + virtual std::string WriteUtilityDepend(cmGeneratorTarget const*) = 0; std::string GetUtilityDepend(const cmGeneratorTarget *target); typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap; UtilityDependsMap UtilityDepends; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4283faa2f135cafba8481a0ba617b81ee126dd9b commit 4283faa2f135cafba8481a0ba617b81ee126dd9b Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:46 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:30:13 2015 +0200 VS: Port utility depends to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 7d0c558..dd4e871 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -310,7 +310,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, } fout << "}}}\n\n"; - UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 3152e91..8227b82 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -180,7 +180,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, fout <<"EndProject\n"; - UtilityDependsMap::iterator ui = this->UtilityDepends.find(t->Target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(t); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b2ad365..37f509a 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -704,7 +704,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, << dspname << ext << "\", \"{" << this->GetGUID(dspname) << "}\"\nEndProject\n"; - UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); @@ -748,7 +748,7 @@ cmGlobalVisualStudio7Generator depcount++; } - UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index eb6a4ef..3e25559 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -488,7 +488,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( { // Direct dependency on linkable target not allowed. // Use an intermediate utility target. - vsTargetDepend.insert(this->GetUtilityDepend(dep)); + vsTargetDepend.insert(this->GetUtilityDepend(dgt)); } } } @@ -508,12 +508,13 @@ void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf) //---------------------------------------------------------------------------- std::string -cmGlobalVisualStudioGenerator::GetUtilityDepend(cmTarget const* target) +cmGlobalVisualStudioGenerator::GetUtilityDepend( + cmGeneratorTarget const* target) { UtilityDependsMap::iterator i = this->UtilityDepends.find(target); if(i == this->UtilityDepends.end()) { - std::string name = this->WriteUtilityDepend(target); + std::string name = this->WriteUtilityDepend(target->Target); UtilityDependsMap::value_type entry(target, name); i = this->UtilityDepends.insert(entry).first; } diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 0b0b7b1..6d804d8 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -129,8 +129,8 @@ protected: bool CheckTargetLinks(cmTarget& target, const std::string& name); std::string GetUtilityForTarget(cmTarget& target, const std::string&); virtual std::string WriteUtilityDepend(cmTarget const*) = 0; - std::string GetUtilityDepend(cmTarget const* target); - typedef std::map<cmTarget const*, std::string> UtilityDependsMap; + std::string GetUtilityDepend(const cmGeneratorTarget *target); + typedef std::map<cmGeneratorTarget const*, std::string> UtilityDependsMap; UtilityDependsMap UtilityDepends; protected: https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55e1200a87f9775d159906d52955c2055e30560a commit 55e1200a87f9775d159906d52955c2055e30560a Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:45 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:29:57 2015 +0200 VS: Port target depends to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 9e411c9..7d0c558 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -299,7 +299,7 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; fout << "{{{\n"; - VSDependSet const& depends = this->VSTargetDepends[target->Target]; + VSDependSet const& depends = this->VSTargetDepends[target]; for(VSDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 77c8fc8..3152e91 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -206,7 +206,7 @@ cmGlobalVisualStudio71Generator const std::string&, const char*, cmGeneratorTarget const* target) { - VSDependSet const& depends = this->VSTargetDepends[target->Target]; + VSDependSet const& depends = this->VSTargetDepends[target]; for(VSDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 972188f..b2ad365 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -730,7 +730,7 @@ cmGlobalVisualStudio7Generator { int depcount = 0; std::string dspguid = this->GetGUID(dspname); - VSDependSet const& depends = this->VSTargetDepends[target->Target]; + VSDependSet const& depends = this->VSTargetDepends[target]; for(VSDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 39a7bda..eb6a4ef 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -380,7 +380,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends() for(std::vector<cmGeneratorTarget*>::iterator ti = targets.begin(); ti != targets.end(); ++ti) { - this->ComputeVSTargetDepends(*(*ti)->Target); + this->ComputeVSTargetDepends(*ti); } } } @@ -394,13 +394,14 @@ static bool VSLinkable(cmGeneratorTarget const* t) } //---------------------------------------------------------------------------- -void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) +void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( + cmGeneratorTarget* target) { - if(this->VSTargetDepends.find(&target) != this->VSTargetDepends.end()) + if(this->VSTargetDepends.find(target) != this->VSTargetDepends.end()) { return; } - VSDependSet& vsTargetDepend = this->VSTargetDepends[&target]; + VSDependSet& vsTargetDepend = this->VSTargetDepends[target]; // VS <= 7.1 has two behaviors that affect solution dependencies. // // (1) Solution-level dependencies between a linkable target and a @@ -420,19 +421,18 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) // leaving them out for the static library itself but following them // transitively for other targets. - bool allowLinkable = (target.GetType() != cmState::STATIC_LIBRARY && - target.GetType() != cmState::SHARED_LIBRARY && - target.GetType() != cmState::MODULE_LIBRARY && - target.GetType() != cmState::EXECUTABLE); + bool allowLinkable = (target->GetType() != cmState::STATIC_LIBRARY && + target->GetType() != cmState::SHARED_LIBRARY && + target->GetType() != cmState::MODULE_LIBRARY && + target->GetType() != cmState::EXECUTABLE); - cmGeneratorTarget* gt = this->GetGeneratorTarget(&target); - TargetDependSet const& depends = this->GetTargetDirectDepends(gt); + TargetDependSet const& depends = this->GetTargetDirectDepends(target); // Collect implicit link dependencies (target_link_libraries). // Static libraries cannot depend on their link implementation // due to behavior (2), but they do not really need to. std::set<cmTarget const*> linkDepends; - if(target.GetType() != cmState::STATIC_LIBRARY) + if(target->GetType() != cmState::STATIC_LIBRARY) { for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) @@ -460,9 +460,9 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) // Collect all targets linked by this target so we can avoid // intermediate targets below. TargetSet linked; - if(target.GetType() != cmState::STATIC_LIBRARY) + if(target->GetType() != cmState::STATIC_LIBRARY) { - linked = this->GetTargetLinkClosure(gt); + linked = this->GetTargetLinkClosure(target); } // Emit link dependencies. diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index f0bc5dc..0b0b7b1 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -122,9 +122,9 @@ protected: virtual bool ComputeTargetDepends(); class VSDependSet: public std::set<std::string> {}; - class VSDependMap: public std::map<cmTarget const*, VSDependSet> {}; + class VSDependMap: public std::map<cmGeneratorTarget const*, VSDependSet> {}; VSDependMap VSTargetDepends; - void ComputeVSTargetDepends(cmTarget&); + void ComputeVSTargetDepends(cmGeneratorTarget *); bool CheckTargetLinks(cmTarget& target, const std::string& name); std::string GetUtilityForTarget(cmTarget& target, const std::string&); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0389992b2be8bd4e458a86e066c28380d26ea96 commit c0389992b2be8bd4e458a86e066c28380d26ea96 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:44 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:29:42 2015 +0200 VS: Port PorjectDepends to cmGeneratorTarget. diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 195aaa0..77c8fc8 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -175,7 +175,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"") << dspname << ext << "\", \"{" << guid << "}\"\n"; fout << "\tProjectSection(ProjectDependencies) = postProject\n"; - this->WriteProjectDepends(fout, dspname, dir, *t->Target); + this->WriteProjectDepends(fout, dspname, dir, t); fout << "\tEndProjectSection\n"; fout <<"EndProject\n"; @@ -204,9 +204,9 @@ void cmGlobalVisualStudio71Generator ::WriteProjectDepends(std::ostream& fout, const std::string&, - const char*, cmTarget const& target) + const char*, cmGeneratorTarget const* target) { - VSDependSet const& depends = this->VSTargetDepends[&target]; + VSDependSet const& depends = this->VSTargetDepends[target->Target]; for(VSDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { @@ -215,7 +215,7 @@ cmGlobalVisualStudio71Generator if(guid.empty()) { std::string m = "Target: "; - m += target.GetName(); + m += target->GetName(); m += " depends on unknown target: "; m += name; cmSystemTools::Error(m.c_str()); diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 074bce5..5035fda 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -62,7 +62,7 @@ protected: const cmGeneratorTarget *t); virtual void WriteProjectDepends(std::ostream& fout, const std::string& name, const char* path, - cmTarget const& t); + cmGeneratorTarget const* t); virtual void WriteProjectConfigurations( std::ostream& fout, const std::string& name, cmState::TargetType type, std::vector<std::string> const& configs, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 906166c..972188f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -533,19 +533,19 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( for(OrderedTargetDependSet::const_iterator tt = projectTargets.begin(); tt != projectTargets.end(); ++tt) { - cmTarget const* target = (*tt)->Target; + cmGeneratorTarget const* target = *tt; if(target->GetType() == cmState::INTERFACE_LIBRARY) { continue; } - cmMakefile* mf = target->GetMakefile(); const char *vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { - std::string dir = mf->GetCurrentSourceDirectory(); + std::string dir = target->GetLocalGenerator() + ->GetCurrentSourceDirectory(); this->WriteProjectDepends(fout, vcprojName, - dir.c_str(), *target); + dir.c_str(), target); } } } @@ -726,11 +726,11 @@ void cmGlobalVisualStudio7Generator ::WriteProjectDepends(std::ostream& fout, const std::string& dspname, - const char*, cmTarget const& target) + const char*, cmGeneratorTarget const* target) { int depcount = 0; std::string dspguid = this->GetGUID(dspname); - VSDependSet const& depends = this->VSTargetDepends[&target]; + VSDependSet const& depends = this->VSTargetDepends[target->Target]; for(VSDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { @@ -739,7 +739,7 @@ cmGlobalVisualStudio7Generator if(guid.empty()) { std::string m = "Target: "; - m += target.GetName(); + m += target->GetName(); m += " depends on unknown target: "; m += name; cmSystemTools::Error(m.c_str()); @@ -748,7 +748,7 @@ cmGlobalVisualStudio7Generator depcount++; } - UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index a514dcd..eed6f49 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -126,7 +126,7 @@ protected: const cmGeneratorTarget *t); virtual void WriteProjectDepends(std::ostream& fout, const std::string& name, const char* path, - cmTarget const&t); + cmGeneratorTarget const* t); virtual void WriteProjectConfigurations( std::ostream& fout, const std::string& name, cmState::TargetType type, std::vector<std::string> const& configs, diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index a22315c..9b8b9fd 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -441,9 +441,9 @@ bool cmGlobalVisualStudio8Generator::ComputeTargetDepends() //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::WriteProjectDepends( - std::ostream& fout, const std::string&, const char*, cmTarget const& t) + std::ostream& fout, const std::string&, const char*, + cmGeneratorTarget const* gt) { - cmGeneratorTarget* gt = this->GetGeneratorTarget(&t); TargetDependSet const& unordered = this->GetTargetDirectDepends(gt); OrderedTargetDependSet depends(unordered, std::string()); for(OrderedTargetDependSet::const_iterator i = depends.begin(); diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 60c63d1..c05e5fa 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -91,7 +91,8 @@ protected: virtual bool ComputeTargetDepends(); virtual void WriteProjectDepends(std::ostream& fout, const std::string& name, - const char* path, cmTarget const& t); + const char* path, + const cmGeneratorTarget *t); std::string Name; std::string WindowsCEVersion; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fef3c54a68b279bd8f7bc4135886ceb01ea10c7 commit 0fef3c54a68b279bd8f7bc4135886ceb01ea10c7 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:43 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:29:28 2015 +0200 VS: Port TargetIsFortranOnly to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index adf5c67..195aaa0 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -158,7 +158,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, const char* ext = ".vcproj"; const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; - if(this->TargetIsFortranOnly(*t->Target)) + if(this->TargetIsFortranOnly(t)) { ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 8b874b6..906166c 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -692,7 +692,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, const char* ext = ".vcproj"; const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; - if(this->TargetIsFortranOnly(*target->Target)) + if(this->TargetIsFortranOnly(target)) { ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index c43f884..39a7bda 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -831,10 +831,8 @@ void RegisterVisualStudioMacros(const std::string& macrosFile, } } bool -cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget const& target) +cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmGeneratorTarget const* gt) { - cmGeneratorTarget* gt = this->GetGeneratorTarget(&target); - // check to see if this is a fortran build std::set<std::string> languages; { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 5ada37e..f0bc5dc 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -73,7 +73,7 @@ public: const char* vsSolutionFile = 0); // return true if target is fortran only - bool TargetIsFortranOnly(cmTarget const& t); + bool TargetIsFortranOnly(const cmGeneratorTarget *gt); /** Get the top-level registry key for this VS version. */ std::string GetRegistryBase(); diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 0040331..d59fdc6 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -83,7 +83,7 @@ void cmLocalVisualStudio10Generator::Generate() continue; } if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) - ->TargetIsFortranOnly(*(*l)->Target)) + ->TargetIsFortranOnly(*l)) { this->CreateSingleVCProj((*l)->GetName().c_str(), *l); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a2d4d16..5ba59ee 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -229,7 +229,7 @@ void cmLocalVisualStudio7Generator { cmGlobalVisualStudioGenerator* gg = static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator); - this->FortranProject = gg->TargetIsFortranOnly(*target->Target); + this->FortranProject = gg->TargetIsFortranOnly(target); this->WindowsCEProject = gg->TargetsWindowsCE(); // Intel Fortran for VS10 uses VS9 format ".vfproj" files. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 3f8e627..2bb67fd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2886,7 +2886,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() // skip fortran targets as they can not be processed by MSBuild // the only reference will be in the .sln file if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) - ->TargetIsFortranOnly(*dt->Target)) + ->TargetIsFortranOnly(dt)) { continue; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd2a1c8d230d2e142aa4ff81f4e1c34c938dd4fe commit dd2a1c8d230d2e142aa4ff81f4e1c34c938dd4fe Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:42 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:29:06 2015 +0200 VS: Port WriteProject to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 9bb37ce..adf5c67 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -152,18 +152,18 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, const std::string& dspname, const char* dir, - cmTarget const& t) + cmGeneratorTarget const* t) { // check to see if this is a fortran build const char* ext = ".vcproj"; const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; - if(this->TargetIsFortranOnly(t)) + if(this->TargetIsFortranOnly(*t->Target)) { ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; } - const char* targetExt = t.GetProperty("GENERATOR_FILE_NAME_EXT"); + const char* targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT"); if(targetExt) { ext = targetExt; @@ -175,12 +175,12 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, << this->ConvertToSolutionPath(dir) << (dir[0]? "\\":"") << dspname << ext << "\", \"{" << guid << "}\"\n"; fout << "\tProjectSection(ProjectDependencies) = postProject\n"; - this->WriteProjectDepends(fout, dspname, dir, t); + this->WriteProjectDepends(fout, dspname, dir, *t->Target); fout << "\tEndProjectSection\n"; fout <<"EndProject\n"; - UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(t->Target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 7f88e34..074bce5 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -59,7 +59,7 @@ protected: std::ostream& fout, std::vector<std::string> const& configs); virtual void WriteProject(std::ostream& fout, const std::string& name, const char* path, - cmTarget const& t); + const cmGeneratorTarget *t); virtual void WriteProjectDepends(std::ostream& fout, const std::string& name, const char* path, cmTarget const& t); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index bc831e5..8b874b6 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -477,7 +477,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( dir = ""; // msbuild cannot handle ".\" prefix } this->WriteProject(fout, vcprojName, dir.c_str(), - *target->Target); + target); written = true; } } @@ -685,13 +685,14 @@ cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path) // the libraries it uses are also done here void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, const std::string& dspname, - const char* dir, cmTarget const& target) + const char* dir, + cmGeneratorTarget const* target) { // check to see if this is a fortran build const char* ext = ".vcproj"; const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""; - if(this->TargetIsFortranOnly(target)) + if(this->TargetIsFortranOnly(*target->Target)) { ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; @@ -703,7 +704,7 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, << dspname << ext << "\", \"{" << this->GetGUID(dspname) << "}\"\nEndProject\n"; - UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target); + UtilityDependsMap::iterator ui = this->UtilityDepends.find(target->Target); if(ui != this->UtilityDepends.end()) { const char* uname = ui->second.c_str(); diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 4ef0990..a514dcd 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -123,7 +123,7 @@ protected: std::vector<cmLocalGenerator*>& generators); virtual void WriteProject(std::ostream& fout, const std::string& name, const char* path, - cmTarget const& t); + const cmGeneratorTarget *t); virtual void WriteProjectDepends(std::ostream& fout, const std::string& name, const char* path, cmTarget const&t); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96e918c6b10483cae8a67b7afd44bcabca39ced4 commit 96e918c6b10483cae8a67b7afd44bcabca39ced4 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:41 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:28:49 2015 +0200 VS: Port loop to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 1909f21..bc831e5 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -441,7 +441,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( for(OrderedTargetDependSet::const_iterator tt = projectTargets.begin(); tt != projectTargets.end(); ++tt) { - cmTarget const* target = (*tt)->Target; + cmGeneratorTarget const* target = *tt; if(target->GetType() == cmState::INTERFACE_LIBRARY) { continue; @@ -459,7 +459,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( project.c_str(), location.c_str(), target->GetProperty("VS_PROJECT_TYPE"), - target->GetUtilities()); + target->Target->GetUtilities()); written = true; } else @@ -468,9 +468,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( target->GetProperty("GENERATOR_FILE_NAME"); if(vcprojName) { - cmLocalGenerator* lg = - root->GetGlobalGenerator()->GetGeneratorTarget(target) - ->GetLocalGenerator(); + cmLocalGenerator* lg = target->GetLocalGenerator(); std::string dir = lg->GetCurrentBinaryDirectory(); dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT); @@ -479,7 +477,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( dir = ""; // msbuild cannot handle ".\" prefix } this->WriteProject(fout, vcprojName, dir.c_str(), - *target); + *target->Target); written = true; } } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=065e54e569f7bb47665ec69564e3fccf3dfa0db9 commit 065e54e569f7bb47665ec69564e3fccf3dfa0db9 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:40 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:28:33 2015 +0200 VS: Port ImplibDir to cmGeneratorTarget diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index c4cbdef..d5abf68 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -841,7 +841,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target, event.Write(target->Target->GetPreBuildCommands()); event.Write(target->Target->GetPreLinkCommands()); cmsys::auto_ptr<cmCustomCommand> pcc( - this->MaybeCreateImplibDir(*target->Target, configName, false)); + this->MaybeCreateImplibDir(target, configName, false)); if(pcc.get()) { event.Write(*pcc); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 8b1915a..a2d4d16 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2048,7 +2048,7 @@ void cmLocalVisualStudio7Generator event.Write(target->Target->GetPreLinkCommands()); } cmsys::auto_ptr<cmCustomCommand> pcc( - this->MaybeCreateImplibDir(*target->Target, + this->MaybeCreateImplibDir(target, configName, this->FortranProject)); if(pcc.get()) { diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 8516ce7..561f9a1 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -80,7 +80,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( //---------------------------------------------------------------------------- cmsys::auto_ptr<cmCustomCommand> -cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, +cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target, const std::string& config, bool isFortran) { @@ -89,13 +89,11 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, // If an executable exports symbols then VS wants to create an // import library but forgets to create the output directory. // The Intel Fortran plugin always forgets to the directory. - if(target.GetType() != cmState::EXECUTABLE && - !(isFortran && target.GetType() == cmState::SHARED_LIBRARY)) + if(target->GetType() != cmState::EXECUTABLE && + !(isFortran && target->GetType() == cmState::SHARED_LIBRARY)) { return pcc; } - cmGeneratorTarget* gt = - this->GetGlobalGenerator()->GetGeneratorTarget(&target); - std::string outDir = gt->GetDirectory(config, false); - std::string impDir = gt->GetDirectory(config, true); + std::string outDir = target->GetDirectory(config, false); + std::string impDir = target->GetDirectory(config, true); if(impDir == outDir) { return pcc; } // Add a pre-build event to create the directory. diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 6d915e7..f95eefa 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -59,7 +59,8 @@ protected: /** Construct a custom command to make exe import lib dir. */ cmsys::auto_ptr<cmCustomCommand> - MaybeCreateImplibDir(cmTarget& target, const std::string& config, + MaybeCreateImplibDir(cmGeneratorTarget *target, + const std::string& config, bool isFortran); }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8778d695e411d65611e38a4cb6e258dba14c93bd commit 8778d695e411d65611e38a4cb6e258dba14c93bd Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:39 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:28:06 2015 +0200 VS: Port LinkClosure to cmGeneratorTarget diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 4d431f6..c43f884 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -303,19 +303,20 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target, - TargetSet& linked) +void cmGlobalVisualStudioGenerator::FillLinkClosure( + const cmGeneratorTarget *target, + TargetSet& linked) { - if(linked.insert(target).second) + if(linked.insert(target->Target).second) { - cmGeneratorTarget* gt = this->GetGeneratorTarget(target); - TargetDependSet const& depends = this->GetTargetDirectDepends(gt); + TargetDependSet const& depends = + this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { if(di->IsLink()) { - this->FillLinkClosure((*di)->Target, linked); + this->FillLinkClosure(*di, linked); } } } @@ -323,12 +324,12 @@ void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target, //---------------------------------------------------------------------------- cmGlobalVisualStudioGenerator::TargetSet const& -cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target) +cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) { - TargetSetMap::iterator i = this->TargetLinkClosure.find(target); + TargetSetMap::iterator i = this->TargetLinkClosure.find(target->Target); if(i == this->TargetLinkClosure.end()) { - TargetSetMap::value_type entry(target, TargetSet()); + TargetSetMap::value_type entry(target->Target, TargetSet()); i = this->TargetLinkClosure.insert(entry).first; this->FillLinkClosure(target, i->second); } @@ -461,7 +462,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) TargetSet linked; if(target.GetType() != cmState::STATIC_LIBRARY) { - linked = this->GetTargetLinkClosure(&target); + linked = this->GetTargetLinkClosure(gt); } // Emit link dependencies. diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 41d0b88..5ada37e 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -146,8 +146,8 @@ private: class TargetSetMap: public std::map<cmTarget*, TargetSet> {}; TargetSetMap TargetLinkClosure; - void FillLinkClosure(cmTarget const* target, TargetSet& linked); - TargetSet const& GetTargetLinkClosure(cmTarget* target); + void FillLinkClosure(cmGeneratorTarget const* target, TargetSet& linked); + TargetSet const& GetTargetLinkClosure(cmGeneratorTarget *target); }; class cmGlobalVisualStudioGenerator::OrderedTargetDependSet: https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b09b42f168772d781d6e80568ed8c986343cf915 commit b09b42f168772d781d6e80568ed8c986343cf915 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 23 18:26:38 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 23 18:27:38 2015 +0200 VS: Port ComputeLongestObjectDirectory to cmGeneratorTarget diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index a7f0616..c4cbdef 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1935,7 +1935,7 @@ cmLocalVisualStudio6Generator //---------------------------------------------------------------------------- std::string cmLocalVisualStudio6Generator -::ComputeLongestObjectDirectory(cmTarget&) const +::ComputeLongestObjectDirectory(cmGeneratorTarget const*) const { // Compute the maximum length configuration name. std::string config_max; diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index 4772d54..dab32a5 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -50,7 +50,8 @@ public: virtual std::string GetTargetDirectory(cmGeneratorTarget const* target) const; - virtual std::string ComputeLongestObjectDirectory(cmTarget&) const; + virtual std::string + ComputeLongestObjectDirectory(cmGeneratorTarget const*) const; private: std::string DSPHeaderTemplate; std::string DSPFooterTemplate; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a3ca67e..8b1915a 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1689,10 +1689,10 @@ cmLocalVisualStudio7GeneratorFCInfo //---------------------------------------------------------------------------- std::string cmLocalVisualStudio7Generator -::ComputeLongestObjectDirectory(cmTarget& target) const +::ComputeLongestObjectDirectory(cmGeneratorTarget const* target) const { std::vector<std::string> configs; - target.GetMakefile()->GetConfigurations(configs); + target->Target->GetMakefile()->GetConfigurations(configs); // Compute the maximum length configuration name. std::string config_max; @@ -1711,9 +1711,7 @@ cmLocalVisualStudio7Generator std::string dir_max; dir_max += this->GetCurrentBinaryDirectory(); dir_max += "/"; - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); - dir_max += this->GetTargetDirectory(gt); + dir_max += this->GetTargetDirectory(target); dir_max += "/"; dir_max += config_max; dir_max += "/"; diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index deb8d8f..7bb9cc6 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -56,7 +56,8 @@ public: std::string GetTargetDirectory(cmGeneratorTarget const* target) const; cmSourceFile* CreateVCProjBuildRule(); void WriteStampFiles(); - virtual std::string ComputeLongestObjectDirectory(cmTarget&) const; + virtual std::string + ComputeLongestObjectDirectory(cmGeneratorTarget const*) const; virtual void ReadAndStoreExternalGUID(const std::string& name, const char* path); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 2f44fb7..8516ce7 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -43,7 +43,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, cmGeneratorTarget const* gt) { - std::string dir_max = this->ComputeLongestObjectDirectory(*gt->Target); + std::string dir_max = this->ComputeLongestObjectDirectory(gt); // Count the number of object files with each name. Note that // windows file names are not case sensitive. diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 071bfb3..6d915e7 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -44,7 +44,8 @@ public: cmGlobalVisualStudioGenerator::VSVersion GetVersion() const; - virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0; + virtual std::string + ComputeLongestObjectDirectory(cmGeneratorTarget const*) const = 0; virtual void AddCMakeListsRules() = 0; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b9ac9cc4805d2be79364ce2a18baf66e7415110 commit 7b9ac9cc4805d2be79364ce2a18baf66e7415110 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Oct 22 18:27:58 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Oct 22 23:13:44 2015 +0200 VS7: Port to cmGeneratorTarget diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index e9aee8a..0040331 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -85,7 +85,7 @@ void cmLocalVisualStudio10Generator::Generate() if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) ->TargetIsFortranOnly(*(*l)->Target)) { - this->CreateSingleVCProj((*l)->GetName().c_str(), *(*l)->Target); + this->CreateSingleVCProj((*l)->GetName().c_str(), *l); } else { diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 4895698..a3ca67e 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -34,7 +34,8 @@ public: LocalGenerator(e) {} typedef cmComputeLinkInformation::ItemVector ItemVector; void OutputLibraries(std::ostream& fout, ItemVector const& libs); - void OutputObjects(std::ostream& fout, cmTarget* t, const char* isep = 0); + void OutputObjects(std::ostream& fout, cmGeneratorTarget* t, + const char* isep = 0); private: cmLocalVisualStudio7Generator* LocalGenerator; }; @@ -129,8 +130,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() for(std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); l != tgts.end(); l++) { - cmTarget& tgt = *(*l)->Target; - if(tgt.GetType() == cmState::GLOBAL_TARGET) + if((*l)->GetType() == cmState::GLOBAL_TARGET) { std::vector<std::string> no_depends; cmCustomCommandLine force_command; @@ -142,7 +142,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() std::string force = this->GetCurrentBinaryDirectory(); force += cmake::GetCMakeFilesDirectory(); force += "/"; - force += tgt.GetName(); + force += (*l)->GetName(); force += "_force"; if(cmSourceFile* file = this->Makefile->AddCustomCommandToOutput( @@ -187,7 +187,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() // so don't build a projectfile for it if(!(*l)->GetProperty("EXTERNAL_MSPROJECT")) { - this->CreateSingleVCProj((*l)->GetName().c_str(), *(*l)->Target); + this->CreateSingleVCProj((*l)->GetName().c_str(), *l); } } } @@ -225,11 +225,11 @@ void cmLocalVisualStudio7Generator::WriteStampFiles() //---------------------------------------------------------------------------- void cmLocalVisualStudio7Generator -::CreateSingleVCProj(const std::string& lname, cmTarget &target) +::CreateSingleVCProj(const std::string& lname, cmGeneratorTarget *target) { cmGlobalVisualStudioGenerator* gg = static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator); - this->FortranProject = gg->TargetIsFortranOnly(target); + this->FortranProject = gg->TargetIsFortranOnly(*target->Target); this->WindowsCEProject = gg->TargetsWindowsCE(); // Intel Fortran for VS10 uses VS9 format ".vfproj" files. @@ -241,7 +241,7 @@ void cmLocalVisualStudio7Generator } // add to the list of projects - target.SetProperty("GENERATOR_FILE_NAME",lname.c_str()); + target->Target->SetProperty("GENERATOR_FILE_NAME",lname.c_str()); // create the dsp.cmake file std::string fname; fname = this->GetCurrentBinaryDirectory(); @@ -324,8 +324,9 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() } void cmLocalVisualStudio7Generator::WriteConfigurations( - std::ostream& fout, std::vector<std::string> const& configs, - const std::string& libName, cmTarget &target + std::ostream& fout, + std::vector<std::string> const& configs, + const std::string& libName, cmGeneratorTarget *target ) { fout << "\t<Configurations>\n"; @@ -643,7 +644,7 @@ private: void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, const std::string& configName, const std::string& libName, - cmTarget &target) + cmGeneratorTarget *target) { const char* mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG"); if(!mfcFlag) @@ -664,10 +665,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, const char* projectType = 0; bool targetBuilds = true; - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); - - switch(target.GetType()) + switch(target->GetType()) { case cmState::OBJECT_LIBRARY: targetBuilds = false; // no manifest tool for object library @@ -699,12 +697,12 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, { const std::string& linkLanguage = (this->FortranProject? std::string("Fortran"): - gt->GetLinkerLanguage(configName)); + target->GetLinkerLanguage(configName)); if(linkLanguage.empty()) { cmSystemTools::Error ("CMake can not determine linker language for target: ", - target.GetName().c_str()); + target->GetName().c_str()); return; } if(linkLanguage == "C" || linkLanguage == "CXX" @@ -730,12 +728,12 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, } // Add the target-specific flags. - this->AddCompileOptions(flags, gt, linkLanguage, configName); + this->AddCompileOptions(flags, target, linkLanguage, configName); } if(this->FortranProject) { - switch(this->GetFortranFormat(target.GetProperty("Fortran_FORMAT"))) + switch(this->GetFortranFormat(target->GetProperty("Fortran_FORMAT"))) { case FortranFormatFixed: flags += " -fixed"; break; case FortranFormatFree: flags += " -free"; break; @@ -762,7 +760,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.Parse(defineFlags.c_str()); targetOptions.ParseFinish(); std::vector<std::string> targetDefines; - gt->GetCompileDefinitions(targetDefines, configName, "CXX"); + target->GetCompileDefinitions(targetDefines, configName, "CXX"); targetOptions.AddDefines(targetDefines); targetOptions.SetVerboseMakefile( this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")); @@ -774,22 +772,22 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.AddDefine(configDefine); // Add the export symbol definition for shared library objects. - if(const char* exportMacro = gt->GetExportMacro()) + if(const char* exportMacro = target->GetExportMacro()) { targetOptions.AddDefine(exportMacro); } // The intermediate directory name consists of a directory for the // target and a subdirectory for the configuration name. - std::string intermediateDir = this->GetTargetDirectory(gt); + std::string intermediateDir = this->GetTargetDirectory(target); intermediateDir += "/"; intermediateDir += configName; - if (target.GetType() < cmState::UTILITY) + if (target->Target->GetType() < cmState::UTILITY) { std::string const& outDir = - target.GetType() == cmState::OBJECT_LIBRARY? - intermediateDir : gt->GetDirectory(configName); + target->Target->GetType() == cmState::OBJECT_LIBRARY? + intermediateDir : target->GetDirectory(configName); fout << "\t\t\tOutputDirectory=\"" << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n"; } @@ -804,7 +802,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, if (this->FortranProject) { // Intel Fortran >= 15.0 uses TargetName property. - std::string targetNameFull = gt->GetFullName(configName); + std::string targetNameFull = target->GetFullName(configName); std::string targetName = cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull); std::string targetExt = @@ -839,7 +837,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, if(this->FortranProject) { const char* target_mod_dir = - target.GetProperty("Fortran_MODULE_DIRECTORY"); + target->Target->GetProperty("Fortran_MODULE_DIRECTORY"); std::string modDir; if(target_mod_dir) { @@ -858,7 +856,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n"); fout << "\t\t\t\tAdditionalIncludeDirectories=\""; std::vector<std::string> includes; - this->GetIncludeDirectories(includes, gt, "C", configName); + this->GetIncludeDirectories(includes, target, "C", configName); std::vector<std::string>::iterator i = includes.begin(); for(;i != includes.end(); ++i) { @@ -879,10 +877,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, targetOptions.OutputFlagMap(fout, "\t\t\t\t"); targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; - if(target.GetType() <= cmState::OBJECT_LIBRARY) + if(target->Target->GetType() <= cmState::OBJECT_LIBRARY) { // Specify the compiler program database file if configured. - std::string pdb = gt->GetCompilePDBPath(configName); + std::string pdb = target->GetCompilePDBPath(configName); if(!pdb.empty()) { fout << "\t\t\t\tProgramDataBaseFileName=\"" @@ -986,7 +984,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, "\t\t\t\tName=\"" << manifestTool << "\""; std::vector<cmSourceFile const*> manifest_srcs; - gt->GetManifests(manifest_srcs, configName); + target->GetManifests(manifest_srcs, configName); if (!manifest_srcs.empty()) { fout << "\n\t\t\t\tAdditionalManifestFiles=\""; @@ -1001,7 +999,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, // Check if we need the FAT32 workaround. // Check the filesystem type where the target will be written. - if (cmLVS6G_IsFAT(gt->GetDirectory(configName).c_str())) + if (cmLVS6G_IsFAT(target->GetDirectory(configName).c_str())) { // Add a flag telling the manifest tool to use a workaround // for FAT32 file systems, which can cause an empty manifest @@ -1035,28 +1033,28 @@ cmLocalVisualStudio7Generator } void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, - const std::string& configName, cmTarget &target, + const std::string& configName, cmGeneratorTarget* target, const Options& targetOptions) { cmGlobalVisualStudio7Generator* gg = static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); std::string temp; std::string extraLinkOptions; - if(target.GetType() == cmState::EXECUTABLE) + if(target->GetType() == cmState::EXECUTABLE) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName); } - if(target.GetType() == cmState::SHARED_LIBRARY) + if(target->GetType() == cmState::SHARED_LIBRARY) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName); } - if(target.GetType() == cmState::MODULE_LIBRARY) + if(target->GetType() == cmState::MODULE_LIBRARY) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") @@ -1064,7 +1062,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, + GetBuildTypeLinkerFlags("CMAKE_MODULE_LINKER_FLAGS", configName); } - const char* targetLinkFlags = target.GetProperty("LINK_FLAGS"); + const char* targetLinkFlags = target->GetProperty("LINK_FLAGS"); if(targetLinkFlags) { extraLinkOptions += " "; @@ -1073,7 +1071,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string configTypeUpper = cmSystemTools::UpperCase(configName); std::string linkFlagsConfig = "LINK_FLAGS_"; linkFlagsConfig += configTypeUpper; - targetLinkFlags = target.GetProperty(linkFlagsConfig.c_str()); + targetLinkFlags = target->GetProperty(linkFlagsConfig.c_str()); if(targetLinkFlags) { extraLinkOptions += " "; @@ -1093,28 +1091,26 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, this->ConvertToOutputFormat(this->ModuleDefinitionFile, SHELL); linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str()); } - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); - if (target.GetType() == cmState::SHARED_LIBRARY && + if (target->GetType() == cmState::SHARED_LIBRARY && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { - if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) + if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { linkOptions.AddFlag("ModuleDefinitionFile", "$(IntDir)/exportall.def"); } } - switch(target.GetType()) + switch(target->GetType()) { case cmState::UNKNOWN_LIBRARY: break; case cmState::OBJECT_LIBRARY: { - std::string libpath = this->GetTargetDirectory(gt); + std::string libpath = this->GetTargetDirectory(target); libpath += "/"; libpath += configName; libpath += "/"; - libpath += target.GetName(); + libpath += target->GetName(); libpath += ".lib"; const char* tool = this->FortranProject? "VFLibrarianTool":"VCLibrarianTool"; @@ -1126,8 +1122,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, } case cmState::STATIC_LIBRARY: { - std::string targetNameFull = gt->GetFullName(configName); - std::string libpath = gt->GetDirectory(configName); + std::string targetNameFull = target->GetFullName(configName); + std::string libpath = target->GetDirectory(configName); libpath += "/"; libpath += targetNameFull; const char* tool = "VCLibrarianTool"; @@ -1142,14 +1138,14 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, || this->FortranProject) { std::ostringstream libdeps; - this->Internal->OutputObjects(libdeps, &target); + this->Internal->OutputObjects(libdeps, target); if(!libdeps.str().empty()) { fout << "\t\t\t\tAdditionalDependencies=\"" << libdeps.str() << "\"\n"; } } std::string libflags; - this->GetStaticLibraryFlags(libflags, configTypeUpper, gt); + this->GetStaticLibraryFlags(libflags, configTypeUpper, target); if(!libflags.empty()) { fout << "\t\t\t\tAdditionalOptions=\"" << libflags << "\"\n"; @@ -1166,11 +1162,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string targetNameFull; std::string targetNameImport; std::string targetNamePDB; - gt->GetLibraryNames(targetName, targetNameSO, targetNameFull, + target->GetLibraryNames(targetName, targetNameSO, targetNameFull, targetNameImport, targetNamePDB, configName); // Compute the link library and directory information. - cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName); + cmComputeLinkInformation* pcli = target->GetLinkInformation(configName); if(!pcli) { return; @@ -1190,7 +1186,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - if(!gg->NeedLinkLibraryDependencies(target)) + if(!gg->NeedLinkLibraryDependencies(*target->Target)) { fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n"; } @@ -1202,22 +1198,22 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || this->FortranProject) { - this->Internal->OutputObjects(fout, &target, " "); + this->Internal->OutputObjects(fout, target, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; - temp = gt->GetDirectory(configName); + temp = target->GetDirectory(configName); temp += "/"; temp += targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; - this->WriteTargetVersionAttribute(fout, gt); + this->WriteTargetVersionAttribute(fout, target); linkOptions.OutputFlagMap(fout, "\t\t\t\t"); fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; - temp = gt->GetPDBDirectory(configName); + temp = target->GetPDBDirectory(configName); temp += "/"; temp += targetNamePDB; fout << "\t\t\t\tProgramDatabaseFile=\"" << @@ -1245,7 +1241,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n"; } - temp = gt->GetDirectory(configName, true); + temp = target->GetDirectory(configName, true); temp += "/"; temp += targetNameImport; fout << "\t\t\t\tImportLibrary=\"" @@ -1263,11 +1259,11 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string targetNameFull; std::string targetNameImport; std::string targetNamePDB; - gt->GetExecutableNames(targetName, targetNameFull, + target->GetExecutableNames(targetName, targetNameFull, targetNameImport, targetNamePDB, configName); // Compute the link library and directory information. - cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName); + cmComputeLinkInformation* pcli = target->GetLinkInformation(configName); if(!pcli) { return; @@ -1275,7 +1271,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, cmComputeLinkInformation& cli = *pcli; std::string linkLanguage = cli.GetLinkLanguage(); - bool isWin32Executable = target.GetPropertyAsBool("WIN32_EXECUTABLE"); + bool isWin32Executable = target->GetPropertyAsBool("WIN32_EXECUTABLE"); // Compute the variable name to lookup standard libraries for this // language. @@ -1289,7 +1285,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, } fout << "\t\t\t<Tool\n" << "\t\t\t\tName=\"" << tool << "\"\n"; - if(!gg->NeedLinkLibraryDependencies(target)) + if(!gg->NeedLinkLibraryDependencies(*target->Target)) { fout << "\t\t\t\tLinkLibraryDependencies=\"false\"\n"; } @@ -1301,23 +1297,23 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, if(this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || this->FortranProject) { - this->Internal->OutputObjects(fout, &target, " "); + this->Internal->OutputObjects(fout, target, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); fout << "\"\n"; - temp = gt->GetDirectory(configName); + temp = target->GetDirectory(configName); temp += "/"; temp += targetNameFull; fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n"; - this->WriteTargetVersionAttribute(fout, gt); + this->WriteTargetVersionAttribute(fout, target); linkOptions.OutputFlagMap(fout, "\t\t\t\t"); fout << "\t\t\t\tAdditionalLibraryDirectories=\""; this->OutputLibraryDirectories(fout, cli.GetDirectories()); fout << "\"\n"; std::string path = this->ConvertToXMLOutputPathSingle( - gt->GetPDBDirectory(configName).c_str()); + target->GetPDBDirectory(configName).c_str()); fout << "\t\t\t\tProgramDatabaseFile=\"" << path << "/" << targetNamePDB << "\"\n"; @@ -1364,7 +1360,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, { fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\""; } - temp = gt->GetDirectory(configName, true); + temp = target->GetDirectory(configName, true); temp += "/"; temp += targetNameImport; fout << "\t\t\t\tImportLibrary=\"" @@ -1415,13 +1411,11 @@ cmLocalVisualStudio7GeneratorInternals //---------------------------------------------------------------------------- void cmLocalVisualStudio7GeneratorInternals -::OutputObjects(std::ostream& fout, cmTarget* t, const char* isep) +::OutputObjects(std::ostream& fout, cmGeneratorTarget* gt, const char* isep) { // VS < 8 does not support per-config source locations so we // list object library content on the link line instead. cmLocalVisualStudio7Generator* lg = this->LocalGenerator; - cmGeneratorTarget* gt = - lg->GetGlobalGenerator()->GetGeneratorTarget(t); std::vector<std::string> objs; gt->UseObjectLibraries(objs, ""); const char* sep = isep? isep : ""; @@ -1478,7 +1472,7 @@ cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, const std::string& libName, - cmTarget &target) + cmGeneratorTarget* target) { std::vector<std::string> configs; this->Makefile->GetConfigurations(configs); @@ -1486,13 +1480,10 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, // We may be modifying the source groups temporarily, so make a copy. std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups(); - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); - // get the classes from the source lists then add them to the groups this->ModuleDefinitionFile = ""; std::vector<cmSourceFile*> classes; - if (!gt->GetConfigCommonSourceFiles(classes)) + if (!target->GetConfigCommonSourceFiles(classes)) { return; } @@ -1535,7 +1526,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, // VS >= 8 support per-config source locations so we // list object library content as external objects. std::vector<std::string> objs; - gt->UseObjectLibraries(objs, ""); + target->UseObjectLibraries(objs, ""); if(!objs.empty()) { // TODO: Separate sub-filter for each object library used? @@ -1570,7 +1561,7 @@ class cmLocalVisualStudio7GeneratorFCInfo { public: cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg, - cmTarget& target, + cmGeneratorTarget* target, cmSourceFile const& sf, std::vector<std::string> const& configs); std::map<std::string, cmLVS7GFileConfig> FileConfigMap; @@ -1578,12 +1569,10 @@ public: cmLocalVisualStudio7GeneratorFCInfo ::cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg, - cmTarget& target, + cmGeneratorTarget* gt, cmSourceFile const& sf, std::vector<std::string> const& configs) { - cmGeneratorTarget* gt = - lg->GetGlobalGenerator()->GetGeneratorTarget(&target); std::string objectName; if(gt->HasExplicitObjectName(&sf)) { @@ -1732,7 +1721,7 @@ cmLocalVisualStudio7Generator } bool cmLocalVisualStudio7Generator -::WriteGroup(const cmSourceGroup *sg, cmTarget& target, +::WriteGroup(const cmSourceGroup *sg, cmGeneratorTarget* target, std::ostream &fout, const std::string& libName, std::vector<std::string> const& configs) { @@ -1767,15 +1756,14 @@ bool cmLocalVisualStudio7Generator } // Loop through each source in the source group. - std::string objectName; for(std::vector<const cmSourceFile *>::const_iterator sf = sourceFiles.begin(); sf != sourceFiles.end(); ++sf) { std::string source = (*sf)->GetFullPath(); FCInfo fcinfo(this, target, *(*sf), configs); - if (source != libName || target.GetType() == cmState::UTILITY || - target.GetType() == cmState::GLOBAL_TARGET ) + if (source != libName || target->GetType() == cmState::UTILITY || + target->GetType() == cmState::GLOBAL_TARGET ) { fout << "\t\t\t<File\n"; std::string d = this->ConvertToXMLOutputPathSingle(source.c_str()); @@ -2022,10 +2010,10 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout) void cmLocalVisualStudio7Generator ::OutputTargetRules(std::ostream& fout, const std::string& configName, - cmTarget &target, + cmGeneratorTarget *target, const std::string& /*libName*/) { - if (target.GetType() > cmState::GLOBAL_TARGET) + if (target->GetType() > cmState::GLOBAL_TARGET) { return; } @@ -2035,36 +2023,35 @@ void cmLocalVisualStudio7Generator const char* tool = this->FortranProject? "VFPreBuildEventTool":"VCPreBuildEventTool"; event.Start(tool); - event.Write(target.GetPreBuildCommands()); + event.Write(target->Target->GetPreBuildCommands()); event.Finish(); // Add pre-link event. tool = this->FortranProject? "VFPreLinkEventTool":"VCPreLinkEventTool"; event.Start(tool); bool addedPrelink = false; - if (target.GetType() == cmState::SHARED_LIBRARY && + if (target->GetType() == cmState::SHARED_LIBRARY && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { - if (target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) + if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { addedPrelink = true; std::vector<cmCustomCommand> commands = - target.GetPreLinkCommands(); + target->Target->GetPreLinkCommands(); cmGlobalVisualStudioGenerator* gg = static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator); - cmGeneratorTarget* gt = - this->GlobalGenerator->GetGeneratorTarget(&target); gg->AddSymbolExportCommand( - gt, commands, configName); + target, commands, configName); event.Write(commands); } } if (!addedPrelink) { - event.Write(target.GetPreLinkCommands()); + event.Write(target->Target->GetPreLinkCommands()); } cmsys::auto_ptr<cmCustomCommand> pcc( - this->MaybeCreateImplibDir(target, configName, this->FortranProject)); + this->MaybeCreateImplibDir(*target->Target, + configName, this->FortranProject)); if(pcc.get()) { event.Write(*pcc); @@ -2074,18 +2061,18 @@ void cmLocalVisualStudio7Generator // Add post-build event. tool = this->FortranProject? "VFPostBuildEventTool":"VCPostBuildEventTool"; event.Start(tool); - event.Write(target.GetPostBuildCommands()); + event.Write(target->Target->GetPostBuildCommands()); event.Finish(); } void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout, - cmTarget& target) + cmGeneratorTarget* target) { // if we have all the required Source code control tags // then add that to the project - const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME"); - const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH"); - const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER"); + const char* vsProjectname = target->GetProperty("VS_SCC_PROJECTNAME"); + const char* vsLocalpath = target->GetProperty("VS_SCC_LOCALPATH"); + const char* vsProvider = target->GetProperty("VS_SCC_PROVIDER"); if(vsProvider && vsLocalpath && vsProjectname) { @@ -2093,7 +2080,7 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout, << "\tSccLocalPath=\"" << vsLocalpath << "\"\n" << "\tSccProvider=\"" << vsProvider << "\"\n"; - const char* vsAuxPath = target.GetProperty("VS_SCC_AUXPATH"); + const char* vsAuxPath = target->GetProperty("VS_SCC_AUXPATH"); if(vsAuxPath) { fout << "\tSccAuxPath=\"" << vsAuxPath << "\"\n"; @@ -2105,7 +2092,7 @@ void cmLocalVisualStudio7Generator ::WriteProjectStartFortran(std::ostream& fout, const std::string& libName, - cmTarget & target) + cmGeneratorTarget *target) { cmGlobalVisualStudio7Generator* gg = @@ -2115,13 +2102,13 @@ cmLocalVisualStudio7Generator << "<VisualStudioProject\n" << "\tProjectCreator=\"Intel Fortran\"\n" << "\tVersion=\"" << gg->GetIntelProjectVersion() << "\"\n"; - const char* keyword = target.GetProperty("VS_KEYWORD"); + const char* keyword = target->GetProperty("VS_KEYWORD"); if(!keyword) { keyword = "Console Application"; } const char* projectType = 0; - switch(target.GetType()) + switch(target->GetType()) { case cmState::STATIC_LIBRARY: projectType = "typeStaticLibrary"; @@ -2166,7 +2153,7 @@ cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, const std::string& libName, - cmTarget & target, + cmGeneratorTarget *target, std::vector<cmSourceGroup> &) { if(this->FortranProject) @@ -2190,12 +2177,12 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, { fout << "\tVersion=\"" << (gg->GetVersion()/10) << ".00\"\n"; } - const char* projLabel = target.GetProperty("PROJECT_LABEL"); + const char* projLabel = target->GetProperty("PROJECT_LABEL"); if(!projLabel) { projLabel = libName.c_str(); } - const char* keyword = target.GetProperty("VS_KEYWORD"); + const char* keyword = target->GetProperty("VS_KEYWORD"); if(!keyword) { keyword = "Win32Proj"; @@ -2207,7 +2194,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, } this->WriteProjectSCC(fout, target); if(const char* targetFrameworkVersion = - target.GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) + target->GetProperty("VS_DOTNET_TARGET_FRAMEWORK_VERSION")) { fout << "\tTargetFrameworkVersion=\"" << targetFrameworkVersion << "\"\n"; } @@ -2228,12 +2215,13 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, } -void cmLocalVisualStudio7Generator::WriteVCProjFooter(std::ostream& fout, - cmTarget &target) +void cmLocalVisualStudio7Generator::WriteVCProjFooter( + std::ostream& fout, + cmGeneratorTarget *target) { fout << "\t<Globals>\n"; - cmPropertyMap const& props = target.GetProperties(); + cmPropertyMap const& props = target->Target->GetProperties(); for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i) { if(i->first.find("VS_GLOBAL_") == 0) diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 16cf004..deb8d8f 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -15,7 +15,6 @@ #include "cmLocalVisualStudioGenerator.h" #include "cmVisualStudioGeneratorOptions.h" -class cmTarget; class cmSourceFile; class cmCustomCommand; class cmSourceGroup; @@ -63,7 +62,8 @@ public: const char* path); virtual void AddCMakeListsRules(); protected: - void CreateSingleVCProj(const std::string& lname, cmTarget &tgt); + void CreateSingleVCProj(const std::string& lname, + cmGeneratorTarget *tgt); private: typedef cmVisualStudioGeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -72,30 +72,33 @@ private: void FixGlobalTargets(); void WriteProjectFiles(); void WriteVCProjHeader(std::ostream& fout, const std::string& libName, - cmTarget &tgt, std::vector<cmSourceGroup> &sgs); - void WriteVCProjFooter(std::ostream& fout, cmTarget &target); + cmGeneratorTarget* tgt, + std::vector<cmSourceGroup> &sgs); + void WriteVCProjFooter(std::ostream& fout, cmGeneratorTarget* target); void WriteVCProjFile(std::ostream& fout, const std::string& libName, - cmTarget &tgt); + cmGeneratorTarget* tgt); void WriteConfigurations(std::ostream& fout, std::vector<std::string> const& configs, - const std::string& libName, cmTarget &tgt); + const std::string& libName, cmGeneratorTarget* tgt); void WriteConfiguration(std::ostream& fout, const std::string& configName, - const std::string& libName, cmTarget &tgt); + const std::string& libName, cmGeneratorTarget* tgt); std::string EscapeForXML(const std::string& s); std::string ConvertToXMLOutputPath(const char* path); std::string ConvertToXMLOutputPathSingle(const char* path); void OutputTargetRules(std::ostream& fout, const std::string& configName, - cmTarget &target, const std::string& libName); + cmGeneratorTarget* target, + const std::string& libName); void OutputBuildTool(std::ostream& fout, const std::string& configName, - cmTarget& t, const Options& targetOptions); + cmGeneratorTarget* t, const Options& targetOptions); void OutputLibraryDirectories(std::ostream& fout, std::vector<std::string> const& dirs); - void WriteProjectSCC(std::ostream& fout, cmTarget& target); + void WriteProjectSCC(std::ostream& fout, cmGeneratorTarget *target); void WriteProjectStart(std::ostream& fout, const std::string& libName, - cmTarget &tgt, std::vector<cmSourceGroup> &sgs); + cmGeneratorTarget* tgt, + std::vector<cmSourceGroup> &sgs); void WriteProjectStartFortran(std::ostream& fout, const std::string& libName, - cmTarget &tgt); + cmGeneratorTarget* tgt); void WriteVCProjBeginGroup(std::ostream& fout, const char* group, const char* filter); @@ -110,7 +113,7 @@ private: cmGeneratorTarget* gt); bool WriteGroup(const cmSourceGroup *sg, - cmTarget& target, std::ostream &fout, + cmGeneratorTarget* target, std::ostream &fout, const std::string& libName, std::vector<std::string> const& configs); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=650938a289cc5da9304aeaaab6ee3fb85710a204 commit 650938a289cc5da9304aeaaab6ee3fb85710a204 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Oct 22 18:27:57 2015 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Thu Oct 22 23:13:44 2015 +0200 VS10: Port to cmGeneratorTarget. diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 161b532..e568704 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -331,7 +331,7 @@ void cmGlobalVisualStudio10Generator::Generate() this->cmGlobalVisualStudio8Generator::Generate(); if(this->LongestSource.Length > 0) { - cmMakefile* mf = this->LongestSource.Target->GetMakefile(); + cmLocalGenerator* lg = this->LongestSource.Target->GetLocalGenerator(); std::ostringstream e; e << "The binary and/or source directory paths may be too long to generate " @@ -346,13 +346,13 @@ void cmGlobalVisualStudio10Generator::Generate() " " << this->LongestSource.SourceFile->GetFullPath() << "\n" "This is because some Visual Studio tools would append the relative " "path to the end of the referencing directory path, as in:\n" - " " << mf->GetCurrentBinaryDirectory() << "/" + " " << lg->GetCurrentBinaryDirectory() << "/" << this->LongestSource.SourceRel << "\n" "and then incorrectly complain that the file does not exist because " "the path length is too long for some internal buffer or API. " "To avoid this problem CMake must use a full path for this file " "which then triggers the VS 10 property dialog bug."; - mf->IssueMessage(cmake::WARNING, e.str().c_str()); + lg->IssueMessage(cmake::WARNING, e.str().c_str()); } } @@ -591,9 +591,11 @@ cmGlobalVisualStudio10Generator //---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator::PathTooLong( - cmTarget* target, cmSourceFile const* sf, std::string const& sfRel) + cmGeneratorTarget *target, cmSourceFile const* sf, + std::string const& sfRel) { - size_t len = (strlen(target->GetMakefile()->GetCurrentBinaryDirectory()) + + size_t len = + (strlen(target->GetLocalGenerator()->GetCurrentBinaryDirectory()) + 1 + sfRel.length()); if(len > this->LongestSource.Length) { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 7600a0d..6bf4740 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -95,7 +95,7 @@ public: /** Generate an <output>.rule file path for a given command output. */ virtual std::string GenerateRuleFile(std::string const& output) const; - void PathTooLong(cmTarget* target, cmSourceFile const* sf, + void PathTooLong(cmGeneratorTarget* target, cmSourceFile const* sf, std::string const& sfRel); virtual const char* GetToolsVersion() { return "4.0"; } @@ -139,7 +139,7 @@ private: { LongestSourcePath(): Length(0), Target(0), SourceFile(0) {} size_t Length; - cmTarget* Target; + cmGeneratorTarget* Target; cmSourceFile const* SourceFile; std::string SourceRel; }; diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index c9d53fe..e9aee8a 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -90,7 +90,7 @@ void cmLocalVisualStudio10Generator::Generate() else { cmVisualStudio10TargetGenerator tg( - (*l)->Target, static_cast<cmGlobalVisualStudio10Generator*>( + *l, static_cast<cmGlobalVisualStudio10Generator*>( this->GetGlobalGenerator())); tg.Generate(); } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f4c632d..3f8e627 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -13,7 +13,6 @@ #include "cmVisualStudio10TargetGenerator.h" #include "cmGlobalVisualStudio10Generator.h" #include "cmGeneratorTarget.h" -#include "cmTarget.h" #include "cmComputeLinkInformation.h" #include "cmGeneratedFileStream.h" #include "cmMakefile.h" @@ -167,13 +166,12 @@ static std::string cmVS10EscapeComment(std::string comment) } cmVisualStudio10TargetGenerator:: -cmVisualStudio10TargetGenerator(cmTarget* target, +cmVisualStudio10TargetGenerator(cmGeneratorTarget* target, cmGlobalVisualStudio10Generator* gg) { this->GlobalGenerator = gg; - this->Target = target; - this->GeneratorTarget = gg->GetGeneratorTarget(target); - this->Makefile = target->GetMakefile(); + this->GeneratorTarget = target; + this->Makefile = target->Target->GetMakefile(); this->Makefile->GetConfigurations(this->Configurations); this->LocalGenerator = (cmLocalVisualStudio7Generator*) @@ -275,8 +273,9 @@ void cmVisualStudio10TargetGenerator::Generate() return; } // Tell the global generator the name of the project file - this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str()); - this->Target->SetProperty("GENERATOR_FILE_NAME_EXT", + this->GeneratorTarget->Target + ->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str()); + this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME_EXT", ".vcxproj"); if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { @@ -732,7 +731,8 @@ void cmVisualStudio10TargetGenerator cmGlobalVisualStudio10Generator* gg = static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator); const char* mfcFlag = - this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG"); + this->GeneratorTarget-> + Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG"); std::string mfcFlagValue = mfcFlag ? mfcFlag : "0"; std::string useOfMfcValue = "false"; @@ -1462,7 +1462,8 @@ void cmVisualStudio10TargetGenerator::WriteSource( } else { - this->GlobalGenerator->PathTooLong(this->Target, sf, sourceRel); + this->GlobalGenerator->PathTooLong(this->GeneratorTarget, + sf, sourceRel); } } this->ConvertToWindowsSlash(sourceFile); @@ -1915,12 +1916,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( std::string baseFlagVar = "CMAKE_"; baseFlagVar += linkLanguage; baseFlagVar += "_FLAGS"; - flags = this-> + flags = this->GeneratorTarget-> Target->GetMakefile()->GetRequiredDefinition(baseFlagVar.c_str()); std::string flagVar = baseFlagVar + std::string("_") + cmSystemTools::UpperCase(configName); flags += " "; - flags += this-> + flags += this->GeneratorTarget-> Target->GetMakefile()->GetRequiredDefinition(flagVar.c_str()); } // set the correct language @@ -1936,7 +1937,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( linkLanguage, configName.c_str()); // Get preprocessor definitions for this directory. - std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags(); + std::string defineFlags = + this->GeneratorTarget->Target->GetMakefile()->GetDefineFlags(); if(this->MSTools) { clOptions.FixExceptionHandlingDefault(); @@ -2440,11 +2442,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) linkFlagVarBase += linkType; linkFlagVarBase += "_LINKER_FLAGS"; flags += " "; - flags += this-> + flags += this->GeneratorTarget-> Target->GetMakefile()->GetRequiredDefinition(linkFlagVarBase.c_str()); std::string linkFlagVar = linkFlagVarBase + "_" + CONFIG; flags += " "; - flags += this-> + flags += this->GeneratorTarget-> Target->GetMakefile()->GetRequiredDefinition(linkFlagVar.c_str()); const char* targetLinkFlags = this->GeneratorTarget->GetProperty("LINK_FLAGS"); @@ -2674,7 +2676,8 @@ cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) linkOptions.OutputFlagMap(*this->BuildFileStream, " "); this->WriteString("</Link>\n", 2); - if(!this->GlobalGenerator->NeedLinkLibraryDependencies(*this->Target)) + if(!this->GlobalGenerator->NeedLinkLibraryDependencies( + *this->GeneratorTarget->Target)) { this->WriteString("<ProjectReference>\n", 2); this->WriteString( @@ -2811,7 +2814,7 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) { addedPrelink = true; std::vector<cmCustomCommand> commands = - this->Target->GetPreLinkCommands(); + this->GeneratorTarget->Target->GetPreLinkCommands(); this->GlobalGenerator->AddSymbolExportCommand( this->GeneratorTarget, commands, configName); this->WriteEvent("PreLinkEvent", commands, configName); @@ -2820,12 +2823,12 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) if (!addedPrelink) { this->WriteEvent("PreLinkEvent", - this->Target->GetPreLinkCommands(), configName); + this->GeneratorTarget->Target->GetPreLinkCommands(), configName); } this->WriteEvent("PreBuildEvent", - this->Target->GetPreBuildCommands(), configName); + this->GeneratorTarget->Target->GetPreBuildCommands(), configName); this->WriteEvent("PostBuildEvent", - this->Target->GetPostBuildCommands(), configName); + this->GeneratorTarget->Target->GetPostBuildCommands(), configName); } void cmVisualStudio10TargetGenerator::WriteEvent( @@ -2875,7 +2878,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() for( OrderedTargetDependSet::const_iterator i = depends.begin(); i != depends.end(); ++i) { - cmTarget const* dt = (*i)->Target; + cmGeneratorTarget const* dt = *i; if(dt->GetType() == cmState::INTERFACE_LIBRARY) { continue; @@ -2883,12 +2886,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() // skip fortran targets as they can not be processed by MSBuild // the only reference will be in the .sln file if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) - ->TargetIsFortranOnly(*dt)) + ->TargetIsFortranOnly(*dt->Target)) { continue; } this->WriteString("<ProjectReference Include=\"", 2); - cmMakefile* mf = dt->GetMakefile(); + cmLocalGenerator* lg = dt->GetLocalGenerator(); std::string name = dt->GetName(); std::string path; const char* p = dt->GetProperty("EXTERNAL_MSPROJECT"); @@ -2898,7 +2901,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() } else { - path = mf->GetCurrentBinaryDirectory(); + path = lg->GetCurrentBinaryDirectory(); path += "/"; path += dt->GetName(); path += ".vcxproj"; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 15ed9f2..044e0dd 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -13,7 +13,6 @@ #define cmVisualStudioTargetGenerator_h #include "cmStandardIncludes.h" -class cmTarget; class cmMakefile; class cmGeneratorTarget; class cmGeneratedFileStream; @@ -29,7 +28,7 @@ struct cmIDEFlagTable; class cmVisualStudio10TargetGenerator { public: - cmVisualStudio10TargetGenerator(cmTarget* target, + cmVisualStudio10TargetGenerator(cmGeneratorTarget* target, cmGlobalVisualStudio10Generator* gg); ~cmVisualStudio10TargetGenerator(); void Generate(); @@ -148,7 +147,6 @@ private: OptionsMap LinkOptions; std::string PathToVcxproj; std::vector<std::string> Configurations; - cmTarget* Target; cmGeneratorTarget* GeneratorTarget; cmMakefile* Makefile; std::string Platform; ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalVisualStudio10Generator.cxx | 12 +- Source/cmGlobalVisualStudio10Generator.h | 4 +- Source/cmGlobalVisualStudio6Generator.cxx | 10 +- Source/cmGlobalVisualStudio6Generator.h | 2 +- Source/cmGlobalVisualStudio71Generator.cxx | 12 +- Source/cmGlobalVisualStudio71Generator.h | 4 +- Source/cmGlobalVisualStudio7Generator.cxx | 38 ++--- Source/cmGlobalVisualStudio7Generator.h | 9 +- Source/cmGlobalVisualStudio8Generator.cxx | 13 +- Source/cmGlobalVisualStudio8Generator.h | 5 +- Source/cmGlobalVisualStudioGenerator.cxx | 87 ++++++------ Source/cmGlobalVisualStudioGenerator.h | 32 +++-- Source/cmLocalVisualStudio10Generator.cxx | 6 +- Source/cmLocalVisualStudio6Generator.cxx | 4 +- Source/cmLocalVisualStudio6Generator.h | 3 +- Source/cmLocalVisualStudio7Generator.cxx | 210 +++++++++++++--------------- Source/cmLocalVisualStudio7Generator.h | 32 +++-- Source/cmLocalVisualStudioGenerator.cxx | 14 +- Source/cmLocalVisualStudioGenerator.h | 6 +- Source/cmVisualStudio10TargetGenerator.cxx | 49 ++++--- Source/cmVisualStudio10TargetGenerator.h | 4 +- 21 files changed, 277 insertions(+), 279 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits