[CMake] How do I generate a preprocessed file?

Tyler Roscoe tyler at cryptio.net
Sun May 10 12:10:23 EDT 2009


On Sun, May 10, 2009 at 12:00:11PM +0200, Piotr Wyderski wrote:
> I've chceked those variables, but they provide not
> a very useful part of the command line, for example
> CMAKE_CXX_FLAGS_RELEASE gives me only
> -O3 -DNDEBUG.
> 
> It is a very promising direction indeed, however
> after some hacking all I have from GET_TARGET_PROPERTY(_x ... COMPILE_FLAGS)
> is NOTFOUND :-/

I haven't used get_target_property() to discover compile flags, so I
don't know what's going on there.

Thinking about this more, is there anything handed off to the compiler
that affects the preprocessor other than definitions (-D flags)? You can
get those via the property COMPILE_DEFINITIONS (or, if your CMakeLists
looks like mine, you already have those in a ${foo_DEFINITIONS}
variable). What other flags do you really need?

tyler


More information about the CMake mailing list