cmake: patch that fixes scoping issue by re-declaring the variable in the parent scope.
Merge branch 'master' into next