[cmake-developers] The MSVC** version variables

Brad King brad.king at kitware.com
Wed Sep 12 14:20:35 EDT 2012


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.

-Brad



More information about the cmake-developers mailing list