[CMake] Turning a string into a list.
James Bigler
bigler at cs.utah.edu
Thu Oct 11 09:15:12 EDT 2007
> On Oct 11, 2007, at 6:42 AM, Josef Karthauser wrote:
>
>> Does anyone know how to turn a string, such as "one;two;three" into a
>> list, so that I can enumerate the elements in a list?
>>
>> I want something like:
>>
>> SET(Q "one;two;three")
>> FOREACH(I TO_LIST(Q))
>> ...
>> ENDFOREACH().
>>
>> Thanks,
>> Joe
On Oct 11, 2007, at 7:12 AM, James Bigler wrote:
> Try SEPARATE_ARGUMENTS.
>
> SET(Q "one;two;three")
> SEPARATE_ARGUMENTS(Q)
> FOREACH(I ${Q})
> MESSAGE("I = ${I}")
> ENDFOREACH(I)
Yeah, I just realized you don't need SEPARATE_ARGUMENTS, too.
James
More information about the CMake
mailing list