Merged CMake related updates from master.