summaryrefslogtreecommitdiffstats
path: root/Source/cmIDEOptions.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-01 18:56:08 (GMT)
committerBrad King <brad.king@kitware.com>2014-04-01 18:56:08 (GMT)
commit650199e7ca5821c160e5124e79aaf81141a7918f (patch)
tree324a976f57e91dedde40b377486ca2ecee8cdc12 /Source/cmIDEOptions.cxx
parentf2a3dd9d1acb252dd40c35859f9a148c2d0ff823 (diff)
downloadCMake-650199e7ca5821c160e5124e79aaf81141a7918f.zip
CMake-650199e7ca5821c160e5124e79aaf81141a7918f.tar.gz
CMake-650199e7ca5821c160e5124e79aaf81141a7918f.tar.bz2
VS: Support mapping flags with values following separately (#14858)
Add a "UserFollowing" special flag table entry indicator to say that a flag expects a value in a following argument. Teach cmIDEOptions to handle such flags.
Diffstat (limited to 'Source/cmIDEOptions.cxx')
-rw-r--r--Source/cmIDEOptions.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index eda1ef6..1f3c066 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -19,6 +19,7 @@ cmIDEOptions::cmIDEOptions()
this->DoingDefine = false;
this->AllowDefine = true;
this->AllowSlash = false;
+ this->DoingFollowing = 0;
for(int i=0; i < FlagTableCount; ++i)
{
this->FlagTable[i] = 0;
@@ -41,6 +42,14 @@ void cmIDEOptions::HandleFlag(const char* flag)
return;
}
+ // If the last option expected a following value, this is it.
+ if(this->DoingFollowing)
+ {
+ this->FlagMapUpdate(this->DoingFollowing, flag);
+ this->DoingFollowing = 0;
+ return;
+ }
+
// Look for known arguments.
if(flag[0] == '-' || (this->AllowSlash && flag[0] == '/'))
{
@@ -105,8 +114,16 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
}
else if(strcmp(flag+1, entry->commandFlag) == 0)
{
- // This flag table entry provides a fixed value.
- this->FlagMap[entry->IDEName] = entry->value;
+ if(entry->special & cmIDEFlagTable::UserFollowing)
+ {
+ // This flag expects a value in the following argument.
+ this->DoingFollowing = entry;
+ }
+ else
+ {
+ // This flag table entry provides a fixed value.
+ this->FlagMap[entry->IDEName] = entry->value;
+ }
entry_found = true;
}