documentation about cmake-language syntax
It seems that there is inconsistency in syntax definition
file_element ::= command_invocation line_ending |
(bracket_comment|space)* line_ending
command_invocation ::= space* identifier space* '(' arguments ')'
line_ending ::= line_comment? newline
line_comment ::= '#' <any text not starting in a bracket_argument
and not containing a newline>
newline ::= <match '\n'>
according to this documentation between command_invocation and line_ending (so either line_comment or newline itself) there can be no spaces
this line would be incorrect:
set(CMAKE_CXX_STANDARD 17) # a comment
due to whitespaces between )
and #
It might be that I interpret something incorrectly here.