From 15c52e98913b68270be8af1aa0288604c302866b Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Feb 2009 08:52:07 -0500 Subject: ENH: Add rule substitutions useful for launchers This defines make rule substitutions , , , and . They will be useful for RULE_LAUNCH_* property values. --- Source/cmLocalGenerator.cxx | 25 +++++++++++++++++++++++++ Source/cmLocalGenerator.h | 1 + Source/cmLocalUnixMakefileGenerator3.cxx | 7 +++++++ 3 files changed, 33 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 8555064..0f1c4ee 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -972,6 +972,31 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, return replaceValues.LinkLibraries; } } + if(replaceValues.Language) + { + if(variable == "LANGUAGE") + { + return replaceValues.Language; + } + } + if(replaceValues.CMTarget) + { + if(variable == "TARGET_NAME") + { + return replaceValues.CMTarget->GetName(); + } + if(variable == "TARGET_TYPE") + { + return cmTarget::TargetTypeNames[replaceValues.CMTarget->GetType()]; + } + } + if(replaceValues.Output) + { + if(variable == "OUTPUT") + { + return replaceValues.Output; + } + } if(variable == "CMAKE_COMMAND") { const char* cmcommand = diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index a624e66..10ec3b8 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -214,6 +214,7 @@ public: const char* Source; const char* AssemblySource; const char* PreprocessedSource; + const char* Output; const char* Object; const char* ObjectDir; const char* Flags; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3910bc1..a65d7c6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1114,6 +1114,13 @@ cmLocalUnixMakefileGenerator3::MakeLauncher(const cmCustomCommand& cc, RuleVariables vars; vars.RuleLauncher = prop; vars.CMTarget = target; + std::string output; + const std::vector& outputs = cc.GetOutputs(); + if(!outputs.empty()) + { + output = this->Convert(outputs[0].c_str(), relative, SHELL); + } + vars.Output = output.c_str(); std::string launcher; this->ExpandRuleVariables(launcher, vars); -- cgit v0.12