summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-06-24 12:11:52 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-06-24 12:14:11 (GMT)
commitc77b57ba7d8198a71d8d90a4eac5bcd526050cf9 (patch)
treed0b1313e2bceb24d533e60f7b0c4659d5389f5db /Source/cmCTest.cxx
parent93d084c180fde5bc3c31b9945ea7ddb06d9a6007 (diff)
downloadCMake-c77b57ba7d8198a71d8d90a4eac5bcd526050cf9.zip
CMake-c77b57ba7d8198a71d8d90a4eac5bcd526050cf9.tar.gz
CMake-c77b57ba7d8198a71d8d90a4eac5bcd526050cf9.tar.bz2
CTest: Allow -Dvar=value with no space between the D and the var
Similar to CMake's handling of -D command line arguments, for consistency and to avoid silent ignoring of "unknown command line" args.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 05e8237..b5687e3 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -2289,6 +2289,17 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
}
}
+ // If it's not exactly -D, but it starts with -D, then try to parse out
+ // a variable definition from it, same as CMake does. Unsuccessful
+ // attempts are simply ignored since previous ctest versions ignore
+ // this too. (As well as many other unknown command line args.)
+ //
+ if(arg != "-D" && cmSystemTools::StringStartsWith(arg.c_str(), "-D"))
+ {
+ std::string input = arg.substr(2);
+ this->AddVariableDefinition(input);
+ }
+
if(this->CheckArgument(arg, "-T", "--test-action") &&
(i < args.size() -1) )
{