[cmake-developers] The MSVC** version variables

Rolf Eike Beer eike at sf-mail.de
Wed Sep 12 15:09:07 EDT 2012


Brad King wrote:
> On 09/12/2012 02:33 PM, Rolf Eike Beer wrote:
> > Ah, hm. Ok, this is the compiler version variable that I knew it would
> > exist but did not know how it was named. So this demonstrates exactly
> > what I was talking about:
> > 
> > if (MSVC_VERSION VERSION_GREATER 1400)
> > 
> > Without looking in the docs, which MSVC version am I talking about?
> 
> Always subtract 6 from the "cl" version number to get the IDE version.
> This is just a standard VS thing and is not CMake-specific.

I have not said that. But as I did not know until 5 minutes ago someone else 
scanning a CMake file may also not know. So you always need to add a comment.

> > I would
> > propose to name it MSVC_IDE_VERSION then, so this would make it clear to
> > everyone:
> > 
> > if (MSVC_IDE_VERSION VERSION_GREATER 8.0)
> 
> Starting with VS 2010 the projects support specifying the toolchain
> from a different version of VS.  Now that ide-compiler-id is done we
> can possibly add support for selecting the compiler in the future.
> Therefore the IDE version can be associated only with the IDE
> generators, and we already have that from the generator name in
> CMAKE_GENERATOR.

Do a selection of "MSVC >= 9.0" based on the generator string in one line here 
please:

1.

:)

Ok, if you don't like the idea, I really don't care about MSVC that much 
anymore. But I wonder why then another MSVCnn variable is introduced for every 
new version of that thing.

> > And from all what I know the CMAKE_CXX_COMPILER_VERSION variable would
> > also
> > return 1400 in that case.
> 
> It would be 14.0.$build or so.  It's the "cl" tool version.

Yes, sure. I just have no MSVC around to check ;)

> > (Another variable missing on the Wiki)
> 
> The Wiki pre-dates the variables section of the reference documentation.
> Is it really needed anymore?  Now it just duplicates information.

In that case I think bug 12567 should be fixed, the wiki page should be 
cleared and provide just a link to the generated documentation.

I wonder if the CYGWIN and WIN32 variables should then get a hint that their 
behavior changed and which policy was introduced for that.

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120912/5d3b3d1b/attachment.sig>


More information about the cmake-developers mailing list