diff options
author | Brad King <brad.king@kitware.com> | 2012-09-19 17:57:44 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-09-19 17:57:44 (GMT) |
commit | d1513950fa112692b422b25a506de9e12ff8cb01 (patch) | |
tree | 43cf2802819676a3ccf7d75c2ba8007c9b25bf5e | |
parent | 816e4ca0eb4f21df246773faffdd86bb12b7d046 (diff) | |
parent | f35e35b058ab89f70923e5ad6d16f6299147fdba (diff) | |
download | CMake-d1513950fa112692b422b25a506de9e12ff8cb01.zip CMake-d1513950fa112692b422b25a506de9e12ff8cb01.tar.gz CMake-d1513950fa112692b422b25a506de9e12ff8cb01.tar.bz2 |
Merge topic 'document-MSVC-variables-12567'
f35e35b add documentation for all MSVCxxx version variables (#12567)
-rw-r--r-- | Source/cmDocumentVariables.cxx | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 94cd5c2..5e7e081 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1,6 +1,8 @@ #include "cmDocumentVariables.h" #include "cmake.h" +#include <cmsys/ios/sstream> + void cmDocumentVariables::DefineVariables(cmake* cm) { // Subsection: variables defined by cmake, that give @@ -992,12 +994,33 @@ void cmDocumentVariables::DefineVariables(cmake* cm) false, "Variables That Describe the System"); - cm->DefineProperty - ("MSVC80", cmProperty::VARIABLE, - "True when using Microsoft Visual C 8.0", - "Set to true when the compiler is version 8.0 of Microsoft Visual C.", - false, - "Variables That Describe the System"); + int msvc_versions[] = { 60, 70, 71, 80, 90, 100, 110, 0 }; + for (int i = 0; msvc_versions[i] != 0; i ++) + { + const char minor = (char)('0' + (msvc_versions[i] % 10)); + cmStdString varName = "MSVC"; + cmsys_ios::ostringstream majorStr; + + majorStr << (msvc_versions[i] / 10); + varName += majorStr.str(); + if (msvc_versions[i] < 100) + { + varName += minor; + } + + cmStdString verString = majorStr.str() + "." + minor; + + cmStdString shortStr = "True when using Microsoft Visual C " + verString; + cmStdString fullStr = "Set to true when the compiler is version " + + verString + + " of Microsoft Visual C."; + cm->DefineProperty + (varName.c_str(), cmProperty::VARIABLE, + shortStr.c_str(), + fullStr.c_str(), + false, + "Variables That Describe the System"); + } cm->DefineProperty ("MSVC_IDE", cmProperty::VARIABLE, @@ -1017,6 +1040,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) " 1400 = VS 8.0\n" " 1500 = VS 9.0\n" " 1600 = VS 10.0\n" + " 1700 = VS 11.0\n" "", false, "Variables That Describe the System"); |