MantisBT - CMake
View Issue Details
0015031CMakeCMakepublic2014-07-22 08:362015-01-05 08:39
Michael Scott 
Brad King 
normalminoralways
closedfixed 
Windows 7 64-bitWindows7 64-bit
CMake 3.0 
CMake 3.1CMake 3.1 
0015031: visual studio 2012 generator ampersand escaping
The Visual Studio 2012 generator does not seem to escape ampersands in source file paths correctly, resulting in the generated project XML containing errors and being un-openable with Visual Studio.

I tested the same config with the Visual Studio 2008 generator and did not encounter the same issue. When looking at the generated XML, in VS2008 the '&' character is replaced by '&'.
Create a target whose sources includes a file path with the '&' character, then run cmake specifying VS2012 as the generator, open the created solution and notice that it cannot open the target project.
No tags attached.
Issue History
2014-07-22 08:36Michael ScottNew Issue
2014-07-28 10:53Brad KingNote Added: 0036470
2014-07-28 10:54Brad KingAssigned To => Brad King
2014-07-28 10:54Brad KingStatusnew => assigned
2014-07-28 10:54Brad KingTarget Version => CMake 3.1
2014-07-28 10:54Brad KingDescription Updatedbug_revision_view_page.php?rev_id=1532#r1532
2014-07-31 06:11Michael ScottNote Added: 0036519
2014-07-31 08:41Brad KingNote Added: 0036521
2014-07-31 09:33Michael ScottNote Added: 0036531
2014-07-31 09:43Brad KingNote Added: 0036533
2014-07-31 09:51Michael ScottNote Added: 0036534
2014-07-31 10:09Brad KingNote Added: 0036535
2014-07-31 10:09Brad KingStatusassigned => resolved
2014-07-31 10:09Brad KingResolutionopen => fixed
2014-07-31 10:09Brad KingFixed in Version => CMake 3.1
2015-01-05 08:39Robert MaynardNote Added: 0037602
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0036470)
Brad King   
2014-07-28 10:53   
I've merged a topic that addresses this:

 cmVisualStudio10TargetGenerator: Remove dupilcate line
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91c93354 [^]

 cmIDEOption: Store mapped flag values as a vector<string>
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c209ac1 [^]

 cmVisualStudioGeneratorOptions: Simplify XML escaping API
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8fa087ab [^]

 VS: Encode mapped flag values in XML project files
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29a0642b [^]

 VS: Encode more content correctly in vcxproj files
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09164c63 [^]

The first three commits do some refactoring. The last two actually fix the XML encoding.
(0036519)
Michael Scott   
2014-07-31 06:11   
Thank you for the update, I'll fall back to using 2008 for now.

Do you know if there is there an expected release date for CMake version 3.1 yet?
(0036521)
Brad King   
2014-07-31 08:41   
Re 0015031:0036519: You can follow the "Roadmap" link at the top. However, those dates are more of goals than promises.

Meanwhile you could use a nightly binary:

 http://www.cmake.org/files/dev/?C=M;O=D [^]
(0036531)
Michael Scott   
2014-07-31 09:33   
Great that's just what I was looking for. Thanks.
(0036533)
Brad King   
2014-07-31 09:43   
Re 0015031:0036531: Good. Please let me know if the nightly binary solves the problem for you.
(0036534)
Michael Scott   
2014-07-31 09:51   
Just gave a quick test on the 20140730-g65800 build, the XML encoding of the vcxproj file was as expected and the project opened and built without any problems.
(0036535)
Brad King   
2014-07-31 10:09   
Re 0015031:0036534: Great, thanks for verifying!
(0037602)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months