summaryrefslogtreecommitdiffstats
path: root/Source/cmIDEOptions.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-23 15:13:13 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-23 18:18:53 (GMT)
commit1c209ac165cd2c25c632cdd238a9948c1651f907 (patch)
tree5996e7a96458af31fd09cba0232c2dbd15de54e8 /Source/cmIDEOptions.h
parent91c933546d1eebb6a637f403824d63177c86c11e (diff)
downloadCMake-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/cmIDEOptions.h')
-rw-r--r--Source/cmIDEOptions.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index e7749ec..313c003 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -29,6 +29,7 @@ public:
void AddDefines(const char* defines);
void AddDefines(const std::vector<std::string> &defines);
void AddFlag(const char* flag, const char* value);
+ void AddFlag(const char* flag, std::vector<std::string> const& value);
void RemoveFlag(const char* flag);
const char* GetFlag(const char* flag);
@@ -40,7 +41,23 @@ protected:
// Then parse the command line flags specified in CMAKE_CXX_FLAGS
// and CMAKE_C_FLAGS
// and overwrite or add new values to this map
- std::map<std::string, std::string> FlagMap;
+ class FlagValue: public std::vector<std::string>
+ {
+ typedef std::vector<std::string> derived;
+ public:
+ FlagValue& operator=(std::string const& r)
+ {
+ this->resize(1);
+ this->operator[](0) = r;
+ return *this;
+ }
+ FlagValue& operator=(std::vector<std::string> const& r)
+ {
+ this->derived::operator=(r);
+ return *this;
+ }
+ };
+ std::map<std::string, FlagValue > FlagMap;
// Preprocessor definitions.
std::vector<std::string> Defines;