MantisBT - CMake
View Issue Details
0014392CMakeCMakepublic2013-09-07 00:302014-03-05 09:58
BryanM 
 
normalminoralways
closedno change required 
PCWindowsWindows 7
CMake 2.8.10.2 
 
0014392: Multiple Versions of Visual Studio causing problems with configure
Visual Studio 2010 and 2012 are both installed on this machine.
Selected Generator: Visual Studio 11 Win 64

On first configure CMake detects MSVC_VERSION = 1700 and MSVC11 = 1, on subsequent configures (with no changes made at all)MSVC_VERSION = 1600.
I have Visual Studio 2010 and 2012 installed on this machine. CMake seems to be having trouble with this (I assume), as i have a case where the values of MSVC_VERSION will change for no reason with a configure.
To help debug this issue I have the following prints in my CMakeLists.txt

if(DEFINED MSVC11)
    message("MSVC11 = ${MSVC11}")
endif()

if(DEFINED MSVC_VERSION)
    message("MSVC_VERSION = ${MSVC_VERSION}")
endif()

To start with a fresh config I delete the cache, then click configure. I get prompted to select the generator for the project at which I select "Visual Studio 11 Win 64" and "Use default native compilers".

On this first run, my prints output the following
MSVC11 = 1
MSVC_VERSION = 1700

I then click configure again. This time, my prints change.
MSVC_VERSION = 1600

Subsequent configures all list MSVC_VERSION = 1600.

As I selected a generator for VisualStudio 11 and it detectes 11, I would expect this MSVC_VERSION to reamin 1700, rather than change to 1600 on all but the first configure calls.
No tags attached.
Issue History
2013-09-07 00:30BryanMNew Issue
2013-09-09 10:33Brad KingNote Added: 0033791
2013-09-11 22:50BryanMNote Added: 0033805
2013-09-12 08:27Brad KingNote Added: 0033807
2013-09-12 08:27Brad KingStatusnew => resolved
2013-09-12 08:27Brad KingResolutionopen => no change required
2014-03-05 09:58Robert MaynardNote Added: 0035255
2014-03-05 09:58Robert MaynardStatusresolved => closed

Notes
(0033791)
Brad King   
2013-09-09 10:33   
I have VS 6, 7.1, 8, 9, 10, 11 and the 12 preview on one machine. They all work together and with CMake. Make sure you don't allow any of the versions to set the environment (PATH, INCLUDE, LIB) globally.

Also please try the latest release, 2.8.11.2, or even better the 2.8.12 release candidates:

 http://www.cmake.org/files/v2.8/?C=M;O=D [^]
(0033805)
BryanM   
2013-09-11 22:50   
Thanks for the response Brad,
I downloaded 2.8.12-rc3 and re-ran the same case which had be given me trouble... worked fine! I'm happy to get rid of my temp work around of assuming a version and not checking. Not sure what the problem was, but it seems that 2.8.12-rc3 fixes it.

I would mark this as fixed if I could (If i can and am missing how, sorry).
(0033807)
Brad King   
2013-09-12 08:27   
Okay, thanks for reporting back.
(0035255)
Robert Maynard   
2014-03-05 09:58   
Closing resolved issues that have not been updated in more than 4 months