Variable reference: confusing documentation regarding dollar-sign `$` in names
Documentation for policy CMP0053 states that NEW
behavior allow only _, ., /, -, and +
characters in variable reference name. Although this code with $
in variable name compiles fine:
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0053 NEW)
set($ "foo")
message(STATUS ${$})
Output is:
-- foo
-- Configuring done
-- Generating done
-- Build files have been written to: ...
The same time compiling same code with OLD
behavior results in error:
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0053 OLD)
set($ "foo")
message(STATUS ${$})
Output:
CMake Error at CMakeLists.txt:6 (message):
Syntax error in cmake code at
CMakeLists.txt:6
when parsing string
${$}
syntax error, unexpected $, expecting } (4)
-- Configuring incomplete, errors occurred!