2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2005-07-31 19:51:42 +04:00
|
|
|
#include "cmGetTestPropertyCommand.h"
|
|
|
|
|
|
|
|
#include "cmTest.h"
|
2016-04-29 17:53:13 +03:00
|
|
|
#include "cmake.h"
|
2005-07-31 19:51:42 +04:00
|
|
|
|
|
|
|
// cmGetTestPropertyCommand
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmGetTestPropertyCommand::InitialPass(
|
|
|
|
std::vector<std::string> const& args, cmExecutionStatus&)
|
2005-07-31 19:51:42 +04:00
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
if (args.size() < 3) {
|
2005-07-31 19:51:42 +04:00
|
|
|
this->SetError("called with incorrect number of arguments");
|
|
|
|
return false;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2005-07-31 19:51:42 +04:00
|
|
|
|
|
|
|
std::string testName = args[0];
|
2005-09-18 16:17:39 +04:00
|
|
|
std::string var = args[2];
|
2016-05-16 17:34:04 +03:00
|
|
|
cmTest* test = this->Makefile->GetTest(testName);
|
|
|
|
if (test) {
|
2016-06-27 23:44:16 +03:00
|
|
|
const char* prop = CM_NULLPTR;
|
2016-05-16 17:34:04 +03:00
|
|
|
if (!args[1].empty()) {
|
2015-06-06 10:41:20 +03:00
|
|
|
prop = test->GetProperty(args[1]);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
|
|
|
if (prop) {
|
2014-03-11 03:04:11 +04:00
|
|
|
this->Makefile->AddDefinition(var, prop);
|
2005-07-31 19:51:42 +04:00
|
|
|
return true;
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2014-03-11 03:04:11 +04:00
|
|
|
this->Makefile->AddDefinition(var, "NOTFOUND");
|
2005-07-31 19:51:42 +04:00
|
|
|
return true;
|
|
|
|
}
|