[CMake] Possible bug in cmake version 2.4-patch 6 with
macroargument testing
Trevor Kellaway
tkellaway at asl-electronics.co.uk
Tue May 29 11:39:19 EDT 2007
Ken,
> A macro in cmake is a bit like a cpp macro. It is a string
> replacement operation that replaces ${varname} with the
> actual argument to the macro.
> [...]
> After string replacement of ${boolarg} with TRUE looks like
>
> MACRO (MYMACRO boolarg)
> MESSAGE ("MYMACRO(TRUE)")
> IF (boolarg)
>
> The IF statement tests to see if there is a variable defined
> named boolarg and there is not (there have been no SETS done
> on boolarg) and so the conditional is false. So the trick is
> that macros need to be thought of as only doing string
> replacements on ${something}.
Thanks, this makes perfect sense, and I understand you not wanting to
change this behaviour.
- TrevK
More information about the CMake
mailing list