[CMake] Expansion of variables

Axel Wachtler axel.wachtler at gmx.de
Wed Jun 8 15:11:36 EDT 2005


Hallo all,

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

If I ommit the quotation, the assembler expands correctly
but the C compiler gets a command line, like this
-this;--that;--someother;-many;-more;--of;-this;-nasty;-settings

Is there a possibility to workaround this quotation issue ?

Thanks for any help, Axel

-- 
------------------------------------------------------------------
Axel Wachtler
Mail:        axel.wachtler at gmx.de
Fingerprint: FA2C 4FB1 AC18 5FA3 F4F1 1114 3F38 E0DF 8C3A DC95
Public Key:  http://www.keyserver.net
------------------------------------------------------------------
¿Tiene usted problemas con alcohol? - ¡No, tengo las sin alcohol!




More information about the CMake mailing list