MantisBT - CMake
View Issue Details
0014073CMakeCMakepublic2013-04-10 19:302014-11-11 08:33
Jean-Christophe Fillion-Robin 
Brad King 
normalminorhave not tried
closedfixed 
 
 
0014073: VS2010 / VS2012 - Improper escape of semicolon in compile definition
To reproduce the problem, create a simple project abd set the COMPILE_DEFINITIONS similarly to what is done here: https://github.com/davidsansome/python-cmake-buildsystem/blob/22a08701/cmake/libpython/CMakeLists.txt#L161-173 [^]
No tags attached.
related to 0014694closed Kitware Robot Percent symbol (%) in path creates bad autogenerated paths 
related to 0015239closed  Escape %3B in preprocessor definitions 
Issue History
2013-04-10 19:30Jean-Christophe Fillion-RobinNew Issue
2013-04-11 09:41Brad KingNote Added: 0032806
2013-04-11 09:44Brad KingStatusnew => backlog
2013-04-11 09:44Brad KingDescription Updatedbug_revision_view_page.php?rev_id=1106#r1106
2013-04-11 10:25Jean-Christophe Fillion-RobinNote Added: 0032807
2013-04-11 10:35Brad KingNote Added: 0032808
2013-04-11 11:18Brad KingNote Added: 0032809
2013-04-11 11:53Brad KingAssigned To => Brad King
2013-04-11 11:53Brad KingStatusbacklog => assigned
2013-04-11 12:00Brad KingNote Added: 0032810
2013-04-12 11:40Brad KingStatusassigned => resolved
2013-04-12 11:40Brad KingResolutionopen => fixed
2013-10-07 10:04Robert MaynardNote Added: 0034027
2013-10-07 10:04Robert MaynardStatusresolved => closed
2014-01-13 14:23Brad KingRelationship addedrelated to 0014694
2014-11-11 08:33Brad KingRelationship addedrelated to 0015239

Notes
(0032806)
Brad King   
2013-04-11 09:41   
This limitation is documented:

 http://www.cmake.org/cmake/help/v2.8.10/cmake.html#prop_tgt:COMPILE_DEFINITIONS [^]

in the "Disclaimer" section about escaping certain characters.

If you've found a way to escape ';' in the VS IDE then we should update CMake to know about it.
(0032807)
Jean-Christophe Fillion-Robin   
2013-04-11 10:25   
More generally, would it make sens to introduce the following generator expression:
  $<SEMICOLON>
  $<PERCENT>

Regarding the specifics of the issue, could you point me to the code causing the "percent" to be escaped for VS2008 and not for 2010 ?
(0032808)
Brad King   
2013-04-11 10:35   
The escaping code is in "Source/kwsys/System.c".

The whole thing should be re-implemented (outside of KWSys) and refactored to do escaping in layers. Right now it tries to do all escaping layers at once. Instead there should be a separate pass for each tool that will be evaluating the escapes (escape for shell, then escape result for make tool, etc.).

I don't think there is anything about % that is different between VS 2008 and 2010 in the escaping code. Note that the disclaimer documentation I linked in 0014073:0032806 warns against trying to do your own escapes.
(0032809)
Brad King   
2013-04-11 11:18   
Re 0014073:0032808: Oops, the VS generators use a different escape path for preprocessor definitions. It is here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudioGeneratorOptions.cxx;hb=v2.8.10.2#l217 [^]

There are clearly different paths for VS >= 10 and VS < 10.
(0032810)
Brad King   
2013-04-11 12:00   
This should fix it:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e4688e4 [^]
(0034027)
Robert Maynard   
2013-10-07 10:04   
Closing resolved issues that have not been updated in more than 4 months.