From 93e732a7c071422f6d576b0bc2f336e575f9c8c8 Mon Sep 17 00:00:00 2001
From: test <test@localhost>
Date: Wed, 5 Jun 2013 17:00:10 +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 f8de3a8..dd4c425 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -288,6 +288,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 "\""
@@ -307,6 +308,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
@@ -928,8 +930,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))
       {
@@ -941,7 +944,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.8.1.2

