Re: [CMake] addprefix macro?

2010-05-05 Thread Marc Weber
> foreach(l IN LISTS ${list_name}) I got that lesson now - Thanks to you all. Everything works as expected. Marc Weber ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please

Re: [CMake] addprefix macro?

2010-05-05 Thread Michael Wild
On 5. May, 2010, at 16:29 , Benoit Thomas wrote: > On 2010-05-05 10:22, Michael Wild wrote: >> # prefix and suffix elements >> > foreach(l ${list_name}) >> >list(APPEND ${list_name}_TMP ${prefix}${l}${suffix} ) >> > endforeach() >> > You also have an error in your foreach, i

Re: [CMake] addprefix macro?

2010-05-05 Thread Benoit Thomas
On 2010-05-05 10:22, Michael Wild wrote: # prefix and suffix elements > foreach(l ${list_name}) >list(APPEND ${list_name}_TMP ${prefix}${l}${suffix} ) > endforeach() You also have an error in your foreach, it should be: foreach(l ${${list_name}}) -- Ben. ___

Re: [CMake] addprefix macro?

2010-05-05 Thread Michael Wild
On 5. May, 2010, at 16:14 , Marc Weber wrote: > Hi, I'm new to cmake. > > I asked at #cmake how to prefix a string to a list of paths. > I got the reply that I should use a foreach loop which worked. > > Can I abstract this pattern using a macro such as this? > > > # prefix and suffix each e

[CMake] addprefix macro?

2010-05-05 Thread Marc Weber
Hi, I'm new to cmake. I asked at #cmake how to prefix a string to a list of paths. I got the reply that I should use a foreach loop which worked. Can I abstract this pattern using a macro such as this? # prefix and suffix each element of list by ${prefix}elemnt${suffix} macro(PREFIXSUFFIX l