MantisBT - CMake
View Issue Details
0010473CMakeCMakepublic2010-03-27 13:532016-06-10 14:31
rubenvb 
Bill Hoffman 
normaltweakalways
closedmoved 
CMake-2-8 
 
0010473: Default generator on Windows
It would be handy for CMake not to default to the highest MSVC installed when run on Windows. Better would be:
a) check CMAKE_GENERATOR environment variable for which one to use. This should be quite easy and can still default to the newest MSVC version, but this should be checked first.
b) find available compilers at runtime (ie when running CMake) and let the user select the one he wants from a list. This would be a performance hit and not preferred

This would allow those few people using either more than one compiler or mingw(-w64/w32) to just run "cmake .." and (g/mingw32-)make without the need for -G"MinGW Makefiles". It shouldn't be too hard to implement and would simplify working with CMake a lot.
patch
patch cmake_default_generator.patch (709) 2012-06-16 10:31
https://public.kitware.com/Bug/file/4357/cmake_default_generator.patch
patch cmake_default_generator_new.patch (656) 2012-06-29 13:23
https://public.kitware.com/Bug/file/4373/cmake_default_generator_new.patch
Issue History
2010-03-27 13:53rubenvbNew Issue
2011-01-06 16:30Bill HoffmanNote Added: 0024485
2011-01-06 16:30Bill HoffmanAssigned To => Bill Hoffman
2011-01-06 16:30Bill HoffmanStatusnew => assigned
2012-06-16 10:31criptychFile Added: cmake_default_generator.patch
2012-06-16 10:35criptychNote Added: 0029709
2012-06-16 12:34criptychTag Attached: patch
2012-06-28 18:09criptychNote Added: 0029862
2012-06-29 09:33Bill HoffmanNote Added: 0029863
2012-06-29 13:23criptychFile Added: cmake_default_generator_new.patch
2012-06-29 13:28criptychNote Added: 0029865
2014-08-08 10:11criptychNote Added: 0036582
2016-06-10 14:27Kitware RobotNote Added: 0041673
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0024485)
Bill Hoffman   
2011-01-06 16:30   
A patch would be welcome for this.
(0029709)
criptych   
2012-06-16 10:35   
The attached patch modifies cmake::ActualConfigure so that when configuring a new project it will check the environment variable CMAKE_DEFAULT_GENERATOR before trying platform-specific generators.
(0029862)
criptych   
2012-06-28 18:09   
I realize there are more pressing concerns, but is it possible to get some kind of an acknowledgement even if the patch as-is can't be merged yet?
(0029863)
Bill Hoffman   
2012-06-29 09:33   
It should use the getenv wrapper in cmSystemTools:
  static const char* GetEnv(const char* key);


cmSystemTools::GetEnv("CMAKE_DEFAULT_GENERATOR")
(0029865)
criptych   
2012-06-29 13:28   
Thanks for your response. I didn't mean to sound impatient, it's just that this is a feature I'd been interested in myself, and it seemed like a simple fix. :)

I've attached a patch which uses the new name, and cleaned up the code a bit.
(0036582)
criptych   
2014-08-08 10:11   
Has there been any further consideration on this?
(0041673)
Kitware Robot   
2016-06-10 14:27   
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.