Juan Sanchez wrote:
I would argue that the following snippet of code should either print
"CAT" twice or die. Unfortunately it first prints "DOG" and then "CAT".
Thanks,
Juan
MACRO(FOO BAR)
SET (BAR "CAT")
MESSAGE("${BAR}")
ENDMACRO(FOO)
FOO(DOG)
MESSAGE("${BAR}")
So, expand the macro and you get:
SET(BAR "CAT") # text in a macro is just text, BAR is just more text
MESSAGE("DOG") # ${BAR} is replaced by DOG sort of like a cpp macro
MESSAGE(${BAR}) # now we print BAR which was set to CAT in the macro
-Bill
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake