RE: [CMake] Turning a string into a list.

2007-10-11 Thread Josef Karthauser
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(). Ah, ignore me. Of course I just expand the

Re: [CMake] Turning a string into a list.

2007-10-11 Thread James Bigler
Try SEPARATE_ARGUMENTS. SET(Q one;two;three) SEPARATE_ARGUMENTS(Q) FOREACH(I ${Q}) MESSAGE(I = ${I}) ENDFOREACH(I) 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?

Re: [CMake] Turning a string into a list.

2007-10-11 Thread James Bigler
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)) ...

Re: [CMake] Turning a string into a list.

2007-10-11 Thread Sylvain Benner
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