mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 11:10:06 -05:00
BUG: fix for bug 4414, find targets in the global generator for set_target_properties and add_dependencies
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
|
||||
=========================================================================*/
|
||||
#include "cmAddDependenciesCommand.h"
|
||||
#include "cmLocalGenerator.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
|
||||
// cmDependenciesCommand
|
||||
bool cmAddDependenciesCommand::InitialPass(
|
||||
@@ -28,14 +30,16 @@ bool cmAddDependenciesCommand::InitialPass(
|
||||
|
||||
std::string target_name = args[0];
|
||||
|
||||
cmTargets &tgts = this->Makefile->GetTargets();
|
||||
if (tgts.find(target_name) != tgts.end())
|
||||
cmTarget* target =
|
||||
this->GetMakefile()->GetLocalGenerator()->
|
||||
GetGlobalGenerator()->FindTarget(0, target_name.c_str());
|
||||
if(target)
|
||||
{
|
||||
std::vector<std::string>::const_iterator s = args.begin();
|
||||
++s;
|
||||
++s; // skip over target_name
|
||||
for (; s != args.end(); ++s)
|
||||
{
|
||||
tgts[target_name].AddUtility(s->c_str());
|
||||
target->AddUtility(s->c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -46,7 +50,6 @@ bool cmAddDependenciesCommand::InitialPass(
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user