MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0003218 | CMake | CMake | public | 2006-05-11 02:32 | 2008-02-06 10:12 |
Reporter | Manuel Klimek | ||||
Assigned To | Bill Hoffman | ||||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0003218: Automatic Visual Studio dependency generation (patch) | ||||
Description | The visual studio sln generator should write dependant projects from the same cmake tree automatically. --- cmake-2.4.1-orig/Source/cmGlobalVisualStudio71Generator.cxx 2006-04-30 17:06:37.000000000 +0200 +++ cmake-2.4.1/Source/cmGlobalVisualStudio71Generator.cxx 2006-05-10 13:36:19.343750000 +0200 @@ -44,7 +44,7 @@ // Write a SLN file to the stream void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, - std::vector<cmLocalGenerator*>& generators) + std::vector<cmLocalGenerator*>& localGenerators) { // Write out the header for a SLN file this->WriteSLNHeader(fout); @@ -59,7 +59,71 @@ bool doneEditCache = false; bool doneRebuildCache = false; bool donePackage = false; - + + std::vector<cmLocalGenerator*> generators = localGenerators; + if(!generators.empty()) + { + // calculate closure on library dependencies + cmLocalGenerator *topGenerator = generators[0]; + while(topGenerator->GetParent() != NULL) + { + topGenerator = topGenerator->GetParent(); + } + unsigned int lastSize = 0; + do + { + std::vector<cmLocalGenerator*> dependencyGenerators; + lastSize = generators.size(); + // build closure + for(unsigned int i=0; i<generators.size(); ++i) + { + cmMakefile *makefile = generators[i]->GetMakefile(); + for(cmTargets::iterator it=makefile->GetTargets().begin(); it != makefile->GetTargets().end(); ++it) + { + if(it->second.GetType() != cmTarget::STATIC_LIBRARY) + { + cmTarget::LinkLibraryVectorType::const_iterator j, jend; + j = it->second.GetLinkLibraries().begin(); + jend = it->second.GetLinkLibraries().end(); + for(;j!= jend; ++j) + { + cmTarget *dependency = topGenerator->GetGlobalGenerator()->FindTarget(NULL, j->first.c_str()); + if(dependency) + { + cmLocalGenerator* generator = topGenerator->GetGlobalGenerator()->FindLocalGenerator(dependency->GetMakefile()->GetCurrentDirectory()); + bool found = false; + for(unsigned int k=0; k<generators.size() && !found; ++k) + { + if(generators[k] == generator) + { + found = true; + } + } + for(unsigned int k=0; k<dependencyGenerators.size() && !found; ++k) + { + if(dependencyGenerators[k] == generator) + { + found = true; + } + } + if(!found) + { + dependencyGenerators.push_back(generator); + this->ProjectMap[generators[i]->GetMakefile()->GetProjectName()].push_back(generator); + } + } + } + } + } + } + for(unsigned int i=0; i<dependencyGenerators.size(); ++i) + { + generators.push_back(dependencyGenerators[i]); + } + } + while(lastSize < generators.size()); + } + // For each cmMakefile, create a VCProj for it, and // add it to this SLN file unsigned int i; | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://public.kitware.com/Bug/file/1094/patch | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-08-09 08:48 | Torsten Martinsen | File Added: patch | |||
2007-08-09 08:48 | Torsten Martinsen | Note Added: 0008385 | |||
2007-08-30 10:32 | Mathieu Malaterre | Assigned To | System Admin => | ||
2007-08-30 10:33 | Mathieu Malaterre | Assigned To | => Alex Neundorf | ||
2007-08-30 10:48 | Alex Neundorf | Assigned To | Alex Neundorf => Bill Hoffman | ||
2008-02-06 10:12 | Bill Hoffman | Status | assigned => closed | ||
2008-02-06 10:12 | Bill Hoffman | Note Added: 0010385 | |||
2008-02-06 10:12 | Bill Hoffman | Resolution | open => fixed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|