VS: Refactor handling of resx headers

Move generation of the ClInclude element to WriteHeaderSource.
This commit is contained in:
Brad King 2014-07-29 13:41:17 -04:00
parent c2ef6d238a
commit 15fb102278
1 changed files with 12 additions and 14 deletions

View File

@ -999,7 +999,16 @@ WriteGroupSources(const char* name,
void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf)
{
this->WriteSource("ClInclude", sf);
if(this->IsResxHeader(sf->GetFullPath()))
{
this->WriteSource("ClInclude", sf, ">\n");
this->WriteString("<FileType>CppForm</FileType>\n", 3);
this->WriteString("</ClInclude>\n", 2);
}
else
{
this->WriteSource("ClInclude", sf);
}
}
void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
@ -1046,19 +1055,8 @@ void cmVisualStudio10TargetGenerator::WriteSource(
this->ConvertToWindowsSlash(sourceFile);
this->WriteString("<", 2);
(*this->BuildFileStream ) << tool << " Include=\""
<< cmVS10EscapeXML(sourceFile) << "\"";
if(sf->GetExtension() == "h" &&
this->IsResxHeader(sf->GetFullPath()))
{
(*this->BuildFileStream ) << ">\n";
this->WriteString("<FileType>CppForm</FileType>\n", 3);
this->WriteString("</ClInclude>\n", 2);
}
else
{
(*this->BuildFileStream ) << (end? end : " />\n");
}
<< cmVS10EscapeXML(sourceFile) << "\""
<< (end? end : " />\n");
ToolSource toolSource = {sf, forceRelative};
this->Tools[tool].push_back(toolSource);