Always access target location from a cmGeneratorTarget instance.
This commit is contained in:
parent
5b60eaf619
commit
c7a8e74b8c
@ -42,12 +42,13 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
|
|||||||
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
||||||
{
|
{
|
||||||
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
|
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 &&
|
if(target && target->GetType() == cmTarget::EXECUTABLE &&
|
||||||
(target->IsImported()
|
(target->Target->IsImported()
|
||||||
|| !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
|
|| !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(),
|
return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(),
|
||||||
this->Config);
|
this->Config);
|
||||||
|
@ -591,7 +591,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
location = target->GetLocation(buildType);
|
cmGeneratorTarget* gt =
|
||||||
|
this->GlobalGenerator->GetGeneratorTarget(target);
|
||||||
|
location = gt->Target->GetLocation(buildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
fout<<" <Option output=\"" << location
|
fout<<" <Option output=\"" << location
|
||||||
|
@ -70,13 +70,13 @@ void cmGlobalKdevelopGenerator::Generate()
|
|||||||
lg!=lgs.end(); lg++)
|
lg!=lgs.end(); lg++)
|
||||||
{
|
{
|
||||||
cmMakefile* makefile=(*lg)->GetMakefile();
|
cmMakefile* makefile=(*lg)->GetMakefile();
|
||||||
cmTargets& targets=makefile->GetTargets();
|
cmGeneratorTargetsType const& targets = makefile->GetGeneratorTargets();
|
||||||
for (cmTargets::iterator ti = targets.begin();
|
for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
|
||||||
ti != targets.end(); ti++)
|
ti != targets.end(); ti++)
|
||||||
{
|
{
|
||||||
if (ti->second.GetType()==cmTarget::EXECUTABLE)
|
if (ti->second->GetType()==cmTarget::EXECUTABLE)
|
||||||
{
|
{
|
||||||
executable = ti->second.GetLocation("");
|
executable = ti->second->Target->GetLocation("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1699,7 +1699,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look for a CMake target with the given name.
|
// Look for a CMake target with the given name.
|
||||||
if(cmTarget* target = this->Makefile->FindTargetToUse(name))
|
if(cmGeneratorTarget* target =
|
||||||
|
this->Makefile->FindGeneratorTargetToUse(name))
|
||||||
{
|
{
|
||||||
// make sure it is not just a coincidence that the target name
|
// make sure it is not just a coincidence that the target name
|
||||||
// found is part of the inName
|
// found is part of the inName
|
||||||
@ -1709,7 +1710,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
|
|||||||
if(target->GetType() >= cmTarget::EXECUTABLE &&
|
if(target->GetType() >= cmTarget::EXECUTABLE &&
|
||||||
target->GetType() <= cmTarget::MODULE_LIBRARY)
|
target->GetType() <= cmTarget::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
tLocation = target->GetLocation(config);
|
tLocation = target->Target->GetLocation(config);
|
||||||
tLocation = cmSystemTools::GetFilenamePath(tLocation);
|
tLocation = cmSystemTools::GetFilenamePath(tLocation);
|
||||||
tLocation = cmSystemTools::CollapseFullPath(tLocation);
|
tLocation = cmSystemTools::CollapseFullPath(tLocation);
|
||||||
}
|
}
|
||||||
@ -1732,7 +1733,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
|
|||||||
case cmTarget::SHARED_LIBRARY:
|
case cmTarget::SHARED_LIBRARY:
|
||||||
case cmTarget::MODULE_LIBRARY:
|
case cmTarget::MODULE_LIBRARY:
|
||||||
case cmTarget::UNKNOWN_LIBRARY:
|
case cmTarget::UNKNOWN_LIBRARY:
|
||||||
dep = target->GetLocation(config);
|
dep = target->Target->GetLocation(config);
|
||||||
return true;
|
return true;
|
||||||
case cmTarget::OBJECT_LIBRARY:
|
case cmTarget::OBJECT_LIBRARY:
|
||||||
// An object library has no single file on which to depend.
|
// An object library has no single file on which to depend.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user