Pull in commit 4c995863 to keep in sync with cmake-cleanup-projectfiles branch