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

Claudio Bley b_l_e_y at ml1.net
Fri Oct 2 06:35:28 EDT 2009


Hi. 

"Alan W. Irwin"
<irwin at beluga.phys.uvic.ca> writes:

> On 2009-10-02 08:58+0200 Hendrik Sattler wrote:
>
>> Zitat von "Alan W. Irwin" <irwin at beluga.phys.uvic.ca>:
>>> [Use]
>>> string(REGEX REPLACE " " ";" CAIRO_LINK_FLAGS_LIST "${CAIRO_LINK_FLAGS}")
>>> [to convert a blank-delimited string to a list].
>>
>> Doing this REGEX REPLACE cannot be the recommended way as that
>> breaks any paths that contain spaces. Doesn't
>> set(CAIRO_LINK_FLAGS_LIST ${CAIRO_LINK_FLAGS})
>> also make this a list but honors a possible quoting and escaping?
>> (Note: no extra quoting in the above line).
>
> Hi Hendrik:
>
> I can never figure out such things 100 per cent from documentation.  Instead
> I try a simple test such as
>
> set(a "hello world\\ hello world")
> message(STATUS "a = ${a}")
> set(a_list ${a})
> message(STATUS "a_list = ${a_list}")
>
> The result is
>
> -- a = hello world\ hello world
> -- a_list = hello world\ hello world

So, the real issue here is that your CAIRO_LINK_FLAGS variable just
contains a single string, where it should contain a list instead.

You should fix that in your OCaml /PLplot module.

Regards,
Claudio



More information about the CMake mailing list