CMake 3.x adds the notion of "simulated compilers" [1, 2]. CMAKE_CXX_COMPILER_ID will still report the actual compiler you're using, but it will set additional variables CMAKE_CXX_SIMULATE_ID and CMAKE_CXX_SIMULATE_VERSION. So, for example, if you set CC and CXX to clang-cl and run CMake while MSVC in your path (for example you've run vcvarsall), then CMAKE_CXX_SIMULATE_ID will get set to "MSVC", and CMAKE_CXX_SIMULATE_VERSION will get set to the value of -fms-compatibility-version.
With this patch and one more patch on the clang side to get -fms-compatibility-version to default to 18.00 instead of 17.00, I was able to compile with clang-cl with the following CMake invocation:
set CC=clang-cl.exe
set CXX=clang-cl.exe
cmake -G Ninja ..\..\llvm
I need to test this more exhaustively, and with CMake 2.8. I know CMake 2.8 doesn't support this, but I want to make sure it doesn't completely break the build. I also haven't completed a full build and run the test suite. But I was able to get ninja to [100/3000] with no major blowups before I stopped due to clang being so slow (I had installed a debug build). So this is promising, and I want to throw it up for discussion.
[1] http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51ab85c3
[2] http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d8356d4