diff options
author | David Cole <david.cole@kitware.com> | 2011-11-04 17:29:41 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-11-04 17:29:41 (GMT) |
commit | 011694c269a1193ec8f7fe8dce8d4a86bcafa8e4 (patch) | |
tree | 85c1c97cabc3070f2b70fca65f37d7c50806c09f | |
parent | a2e6d2482e4eb007c8012f2aee3b2381cc95a001 (diff) | |
download | CMake-011694c269a1193ec8f7fe8dce8d4a86bcafa8e4.zip CMake-011694c269a1193ec8f7fe8dce8d4a86bcafa8e4.tar.gz CMake-011694c269a1193ec8f7fe8dce8d4a86bcafa8e4.tar.bz2 |
VS10: Use expected values for UseOfMfc (#11213)
Use expected values for the UseOfMfc xml element in
VS 10 .vcxproj files.
CMAKE_MFC_FLAG=1 maps to "Static"
CMAKE_MFC_FLAG=2 maps to "Dynamic"
all other values map to "false"
Thanks to Randy Schott and McBen for their patches which
served as inspiration and motivation for getting this done.
See also http://public.kitware.com/Bug/view.php?id=11224
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 551b0ad..c51254a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -290,16 +290,24 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() } configType += "</ConfigurationType>\n"; this->WriteString(configType.c_str(), 2); + const char* mfcFlag = this->Target->GetMakefile()->GetDefinition("CMAKE_MFC_FLAG"); - if(mfcFlag) + std::string mfcFlagValue = mfcFlag ? mfcFlag : "0"; + + std::string useOfMfcValue = "false"; + if(mfcFlagValue == "1") { - this->WriteString("<UseOfMfc>true</UseOfMfc>\n", 2); + useOfMfcValue = "Static"; } - else + else if(mfcFlagValue == "2") { - this->WriteString("<UseOfMfc>false</UseOfMfc>\n", 2); + useOfMfcValue = "Dynamic"; } + std::string mfcLine = "<UseOfMfc>"; + mfcLine += useOfMfcValue + "</UseOfMfc>\n"; + this->WriteString(mfcLine.c_str(), 2); + if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY && this->ClOptions[*i]->UsingUnicode()) { |