Macro for Visual Studio version
I am using the command line to automate a few开发者_运维问答 things in my project. I am using a lot of macros, for example $(PlatformName) - gives me Win32 or Win64
, which help me write commands for all configuration types. I am wondering if there is a similar macro that I can use for the current version of Visual Studio, for example one that will return VS2008
or VS2010
.
It doesn't look like it. Here is a list of available macros. That's no guarantee there aren't other ways to detect the VC version in use, however; one option might be to work it out from the VCinstalldir by exploring subdirectories. Like any buildsystem activity this rapidly becomes a lot of special cases etc...
Not sure about VS2008 explicitly but VS2010 and VS2012 offer $(VisualStudioVersion) with values of 10.0 and 11.0 respectively.
精彩评论