diff options
author | Brad King <brad.king@kitware.com> | 2014-07-23 15:13:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-23 18:18:53 (GMT) |
commit | 1c209ac165cd2c25c632cdd238a9948c1651f907 (patch) | |
tree | 5996e7a96458af31fd09cba0232c2dbd15de54e8 /Source/cmVisualStudioGeneratorOptions.cxx | |
parent | 91c933546d1eebb6a637f403824d63177c86c11e (diff) | |
download | CMake-1c209ac165cd2c25c632cdd238a9948c1651f907.zip CMake-1c209ac165cd2c25c632cdd238a9948c1651f907.tar.gz CMake-1c209ac165cd2c25c632cdd238a9948c1651f907.tar.bz2 |
cmIDEOption: Store mapped flag values as a vector<string>
Some FlagMap entries are ;-lists. Store values as vector<string> so
that individual values may contain ';' characters. Delay the
construction of the final ;-list until writing to the VS project file.
With this approach the generated file may contain ;-separated values
that contain encoded ';' characters.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 2cbf5db..f710780 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -301,7 +301,7 @@ cmVisualStudioGeneratorOptions { if(this->Version >= cmLocalVisualStudioGenerator::VS10) { - for(std::map<std::string, std::string>::iterator m = this->FlagMap.begin(); + for(std::map<std::string, FlagValue>::iterator m = this->FlagMap.begin(); m != this->FlagMap.end(); ++m) { fout << indent; @@ -317,20 +317,34 @@ cmVisualStudioGeneratorOptions { fout << "<" << m->first << ">"; } - fout << m->second; + const char* sep = ""; + for(std::vector<std::string>::iterator i = m->second.begin(); + i != m->second.end(); ++i) + { + fout << sep << *i; + sep = ";"; + } if (m->first == "AdditionalIncludeDirectories") { - fout << ";%(AdditionalIncludeDirectories)"; + fout << sep << "%(AdditionalIncludeDirectories)"; } fout << "</" << m->first << ">\n"; } } else { - for(std::map<std::string, std::string>::iterator m = this->FlagMap.begin(); + for(std::map<std::string, FlagValue>::iterator m = this->FlagMap.begin(); m != this->FlagMap.end(); ++m) { - fout << indent << m->first << "=\"" << m->second << "\"\n"; + fout << indent << m->first << "=\""; + const char* sep = ""; + for(std::vector<std::string>::iterator i = m->second.begin(); + i != m->second.end(); ++i) + { + fout << sep << *i; + sep = ";"; + } + fout << "\"\n"; } } } |