From c7a8e74b8c7ade9efb68b8bd36fd6d741f2dba7e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 25 Jul 2015 21:28:36 +0200 Subject: Always access target location from a cmGeneratorTarget instance. --- Source/cmCustomCommandGenerator.cxx | 7 ++++--- Source/cmExtraCodeBlocksGenerator.cxx | 4 +++- Source/cmGlobalKdevelopGenerator.cxx | 8 ++++---- Source/cmLocalGenerator.cxx | 7 ++++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 8483a91..086c9f9 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -42,12 +42,13 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const { std::string const& argv0 = this->CC.GetCommandLines()[c][0]; - cmTarget* target = this->LG->GetMakefile()->FindTargetToUse(argv0); + cmGeneratorTarget* target = + this->LG->GetMakefile()->FindGeneratorTargetToUse(argv0); if(target && target->GetType() == cmTarget::EXECUTABLE && - (target->IsImported() + (target->Target->IsImported() || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { - return target->GetLocation(this->Config); + return target->Target->GetLocation(this->Config); } return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), this->Config); diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index a31e832..6d145a2 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -591,7 +591,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, } else { - location = target->GetLocation(buildType); + cmGeneratorTarget* gt = + this->GlobalGenerator->GetGeneratorTarget(target); + location = gt->Target->GetLocation(buildType); } fout<<"