MantisBT - CMake
View Issue Details
0010087CMakeCMakepublic2009-12-30 18:182010-12-14 17:36
Mateusz Loskot 
David Cole 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.3 
0010087: MSVC_VERSION is not set for Visual Studio 2010 (1600)
I'm trying to use MSVC_VERSION variable and it looks like it is not being set for Visual Studio 2010. Here is simple test I do to check what variables are being set:

MESSAGE(STATUS "MSVC=${MSVC}")
MESSAGE(STATUS "MSVC80=${MSVC80}")
MESSAGE(STATUS "MSVC90=${MSVC90}")
MESSAGE(STATUS "MSVC10=${MSVC10}")
MESSAGE(STATUS "MSVC_VERSION=${MSVC_VERSION}")

which outputs:

MSVC=1
MSVC80=
MSVC90=
MSVC10=1
MSVC_VERSION=

I use CMake 2.8 on Windows 7 (64-bit). I call configure and generate using cmake-gui.
1) Here output I get to build\CMakeFiles\CMakeCXXPlatform.cmake file of my project:

SET(CMAKE_VC_COMPILER_TESTS_RUN 1)
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE )
SET(CMAKE_COMPILER_2005 )
SET(CMAKE_USING_VC_FREE_TOOLS )
SET(CMAKE_CL_64 )
SET(MSVC60 )
SET(MSVC70 )
SET(MSVC71 )
SET(MSVC80 )
SET(MSVC90 )
SET(MSVC_IDE 1)
SET(MSVC_VERSION )
SET(WIN32 1)
2010, msvc10, visual studio
related to 0007944closed Brad King MSVC_VERSION is not set for Visual Studio 6 
Issue History
2009-12-30 18:18Mateusz LoskotNew Issue
2009-12-30 18:20Mateusz LoskotTag Attached: 2010
2009-12-30 18:20Mateusz LoskotTag Attached: msvc10
2009-12-30 18:20Mateusz LoskotTag Attached: visual studio
2009-12-30 18:21Mateusz LoskotNote Added: 0019017
2010-05-17 04:48Rolf Eike BeerNote Added: 0020756
2010-12-14 17:34David ColeRelationship addedrelated to 0007944
2010-12-14 17:35David ColeAssigned To => David Cole
2010-12-14 17:35David ColeStatusnew => assigned
2010-12-14 17:36David ColeNote Added: 0023987
2010-12-14 17:36David ColeStatusassigned => closed
2010-12-14 17:36David ColeResolutionopen => fixed
2010-12-14 17:36David ColeFixed in Version => CMake 2.8.3

Notes
(0019017)
Mateusz Loskot   
2009-12-30 18:21   
This issue is similar to ID:0007944 - MSVC_VERSION is not set for Visual Studio 6
(0020756)
Rolf Eike Beer   
2010-05-17 04:48   
I can't reproduce this, can you try running CMake from command line (make sure you are in a compiler shell) and post your exact command line you used?
(0023987)
David Cole   
2010-12-14 17:36   
This works in CMake 2.8.3. I get "1600" for MSVC_VERSION when I build with the Visual Studio 2010 generator.

Please open a new bug with steps to reproduce if there is still a problem on your end...