Reapply working parts of CMake cleanup.

This patch adds the working parts of r243503. The difference with this patch
is that it doesn't include the HandleLLVMOptions.cmake file.

llvm-svn: 243698
9 files changed