mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
cmGlobalVisualStudio7Generator: Factor target collection out of write method
This commit is contained in:
@@ -25,7 +25,7 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(cmake* cm)
|
||||
|
||||
void cmGlobalVisualStudio71Generator::WriteSLNFile(
|
||||
std::ostream& fout, cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators)
|
||||
OrderedTargetDependSet const& orderedProjectTargets)
|
||||
{
|
||||
std::vector<std::string> configs =
|
||||
root->GetMakefile()->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
|
||||
@@ -33,14 +33,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(
|
||||
// Write out the header for a SLN file
|
||||
this->WriteSLNHeader(fout);
|
||||
|
||||
// Collect all targets under this root generator and the transitive
|
||||
// closure of their dependencies.
|
||||
TargetDependSet projectTargets;
|
||||
TargetDependSet originalTargets;
|
||||
this->GetTargetSets(projectTargets, originalTargets, root, generators);
|
||||
OrderedTargetDependSet orderedProjectTargets(
|
||||
projectTargets, this->GetStartupProjectName(root));
|
||||
|
||||
// Generate the targets specification to a string. We will put this in
|
||||
// the actual .sln file later. As a side effect, this method also
|
||||
// populates the set of folders.
|
||||
|
||||
@@ -28,8 +28,9 @@ public:
|
||||
cmGlobalVisualStudio71Generator(cmake* cm);
|
||||
|
||||
protected:
|
||||
void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators) override;
|
||||
void WriteSLNFile(
|
||||
std::ostream& fout, cmLocalGenerator* root,
|
||||
OrderedTargetDependSet const& orderedProjectTargets) override;
|
||||
virtual void WriteSolutionConfigurations(
|
||||
std::ostream& fout, std::vector<std::string> const& configs);
|
||||
void WriteProject(std::ostream& fout, std::string const& name,
|
||||
|
||||
@@ -316,13 +316,22 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile(
|
||||
if (generators.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Collect all targets under this root generator and the transitive
|
||||
// closure of their dependencies.
|
||||
TargetDependSet projectTargets;
|
||||
TargetDependSet originalTargets;
|
||||
this->GetTargetSets(projectTargets, originalTargets, root, generators);
|
||||
OrderedTargetDependSet orderedProjectTargets(
|
||||
projectTargets, this->GetStartupProjectName(root));
|
||||
|
||||
std::string fname = GetSLNFile(root);
|
||||
cmGeneratedFileStream fout(fname);
|
||||
fout.SetCopyIfDifferent(true);
|
||||
if (!fout) {
|
||||
return;
|
||||
}
|
||||
this->WriteSLNFile(fout, root, generators);
|
||||
this->WriteSLNFile(fout, root, orderedProjectTargets);
|
||||
if (fout.Close()) {
|
||||
this->FileReplacedDuringGenerate(fname);
|
||||
}
|
||||
|
||||
@@ -141,8 +141,9 @@ protected:
|
||||
|
||||
virtual void OutputSLNFile(cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators);
|
||||
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
|
||||
std::vector<cmLocalGenerator*>& generators) = 0;
|
||||
virtual void WriteSLNFile(
|
||||
std::ostream& fout, cmLocalGenerator* root,
|
||||
OrderedTargetDependSet const& orderedProjectTargets) = 0;
|
||||
virtual void WriteProject(std::ostream& fout, std::string const& name,
|
||||
std::string const& path,
|
||||
cmGeneratorTarget const* t) = 0;
|
||||
|
||||
Reference in New Issue
Block a user