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.
This commit is contained in:
Brad King 2012-07-11 10:40:04 -04:00
parent 6274ca6f91
commit 674c56c3fc
1 changed files with 1 additions and 0 deletions

View File

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