From 1751161e14f3e46ec81f2b4be5be777dfd7c6ece Mon Sep 17 00:00:00 2001
From: test <tst>
Date: Fri, 26 Oct 2012 00:52:14 +0300
Subject: [PATCH] asm_file_support_vs2010_vs2012

---
 Source/cmVisualStudio10TargetGenerator.cxx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a2ecfdf..e193907 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -270,6 +270,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString(
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n", 1);
   this->WriteString("<ImportGroup Label=\"ExtensionSettings\">\n", 1);
+  this->WriteString("<Import Project=\"$(VCTargetsPath)\\BuildCustomizations\\masm.props\" />\n", 2);
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("<ImportGroup Label=\"PropertySheets\">\n", 1);
   this->WriteString("<Import Project=\"" VS10_USER_PROPS "\""
@@ -288,6 +289,7 @@ void cmVisualStudio10TargetGenerator::Generate()
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
     " />\n", 1);
   this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1);
+  this->WriteString("<Import Project=\"$(VCTargetsPath)\\BuildCustomizations\\masm.targets\" />\n", 2);
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("</Project>", 0);
   // The groups are stored in a separate file for VS 10
@@ -848,8 +850,9 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
     const char* lang = (*si)->GetLanguage();
     bool cl = strcmp(lang, "C") == 0 || strcmp(lang, "CXX") == 0;
     bool rc = strcmp(lang, "RC") == 0;
-    const char* tool = cl? "ClCompile" : (rc? "ResourceCompile" : "None");
-    this->WriteSource(tool, *si, " ");
+	bool is_asm = strcmp(lang, "ASM_MASM") == 0;
+    const char* tool = cl? "ClCompile" : (rc? "ResourceCompile" : (is_asm? "MASM" : "None"));
+	this->WriteSource(tool, *si, " ");
     // ouput any flags specific to this source file
     if(cl && this->OutputSourceSpecificFlags(*si))
       {
@@ -861,7 +864,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
       {
       this->WriteString("</ResourceCompile>\n", 2);
       }
-    else
+    else if (is_asm)
+	{
+		(*this->BuildFileStream ) << " >\n";
+		this->WriteString("<FileType>Document</FileType>\n", 3);
+		this->WriteString("</MASM>\n", 2);
+	} else
       {
       (*this->BuildFileStream ) << " />\n";
       }
-- 
1.7.11

