Brad King wrote: > On 09/12/2012 02:06 PM, Rolf Eike Beer wrote: > > I was looking at http://www.cmake.org/Wiki/CMake_Useful_Variables and > > while > > scanning through it I once again saw how many variables we have for the > > different MSVC versions. Since it's unlikely that MSVC11 is the last (the > > variable is currently missing, but I'll fix that soon) I thought if it > > wouldn't be enough to just introduce a MSVC_VERSION variable. Setting this > > to 6.0 or 7.1 or 11 is easy, and checking it is easy since we have > > VERSION_LESS and friends. Checking for something like "MSVC >= 9.0" is > > currently a pain if one does not want to fall back to the CL_VERSION, > > which is not obvious as those versions are of a totally different range > > and one must always comment on what is checked there. > > > > Patch for this should be trivial. Any opinions? > > There is a MSVC_VERSION variable already. > > Furthermore, since the ide-compiler-id topic was merged recently the > CMAKE_(C|CXX)_COMPILER_VERSION variables are set.
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? 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) And from all what I know the CMAKE_CXX_COMPILER_VERSION variable would also return 1400 in that case. (Another variable missing on the Wiki) Eike --
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers