MantisBT - CMake
View Issue Details
0015092CMakeCMakepublic2014-08-16 11:062015-01-05 08:39
David Thomas 
Brad King 
highmajoralways
closedfixed 
ParallelsOS X10.8
CMake 3.0.1 
CMake 3.0.2CMake 3.0.2 
0015092: COMMAND cannot parse shell []
Any COMMAND that starts with '[' and has some statement followed by ']' generates some parser error that never occurred in CMAKE 2.x. I cannot recall the exact error as I downgraded to CMAKE 2.8.12, but it was something about expecting a parenthesis.
Try this or some shorter version of this in a cmakelists.txt file:
COMMAND [ ! -d "${CMAKE_CFG_INTDIR}/lib" ] || cp -rf "${CMAKE_CFG_INTDIR}/lib" "${CMAKE_CFG_INTDIR}/${APPLICATION_NAME}.app/Contents/MacOS/"
all parse-able COMMANDS in CMAKE 2.8 need to be parse-able in 3.x.
No tags attached.
Issue History
2014-08-16 11:06David ThomasNew Issue
2014-08-18 10:14Brad KingAssigned To => Brad King
2014-08-18 10:14Brad KingStatusnew => assigned
2014-08-18 10:14Brad KingTarget Version => CMake 3.0.2
2014-08-18 10:15Brad KingNote Added: 0036631
2014-08-18 10:18Brad KingNote Added: 0036632
2014-08-18 10:19Brad KingNote Added: 0036633
2014-08-19 09:50Brad KingNote Added: 0036645
2014-08-19 09:50Brad KingStatusassigned => resolved
2014-08-19 09:50Brad KingResolutionopen => fixed
2014-08-19 09:50Brad KingFixed in Version => CMake 3.0.2
2015-01-05 08:39Robert MaynardNote Added: 0037618
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0036631)
Brad King   
2014-08-18 10:15   
There is one intentionally introduced syntax change documented in the 3.0 release notes:

 http://www.cmake.org/cmake/help/v3.0/release/3.0.0.html#syntax [^]

but this is *not* it. This is a real regression in lexing a single '[' as its own unquoted argument.
(0036632)
Brad King   
2014-08-18 10:18   
Fixed:

 cmListFileLexer: Fix lexing of single '[' character
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=02b3cba9 [^]
(0036633)
Brad King   
2014-08-18 10:19   
Meanwhile you can work around the problem by quoting the argument:

 COMMAND "[" ! -d "${CMAKE_CFG_INTDIR}/lib" "]"
(0036645)
Brad King   
2014-08-19 09:50   
I've merged the fix for inclusion in the 3.0.2 release.
(0037618)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months