[CMake] Why are blank-delimited strings in commands escaped on Linux?

Hendrik Sattler post at hendrik-sattler.de
Fri Oct 2 08:45:19 EDT 2009


Zitat von Claudio Bley <b_l_e_y at ml1.net>:
>> But I think that his example is wrong, it should be:
>> set(a "-Lfoo -lbar")
>> message(STATUS "a = ${a}")
>> set(a_list ${a})
>> message(STATUS "a_list = ${a_list}")
>>
>> Then the result should be
>>  -- a = -Lfoo -lbar
>>  -- a_list = -Lfoo;-lbar
>
> No, should it not. How should that be possible? ${a} is not a list, it's
> a string (ie. it does not contain semi colons).
>
> The output is:
>
> ,----
> | -- a = -Lfoo -lbar
> | -- a_list = -Lfoo -lbar
> `----

Then explain the detailed difference between the following three:
   set(a_list -Lfoo -lbar) -> creates a list with "-Lfoo" and "-lbar"
   set(a_list ${a}) -> ???
   set(a_list "${a}") -> ???

HS




More information about the CMake mailing list