diff options
author | Brad King <brad.king@kitware.com> | 2016-01-12 15:23:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-01-12 15:23:02 (GMT) |
commit | 31a58b438f1d597d10835db30edeb1283a4d4829 (patch) | |
tree | 5d8354278193a8bb1458d43fd67eada435166160 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | b3c10efb0885e2ed23a04cbaf967de23d921ffc8 (diff) | |
parent | af39f11521af7fc2ec037103df1ad5a616dd7f19 (diff) | |
download | CMake-31a58b438f1d597d10835db30edeb1283a4d4829.zip CMake-31a58b438f1d597d10835db30edeb1283a4d4829.tar.gz CMake-31a58b438f1d597d10835db30edeb1283a4d4829.tar.bz2 |
Merge topic 'vs-global-properties'
af39f115 VS: Implement VS_GLOBAL_* target properties in VS 2010+ (#13666)
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 2120035..27ae685 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -448,6 +448,32 @@ void cmVisualStudio10TargetGenerator::Generate() (*this->BuildFileStream) << cmVS10EscapeXML(targetFrameworkVersion) << "</TargetFrameworkVersion>\n"; } + + std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys(); + for(std::vector<std::string>::const_iterator keyIt = keys.begin(); + keyIt != keys.end(); ++keyIt) + { + static const char* prefix = "VS_GLOBAL_"; + if(keyIt->find(prefix) != 0) + continue; + std::string globalKey = keyIt->substr(strlen(prefix)); + // Skip invalid or separately-handled properties. + if(globalKey == "" || + globalKey == "PROJECT_TYPES" || + globalKey == "ROOTNAMESPACE" || + globalKey == "KEYWORD") + { + continue; + } + const char* value = this->GeneratorTarget->GetProperty(keyIt->c_str()); + if (!value) + continue; + this->WriteString("<", 2); + (*this->BuildFileStream) << globalKey << ">" + << cmVS10EscapeXML(value) + << "</" << globalKey << ">\n"; + } + this->WriteString("</PropertyGroup>\n", 1); this->WriteString("<Import Project=" "\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n", |