[cmake-developers] Lua-style long brackets (was: Roadmap to CMake 3.0)

Brad King brad.king at kitware.com
Fri Oct 11 15:56:30 EDT 2013


On 10/11/2013 03:34 PM, Rolf Eike Beer wrote:
> Just out of curiosity: is the Lua integration affecting the set
> of supported compilers?

There is no integration of Lua's source code in my outline.  It is
only a change to the CMake language lexer/parser to handle Lua-style
long-bracket syntax.  For example:

file(WRITE myfile.txt [====[
This is the first line!
Arbitrary content without:
 - ${variable} evaluation
 - \-escapes
 - "-quoting
]====])

instead of

file(WRITE myfile.txt "This is the first line!
Arbitrary content without:
 - \${variable} evaluation
 - \\-escapes
 - \"-quoting
")

It will also support long-bracket comments, e.g.

#[========[
This is a multi-line comment that can contain arbitrary text except
for the close bracket of equal length.  It is great for long
explanations, copyright notices, and commenting out large blocks
of code.  The closing bracket does not need to start in #, but if
it does then a one-character change to the opening bracket to be
"##[========[" would enable the entire block and the ending line
would be a normal one-line comment.
#]========]

-Brad



More information about the cmake-developers mailing list