[CMake] Turning a string into a list.

Sylvain Benner benner at virtools.com
Thu Oct 11 09:14:42 EDT 2007


> Try SEPARATE_ARGUMENTS.
>
> SET(Q "one;two;three")
> SEPARATE_ARGUMENTS(Q)
> FOREACH(I ${Q})
>   MESSAGE("I = ${I}")
> ENDFOREACH(I)
>

SEPARATE_ARGUMENTS do the opposite, it converts a string to a list by 
replacing spaces with ";"
In the case of Josef, nothing needs to be done since its string has 
already the format of a list.

--Sylvain


More information about the CMake mailing list