CMake: Modified foreach() loop to be compatible with CMake 2.6.
Merge branch 'master' into devel