summaryrefslogtreecommitdiffstats
path: root/Source/cmTestGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-05 19:03:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-23 15:46:07 (GMT)
commitc259b8302648de1387e21e9ea907cd1a2cb49933 (patch)
treeca87ae369f48d3a2c8f7751dd2a015c6b697d24a /Source/cmTestGenerator.cxx
parent75e511eeaf77848ffef00d570cb10243764f51d2 (diff)
downloadCMake-c259b8302648de1387e21e9ea907cd1a2cb49933.zip
CMake-c259b8302648de1387e21e9ea907cd1a2cb49933.tar.gz
CMake-c259b8302648de1387e21e9ea907cd1a2cb49933.tar.bz2
cmTestGenerator: Require cmLocalGenerator, not cmMakefile.
Diffstat (limited to 'Source/cmTestGenerator.cxx')
-rw-r--r--Source/cmTestGenerator.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 1815ade..9d85f5a 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmGeneratorExpression.h"
#include "cmOutputConverter.h"
#include "cmMakefile.h"
+#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTest.h"
@@ -27,6 +28,7 @@ cmTestGenerator
{
this->ActionsPerConfig = !test->GetOldStyle();
this->TestGenerated = false;
+ this->LG = 0;
}
//----------------------------------------------------------------------------
@@ -35,6 +37,11 @@ cmTestGenerator
{
}
+void cmTestGenerator::Compute(cmLocalGenerator* lg)
+{
+ this->LG = lg;
+}
+
//----------------------------------------------------------------------------
void cmTestGenerator::GenerateScriptConfigs(std::ostream& os,
Indent const& indent)
@@ -81,8 +88,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Check whether the command executable is a target whose name is to
// be translated.
std::string exe = command[0];
- cmMakefile* mf = this->Test->GetMakefile();
- cmGeneratorTarget* target = mf->FindGeneratorTargetToUse(exe);
+ cmGeneratorTarget* target =
+ this->LG->GetMakefile()->FindGeneratorTargetToUse(exe);
if(target && target->GetType() == cmTarget::EXECUTABLE)
{
// Use the target file on disk.
@@ -110,7 +117,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
else
{
// Use the command name given.
- exe = ge.Parse(exe.c_str())->Evaluate(mf, config);
+ exe = ge.Parse(exe.c_str())->Evaluate(this->LG->GetMakefile(), config);
cmSystemTools::ConvertToUnixSlashes(exe);
}
@@ -120,7 +127,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
ci != command.end(); ++ci)
{
os << " " << cmOutputConverter::EscapeForCMake(
- ge.Parse(*ci)->Evaluate(mf, config));
+ ge.Parse(*ci)->Evaluate(
+ this->LG->GetMakefile(), config));
}
// Finish the test command.
@@ -137,7 +145,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
{
os << " " << i->first
<< " " << cmOutputConverter::EscapeForCMake(
- ge.Parse(i->second.GetValue())->Evaluate(mf, config));
+ ge.Parse(i->second.GetValue())->Evaluate(this->LG->GetMakefile(),
+ config));
}
os << ")" << std::endl;
}