且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

奇怪的函数参数名称行为

更新时间:2022-06-12 08:59:57

不幸的是,CMake的语言非常原始。在这种情况下,局部变量的命名可能会与外部作用域中具有相同名称的变量进行交互。

Unfortunately, the language of CMake is extremely primitive. In this case, the naming of local variables may interact with variables with the same name in outer scopes.

具体地,在两个调用中, $ { $ {name}} 扩展为 $ {name} $ {anothername} ,分别。在前一个 name 中,是使用其值的局部变量的名称。在后者中,使用外部作用域中的别名

Concretely, in the two calls ${${name}} expands to ${name} and ${anothername}, respectively. In the former name is the name of a local variable whose value is used. In the latter, the anothername from the outer scope is used.

我不知道

也许我们应该申请 $ {name:PARENT_SCOPE} 团队的code>?