[CMake] Turning a string into a list.

Josef Karthauser joe.karthauser at geomerics.com
Thu Oct 11 08:45:40 EDT 2007


> 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 string:

 	SET(Q "one;two;three")
 	FOREACH(I ${Q})
 		...
 	ENDFOREACH().
 
Sorry for the noise.
Joe


More information about the CMake mailing list