summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-29 17:41:17 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-29 19:06:30 (GMT)
commit15fb102278c1cf9141e42174d89bbfe5ef26f634 (patch)
tree3ad9654f35742f2630f6aab81e79b7ab4382e4ee
parentc2ef6d238a5e30234756a38943436e326b986b58 (diff)
downloadCMake-15fb102278c1cf9141e42174d89bbfe5ef26f634.zip
CMake-15fb102278c1cf9141e42174d89bbfe5ef26f634.tar.gz
CMake-15fb102278c1cf9141e42174d89bbfe5ef26f634.tar.bz2
VS: Refactor handling of resx headers
Move generation of the ClInclude element to WriteHeaderSource.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 22e2461..872f187 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("<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);