cmake: Backport newer 2.8.12 version from oe-core/master

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>