View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014331CMakeCMakepublic2013-08-01 14:412014-02-10 10:44
Reporterd3x0r 
Assigned ToBrad King 
PriorityhighSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformwindowsOSwindowsOS Version7
Product VersionCMake 2.8.11.2 
Target VersionCMake 2.8.12Fixed in VersionCMake 2.8.12 
Summary0014331: Generating projects for visual studio (2010,2012, others?) creates corrupt projects if path includes '&'
DescriptionThis simple make file creates corrupt .vcxproj files (files that visual studio refuses to load).

-----------
cmake_minimum_required(VERSION 2.8)

FILE( WRITE test.c "int main(){ return 0;} " )
include_directories( "a & b" )
add_executable( test test.c )
------------

the project file is expected to be XML, so it parses first using those rules, and '&' should be emitted as '&' instead.
Steps To Reproduceuse visual studio generator on the attached CMakeLists.txt, then load the .sln produced. None of the projects will load.
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (146 bytes) 2013-08-01 14:41 [Show Content]

 Relationships

  Notes
(0033643)
Brad King (manager)
2013-08-01 14:58

Try this patch (untested):
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx

index 1130704..937509e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1389,7 +1389,7 @@ OutputIncludes(std::vector<std::string> const & includes)
   for(std::vector<std::string>::const_iterator i =  includes.begin();
       i != includes.end(); ++i)
     {
-    *this->BuildFileStream << *i << ";";
+    *this->BuildFileStream << cmVS10EscapeXML(*i) << ";";
     }
   this->WriteString("%(AdditionalIncludeDirectories)"
                     "</AdditionalIncludeDirectories>\n", 0);
(0033644)
Brad King (manager)
2013-08-01 15:27

I tested and applied the patch from 0014331:0033643:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7bcdf85 [^]
(0035067)
Robert Maynard (manager)
2014-02-10 10:44

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-08-01 14:41 d3x0r New Issue
2013-08-01 14:41 d3x0r File Added: CMakeLists.txt
2013-08-01 14:58 Brad King Note Added: 0033643
2013-08-01 15:27 Brad King Note Added: 0033644
2013-08-01 15:27 Brad King Assigned To => Brad King
2013-08-01 15:27 Brad King Status new => resolved
2013-08-01 15:27 Brad King Resolution open => fixed
2013-08-01 15:27 Brad King Fixed in Version => CMake 2.8.12
2013-08-01 15:27 Brad King Target Version => CMake 2.8.12
2013-08-01 15:27 Brad King Description Updated
2014-02-10 10:44 Robert Maynard Note Added: 0035067
2014-02-10 10:44 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team