MSVC compiler identification with CMake

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MSVC compiler identification with CMake

François Beaune
Hello,

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 [1] 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" .

I get:

    -- 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.

Any idea?

Best,
Franz


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake