MantisBT - CMake
View Issue Details
0015698CMake(No Category)public2015-08-16 03:122016-06-10 14:31
Brandon Van Every 
Kitware Robot 
normalminoralways
closedmoved 
Windowsall
CMake 3.3.1 
 
0015698: default generator does not match compiler or native bit length
I recently installed a totally clean Windows 10 Pro 64-bit system on one of my laptops. I added Visual Studio 2015 Community Edition and then CMake 3.3.1. I went to build Urho3D. I clicked on the default generator "Visual Studio 14 2015" because it seemed correct. I wasn't in the habit of ever needing to select anything from the submenu, as if I ever selected anything, it was done long ago and stored in the CMake registry entries.

I got a 32-bit build on a 64-bit machine. I proceeded to tear my hair out for 2 hours as to why this was so. It was true of every CMake-based project I tried, not just Urho3D. By looking at other machines I eventually figured out that the CMake version was different, and that the correct, non-default generator is "Visual Studio 14 2015 Win64".

I think it should have given me, by default, the only compiler that was actually installed on my system. It also shouldn't have offered a 32-bit default generator on a 64-bit system, even if it couldn't know what compiler I wanted for some reason.

I hadn't had this problem on my Windows 7 "primary development" machine, which has Visual Studio 2013 Community Edition. It always gave me the correct 64-bit generator. However CMake was remembering a choice of mine from long ago, that I had long since forgotten I had made. To prove this, I uninstalled CMake 3.3.1. I opened regedit and deleted everything under HKEY_CURRENT_USER/Software/Kitware so that no trace of my previous actions would remain. Then I reinstalled and configured Urho3D using cmake-gui. I was quite surprised to be offered "Visual Studio 14 2015" as the default. Visual Studio 2015 is not installed on the system, only 2013. It's a 64-bit system, not 32-bit. The default is not appropriate.

I think offering appropriate defaults is less likely to frustrate (1) new CMake users, (2) experienced CMake users who have forgotten that values are lurking in the registry. Particularly because the generators have very similar sounding names.

If multiple compilers are installed on the system, it would be appropriate to guess the most likely one first. i.e. most recent version of VS, if more than 1 is installed. VS before MinGW-64. MinGW-64 before MinGW32. MinGW before Cygwin. Cygwin before anything truly obscure or weird.
No tags attached.
Issue History
2015-08-16 03:12Brandon Van EveryNew Issue
2016-06-10 14:29Kitware RobotNote Added: 0042823
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042823)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.