View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015092CMakeCMakepublic2014-08-16 11:062015-01-05 08:39
ReporterDavid Thomas 
Assigned ToBrad King 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformParallelsOSOS XOS Version10.8
Product VersionCMake 3.0.1 
Target VersionCMake 3.0.2Fixed in VersionCMake 3.0.2 
Summary0015092: COMMAND cannot parse shell []
DescriptionAny 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.
Steps To ReproduceTry 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/"
Additional Informationall parse-able COMMANDS in CMAKE 2.8 need to be parse-able in 3.x.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036631)
Brad King (manager)
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 (manager)
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 (manager)
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 (manager)
2014-08-19 09:50

I've merged the fix for inclusion in the 3.0.2 release.
(0037618)
Robert Maynard (manager)
2015-01-05 08:39

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

 Issue History
Date Modified Username Field Change
2014-08-16 11:06 David Thomas New Issue
2014-08-18 10:14 Brad King Assigned To => Brad King
2014-08-18 10:14 Brad King Status new => assigned
2014-08-18 10:14 Brad King Target Version => CMake 3.0.2
2014-08-18 10:15 Brad King Note Added: 0036631
2014-08-18 10:18 Brad King Note Added: 0036632
2014-08-18 10:19 Brad King Note Added: 0036633
2014-08-19 09:50 Brad King Note Added: 0036645
2014-08-19 09:50 Brad King Status assigned => resolved
2014-08-19 09:50 Brad King Resolution open => fixed
2014-08-19 09:50 Brad King Fixed in Version => CMake 3.0.2
2015-01-05 08:39 Robert Maynard Note Added: 0037618
2015-01-05 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team