[Cmake] how to detect a macro

John Biddiscombe john.biddiscombe@mirada-solutions.com
Thu, 15 May 2003 08:50:20 +0100


If one does

MACRO(MyMacro p1 p2 p3)
  do stuff here
ENDMACRO(MyMacro)

...

later I want to do

IF (MyMacro)
  MyMAcro("1" "2" "3")
ENDIF (MyMacro)

But it never executes because IF(macroname) always returns false. I need =
to put a macro in an INCLUDE(OPTIONAL) file, and conditionally execute =
it in another.

Is there a way to detect it's presence (apart from the slightly Klunky
 SET(MYMACROPRESENT 1)
in the optional file

and=20
IF (MYMACROPRESENT)
  MyMAcro("1" "2" "3")
ENDIF (MYMACROPRESENT)

thanks

JB