cmake: patch that fixes scoping issue by re-declaring the variable in the parent scope.