[CMake] Re: Calling a dynamically created macro

Brandon Van Every bvanevery at gmail.com
Wed Dec 19 18:53:33 EST 2007


On Dec 19, 2007 6:04 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
> On Dec 19, 2007 12:47 PM, Rodolfo Schulz de Lima <rodolfo at rodsoft.org> wrote:
> > Brandon Van Every escreveu:
> >
> > > You could use a macro to generate a CMake script containing a macro,
> > > and then call that script.  :-)
> >
> > Nice... :)
>
> In fact, it turns out you can use an include() to cause it to exist at
> the point you create the macro.  A downside is the number of escapes
> you have to put into your meta-macro, such as \\\${myvar}.

If you don't need to invent arbitrarily complicated macros on the fly,
but just want to substitute some hardcoded values like the macro name,
running configure_file on a "template" macro file might be more
convenient.  You wouldn't need funky escapes in a pre-written template
macro file.


Cheers,
Brandon Van Every


More information about the CMake mailing list