diff options
author | David Cole <david.cole@kitware.com> | 2012-06-24 10:16:32 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2012-06-24 12:03:24 (GMT) |
commit | 93d084c180fde5bc3c31b9945ea7ddb06d9a6007 (patch) | |
tree | d5e21412dc94d4105acfdbf2c12c97cc0d8fc9d8 /Source/CTest/cmCTestScriptHandler.cxx | |
parent | af298480d020e814fa4537ca7d7dd44d472489b5 (diff) | |
download | CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.zip CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.tar.gz CMake-93d084c180fde5bc3c31b9945ea7ddb06d9a6007.tar.bz2 |
CTest: Extend -D command line arg handling for variable definitions
If the argument following -D is not a valid dashboard type string,
then try to parse it as a "var:type=value" string just like cmake
already does.
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index d3ab2ef..8643cb3 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -435,6 +435,15 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) return 2; } + // Add definitions of variables passed in on the command line: + const std::map<std::string, std::string> &defs = + this->CTest->GetDefinitions(); + for (std::map<std::string, std::string>::const_iterator it = defs.begin(); + it != defs.end(); ++it) + { + this->Makefile->AddDefinition(it->first.c_str(), it->second.c_str()); + } + // finally read in the script if (!this->Makefile->ReadListFile(0, script.c_str()) || cmSystemTools::GetErrorOccuredFlag()) |