From ac12ea5f54f293103f3e6715e66b694a1a68b994 Mon Sep 17 00:00:00 2001
From: Bastien Schatt <bastien.schatt@magestik.fr>
Date: Tue, 18 Aug 2015 16:04:31 +0200
Subject: [PATCH] Fixed issue 0013685

---
 Source/cmLocalVisualStudioGenerator.cxx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index ca72939..56e3d37 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -47,6 +47,13 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
 {
   std::string dir_max = this->ComputeLongestObjectDirectory(*gt->Target);
 
+  std::string objectExtension(".obj");
+
+  if (this->Makefile->GetDefinition("CMAKE_C_OUTPUT_EXTENSION"))
+  {
+	  objectExtension = (this->Makefile->GetDefinition("CMAKE_C_OUTPUT_EXTENSION"));
+  }
+
   // Count the number of object files with each name.  Note that
   // windows file names are not case sensitive.
   std::map<std::string, int> counts;
@@ -57,7 +64,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
     cmSourceFile const* sf = si->first;
     std::string objectNameLower = cmSystemTools::LowerCase(
       cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
-    objectNameLower += ".obj";
+	objectNameLower += objectExtension;
     counts[objectNameLower] += 1;
     }
 
@@ -70,7 +77,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
     cmSourceFile const* sf = si->first;
     std::string objectName =
       cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
-    objectName += ".obj";
+	objectName += objectExtension;
     if(counts[cmSystemTools::LowerCase(objectName)] > 1)
       {
       const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf);
-- 
1.9.5.msysgit.1

