[CMake] Default Generator to use

Eric Noulard eric.noulard at gmail.com
Tue Feb 7 03:06:14 EST 2012


2012/2/7 Sarnath K - ERS, HCLTech <k_sarnath at hcl.com>:
> Hello Friends,
>
> How do I specify the default generator that CMAKE should use when invoked
> without the “-G” option?
>
> I am on Windows.
>
> I saw an old thread on this. But I am not sure if any support was added
> later on.
>
>
> Is there a REGISTRY entry in Windows that we can set to make so that CMAKE
> can check it?

When starting with an empty build tree (or more precisely with empty cache)
the logic of the "default generator" is implement in:

Source/cmake.cxx::int cmake::ActualConfigure()

There is some system dependent macro logic and in
the Windows case the code comment says
(if not in Borland or Cygwin or Mingw case):
// Try to find the newest VS installed on the computer and
// use that as a default if -G is not specified

So no, as far as I understand the code,
there is no registry entry that could possibly be set to force a
particular default.

I guess it shouldn't be that hard to implement but it is not there.
(I'm not willing to try myself because I'm not a Windows user/developer)

Nevertheless, may be you can explain us why you would like to setup a default?
Is it too painful to add the extra -G argument?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list