On 08/19/2012 08:09 AM, Rolf Eike Beer wrote:
> I'm wondering if it makes sense to do a mass replace of
> 
> foreach(listvar ${somevar})
> 
> to
> 
> foreach(listvar IN LISTS somevar)
> 
> From what I see this should be more efficient as the variable is not first 
> expanded and then parsed again, it could save from potential trouble if e.g. 
> somevar includes elements with spaces, and it should not introduce any 
> further 
> hassle.

The main difference in behavior is when the list contains empty elements.
The former will remove them.  The latter will include them.

Try running some timings in isolated test cases to see if there is really
much difference in efficiency.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to