[CMake] Expansion of variables

Brad King brad.king at kitware.com
Wed Jun 8 15:09:50 EDT 2005


Axel Wachtler wrote:
> I use cmake together with a embedded compiler/assembler, which has
> very looooong and verbose Flag settings. (I use cmake 2.0.5, Unix 
> Makefiles)
> 
> So I need to split it up, to keep it maintainable:
> 
> SET(CC_CPU_FLAGS "-this --that --someother" )
> SET(CC_OPT_FLAGS "-many -more --of -this -nasty -settings" )
> SET(CMAKE_C_FLAGS "${CC_CPU_FLAGS} ${CC_OPT_FLAGS}")
> 
> For the assembler I use a macro as recommended. The
> Problem is that the MACRO() expands ${CMAKE_C_FLAGS} different
> from ADD_LIBRARY() for compiling the C files.
> 
> For C compiler the expansion is correct:
> -this --that --someother -many -more --of -this -nasty -settings
> 
> In the MACRO() I get
> -this\ --that\ --someother\ -many\ -more\ --of\ -this\ -nasty\ -settings

What is the definition of the macro?

-Brad


More information about the CMake mailing list