Maybe you could use this? http://build.nimrod-code.org/docs/macros.html#138