Explorar el Código

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 hace 13 años
padre
commit
674c56c3fc
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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."