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

Create a WriteHeaderSource method to handle writing of sources
classified by cmGeneratorTarget as header files.  This will be
useful to add special VS-specific handling for some headers.
This commit is contained in:
Brad King 2014-07-29 13:36:53 -04:00
parent 2df389115e
commit c2ef6d238a
2 changed files with 11 additions and 1 deletions

View File

@ -997,6 +997,11 @@ WriteGroupSources(const char* name,
this->WriteString("</ItemGroup>\n", 1); this->WriteString("</ItemGroup>\n", 1);
} }
void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf)
{
this->WriteSource("ClInclude", sf);
}
void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
{ {
this->WriteSource("None", sf); this->WriteSource("None", sf);
@ -1079,7 +1084,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
std::vector<cmSourceFile const*> headerSources; std::vector<cmSourceFile const*> headerSources;
this->GeneratorTarget->GetHeaderSources(headerSources, ""); this->GeneratorTarget->GetHeaderSources(headerSources, "");
this->WriteSources("ClInclude", headerSources); for(std::vector<cmSourceFile const*>::const_iterator
si = headerSources.begin(); si != headerSources.end(); ++si)
{
this->WriteHeaderSource(*si);
}
std::vector<cmSourceFile const*> idlSources; std::vector<cmSourceFile const*> idlSources;
this->GeneratorTarget->GetIDLSources(idlSources, ""); this->GeneratorTarget->GetIDLSources(idlSources, "");
this->WriteSources("Midl", idlSources); this->WriteSources("Midl", idlSources);

View File

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