[CMake] How do I generate a preprocessed file?

Tyler Roscoe tyler at cryptio.net
Sun May 10 13:32:03 EDT 2009


On Sun, May 10, 2009 at 06:38:28PM +0200, Piotr Wyderski wrote:
> Yes, a lot of them: include directories specification,
> optimization flags (they also work as -D directives,
> e.g. they define __SSE2__ or not), language error
> handling mode (e.g. --Wno-pmf-conversion) etc.
> In fact I need the entire command line with option -E
> attached at the end. I would be happy to grab it from
> any C++-dependent object file (as they all use the
> same set of options).

Maybe you could make a fake library or executable that includes all your
headers, and which has -E in the compiler flags? Not sure if this would
work, since it appears there is no way to disable linking (I asked about
this a couple weeks ago).

I'm not sure what else to tell you. I guess you have to cobble all the
compiler flags together from their different variables/properties. Maybe
one of the smarter cmakers has an idea.

tyler


More information about the CMake mailing list