Am Mittwoch, 3. November 2010 schrieb Eric Noulard:

> I "may" have a problem with Visual Studio 2010 generator.
> The concerned project CERTI (https://savannah.nongnu.org/projects/certi)
> builds fine on on several using CMake.
> 
> But when we try to build CERTI with CMake 2.8.2 (or 2.8.3rc4) we get
> a solution file which fails to load completely because because one vcproj
> contains an apparently mis-closed statement:
> 
> offending lines are those one:
> [...]
>     <None Include="..\..\certi-HEAD\libHLA\HLAvariantRecord.hh" />
>     <ClInclude Include="..\..\certi-HEAD\libHLA\sha1.h">
>       <ObjectFileName>$(IntDir)/sha1.obj</ObjectFileName>
>     </ClCompile>
>     <None Include="..\..\certi-HEAD\libHLA\Clock.hh" />
> [...]
> 
> i.e. the <ClInclude Include ...>
> is closed by a
>    </ClCompile>
> 
> The corresponding source code may be found there:
> http://cvs.savannah.gnu.org/viewvc/certi/?root=certi.
> 
> I'm not sure I will have the time to build a smaller example.
> 
> Note that the same source tree is working well using any
> other CMake generators (Visual Studio or Code::Blocks etc...)
> so the problem seems to be particular to VS2010.

Try the attached patch. It's completely untested so it may even not compile 
but that should be pretty straightforward.

Greetings,

Eike
From faa226048c68050cad32726788750fa6252ce9cb Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <e...@sf-mail.de>
Date: Wed, 3 Nov 2010 20:07:58 +0100
Subject: [PATCH] fix MSVC2010 generator writing wrong closing tag

---
 Source/cmVisualStudio10TargetGenerator.cxx |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 524be8b..8379d0f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -689,10 +689,14 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
         }
       (*this->BuildFileStream ) << sourceFile << "\"";
       // ouput any flags specific to this source file
-      if(cl && this->OutputSourceSpecificFlags(*source))
+      // if the source file has specific flags the tag
+      // is ended on a new line
+      if(header && this->OutputSourceSpecificFlags(*source))
+        {
+        this->WriteString("</ClInclude>\n", 2);
+        }
+      else if(cl && this->OutputSourceSpecificFlags(*source))
         {
-        // if the source file has specific flags the tag
-        // is ended on a new line
         this->WriteString("</ClCompile>\n", 2);
         }
       else
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to