I'm trying to understand the discrepancy between the compiler version reported by Visual C++ and the compiler version reported by CMake.
I've posted a question on Stack Overflow  but since I didn't get a satisfactory answer yet, I figured I would dig into CMake's sources to figure it out myself. After an hour of grepping the source code, I'm still puzzled so I figured I would ask directly here.
FWIW, I'm using Visual Studio Enterprise 2017 version 15.3.0 and CMake version 3.8.1.
When I run
cmake -G "Visual Studio 11 2012 Win64" .
-- The C compiler identification is MSVC 17.0.60610.1
-- The CXX compiler identification is MSVC 17.0.60610.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/x86_amd64/cl.exe -- works
i.e. the compiler version is 17.0.60610.1. But when I run
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\cl.exe
I instead get:
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x64
i.e. the compiler version is 17.00.50727.1. I'm assuming this is the correct version number, and I'm now wondering why CMake reports a different one.