From 15fb102278c1cf9141e42174d89bbfe5ef26f634 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 29 Jul 2014 13:41:17 -0400 Subject: [PATCH] VS: Refactor handling of resx headers Move generation of the ClInclude element to WriteHeaderSource. --- Source/cmVisualStudio10TargetGenerator.cxx | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 22e2461650..872f187d7e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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("CppForm\n", 3); + this->WriteString("\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("CppForm\n", 3); - this->WriteString("\n", 2); - } - else - { - (*this->BuildFileStream ) << (end? end : " />\n"); - } + << cmVS10EscapeXML(sourceFile) << "\"" + << (end? end : " />\n"); ToolSource toolSource = {sf, forceRelative}; this->Tools[tool].push_back(toolSource);