| 4198 | } |
| 4199 | |
| 4200 | std::string Evaluate( |
| 4201 | std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval, |
| 4202 | GeneratorExpressionContent const* content, |
| 4203 | cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override |
| 4204 | { |
| 4205 | cmGeneratorTarget const* target = nullptr; |
| 4206 | std::string targetName; |
| 4207 | |
| 4208 | if (parameters.size() == 1) { |
| 4209 | targetName = parameters[0]; |
| 4210 | |
| 4211 | if (char const* e = GetErrorText(targetName)) { |
| 4212 | reportError(eval, content->GetOriginalExpression(), e); |
| 4213 | return std::string(); |
| 4214 | } |
| 4215 | cmLocalGenerator const* lg = eval->CurrentTarget |
| 4216 | ? eval->CurrentTarget->GetLocalGenerator() |
| 4217 | : eval->Context.LG; |
| 4218 | target = lg->FindGeneratorTargetToUse(targetName); |
| 4219 | |
| 4220 | if (!target) { |
| 4221 | std::ostringstream e; |
| 4222 | e << "Target \"" << targetName << "\" not found."; |
| 4223 | reportError(eval, content->GetOriginalExpression(), e.str()); |
| 4224 | return std::string(); |
| 4225 | } |
| 4226 | eval->AllTargets.insert(target); |
| 4227 | |
| 4228 | } else { |
| 4229 | reportError( |
| 4230 | eval, content->GetOriginalExpression(), |
| 4231 | "$<TARGET_INTERMEDIATE_DIR:...> expression requires one parameter"); |
| 4232 | return std::string(); |
| 4233 | } |
| 4234 | |
| 4235 | assert(target); |
| 4236 | |
| 4237 | if (!HasKnownObjectFileLocation(eval, content, "TARGET_INTERMEDIATE_DIR", |
| 4238 | target)) { |
| 4239 | return std::string(); |
| 4240 | } |
| 4241 | |
| 4242 | return cmSystemTools::CollapseFullPath( |
| 4243 | target->GetObjectDirectory(eval->Context.Config)); |
| 4244 | } |
| 4245 | } targetIntermediateDirNode; |
| 4246 | |
| 4247 | static const struct TargetNameNode : public cmGeneratorExpressionNode |
nothing calls this directly
no test coverage detected