Does the “@” symbol have a special meaning when surrounding a CMake variable?

别说谁变了你拦得住时间么 提交于 2020-07-30 07:26:46

问题


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@")

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.


回答1:


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.

Outside of configure_file / string(CONFIGURE) symbol @ has no special meaning in CMake.



来源:https://stackoverflow.com/questions/35152152/does-the-symbol-have-a-special-meaning-when-surrounding-a-cmake-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!