2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2005-07-31 19:51:42 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2005-07-31 19:51:42 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
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;
|
|
|
|
}
|