[Cmake] how to detect a macro

John Biddiscombe john.biddiscombe at mirada-solutions.com
Thu May 15 04:16:06 EDT 2003


OK ignore this question, I like the (Klunky) version after all. It allows better control when doing this in several subdirs (I think)

> IF (MYMACROPRESENT)
>   MyMacro("1" "2" "3")
> ENDIF (MYMACROPRESENT)

JB


> -----Original Message-----
> From: John Biddiscombe 
> Sent: 15 May 2003 08:50
> To: cmake at public.kitware.com
> Subject: [Cmake] how to detect a macro
> 
> 
> 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 
> IF (MYMACROPRESENT)
>   MyMAcro("1" "2" "3")
> ENDIF (MYMACROPRESENT)
> 
> thanks
> 
> JB
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake
> 



More information about the CMake mailing list