VS: Refactor handling of "extra" sources in VS >= 10

Create a WriteExtraSource method to handle writing of sources not
classified by cmGeneratorTarget for any particular purpose.  This
will be useful to add special VS-specific handling for some sources.
This commit is contained in:
Brad King 2014-07-29 13:32:22 -04:00
parent 143b40051a
commit 2df389115e
2 changed files with 11 additions and 1 deletions

View File

@ -997,6 +997,11 @@ WriteGroupSources(const char* name,
this->WriteString("</ItemGroup>\n", 1);
}
void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
{
this->WriteSource("None", sf);
}
void cmVisualStudio10TargetGenerator::WriteSource(
std::string const& tool, cmSourceFile const* sf, const char* end)
{
@ -1157,7 +1162,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources, "");
this->WriteSources("None", extraSources);
for(std::vector<cmSourceFile const*>::const_iterator
si = extraSources.begin(); si != extraSources.end(); ++si)
{
this->WriteExtraSource(*si);
}
// Add object library contents as external objects.
std::vector<std::string> objs;

View File

@ -57,6 +57,7 @@ private:
void WriteProjectConfigurations();
void WriteProjectConfigurationValues();
void WriteMSToolConfigurationValues(std::string const& config);
void WriteExtraSource(cmSourceFile const* sf);
void WriteSource(std::string const& tool, cmSourceFile const* sf,
const char* end = 0);
void WriteSources(std::string const& tool,