[CMake] Can arguments in an command invocation end in a line comment?

Maris Razvan razvyboy2004 at gmail.com
Tue May 7 14:47:14 EDT 2019


In the latest CMake documentation, the "language" section, the "Source
Files" paragraph there is the following sentence:

    "Note that any source file line not inside Command Arguments or a
Bracket Comment can end in a Line Comment."

I think that source file lines inside "Command Arguments" can end in a
"Line Comment" because the grammar specified in the "Command
Invocations" paragraph states that a "line_ending" (which may contain
a "line_comment") can separate arguments.

Also, the following code snippet works as expected in cmake 3.11.4:

    foreach(arg arg1
                     arg2 #line-comment
               )
      message("${arg}")
    endforeach()

Am I misunderstanding the above quote or is it inaccurate?

Thank you!


More information about the CMake mailing list