“ @”是否符号在包围CMake变量时有特殊含义吗? [英] Does the "@" symbol have a special meaning when surrounding a CMake variable?
问题描述
在浏览 ITK 源代码时,我遇到了许多文件,例如此,其后缀为 .cmake.in
并定义了多个变量(字符串?),其值与变量名相同,但带有 @
符号前置/附加。例如:
While looking through the ITK source code I've come across a number of files like this, which have the suffix .cmake.in
and which define a number of variables (strings?), where the value is identical to the variable name, but with @
symbols prepended/appended. For example:
set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@")
这些声明的目的是什么?在这种情况下, @
符号是否有特殊含义?我尝试在 CMake语言语法Wiki 中进行搜索,但是没有出现 @
。
What is the purpose of these declarations? Does the @
symbol have a special meaning in this context? I tried searching for this in the CMake Language Syntax Wiki, but there were no occurrences of @
on the page.
推荐答案
后缀为的文件。
中的命令通常用于通过命令 configure_file 。此类文件中的所有 @NAME @
序列都转换为变量 NAME
的值。
Files with suffix .in
are usually intended for configuration via command configure_file. All sequences @NAME@
within such files are translated to value of variable NAME
.
configure_file
/ string(CONFIGURE)
之外的符号 @
在CMake中没有特殊含义。
Outside of configure_file
/ string(CONFIGURE)
symbol @
has no special meaning in CMake.
这篇关于“ @”是否符号在包围CMake变量时有特殊含义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!