[CMake] Call a macro through a variable. Possible or not?

Marcel Loose loose at astron.nl
Thu Mar 5 07:19:34 EST 2009


Hi,

I was wondering whether it's possible to invoke a macro through a
variable. The variable contains a command (or list of commands) to be
invoked.

For example:

macro(do_it)
  message(STATUS "do_it")
endmacro(do_it)

set(cmd do_it)
${cmd}()      # <-- This doesn't work, but is there a way to do this?

Best regards,
Marcel Loose




More information about the CMake mailing list