问题
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