浏览代码

if: Document that macro arguments are not variables (#13393)

A common mistake is to write

 macro(foo arg)
   if(arg)
   endif()
 endmacro()

and expect if() to treat "arg" as a variable.  The documentation of the
macro() command already states that arguments are not variables, but
users writing the if() command may not look at the macro() docs.
Add a note to the if() documentation.
Brad King 13 年之前
父节点
当前提交
674c56c3fc
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Source/cmIfCommand.h

+ 1 - 0
Source/cmIfCommand.h

@@ -123,6 +123,7 @@ public:
       "  if(<variable>)\n"
       "True if the variable is defined to a value that is not a false "
       "constant.  False otherwise.  "
+      "(Note macro arguments are not variables.)"
       "\n"
       "  if(NOT <expression>)\n"
       "True if the expression is not true."