fix to expand variables in custom command outputs and main dependencies
This commit is contained in:
parent
653cb84f66
commit
aaf2795050
@ -477,6 +477,7 @@ void cmMakefile::AddCustomCommand(const char* source,
|
|||||||
// add the output to the target?
|
// add the output to the target?
|
||||||
std::string sname = *d;
|
std::string sname = *d;
|
||||||
sname += ".rule";
|
sname += ".rule";
|
||||||
|
this->ExpandVariablesInString(sname);
|
||||||
// if the rule was added to the source,
|
// if the rule was added to the source,
|
||||||
// then add the source to the target
|
// then add the source to the target
|
||||||
if (!this->GetSource(sname.c_str()))
|
if (!this->GetSource(sname.c_str()))
|
||||||
@ -533,14 +534,25 @@ AddCustomCommandToOutput(const char* output,
|
|||||||
combinedArgs += " ";
|
combinedArgs += " ";
|
||||||
}
|
}
|
||||||
cmSourceFile *file = 0;
|
cmSourceFile *file = 0;
|
||||||
|
|
||||||
|
// setup the output name and make sure we expand any variables
|
||||||
std::string outName = output;
|
std::string outName = output;
|
||||||
outName += ".rule";
|
outName += ".rule";
|
||||||
|
this->ExpandVariablesInString(outName);
|
||||||
|
|
||||||
|
// setup the main dependency name and expand vars of course
|
||||||
|
std::string mainDepend;
|
||||||
|
if (main_dependency && main_dependency[0] != '\0')
|
||||||
|
{
|
||||||
|
mainDepend = main_dependency;
|
||||||
|
this->ExpandVariablesInString(mainDepend);
|
||||||
|
}
|
||||||
|
|
||||||
// OK this rule will be placed on a generated output file unless the main
|
// OK this rule will be placed on a generated output file unless the main
|
||||||
// depednency was specified.
|
// depednency was specified.
|
||||||
if (main_dependency && main_dependency[0] != '\0')
|
if (main_dependency && main_dependency[0] != '\0')
|
||||||
{
|
{
|
||||||
file = this->GetSource(main_dependency);
|
file = this->GetSource(mainDepend.c_str());
|
||||||
if (file && file->GetCustomCommand() && !replace)
|
if (file && file->GetCustomCommand() && !replace)
|
||||||
{
|
{
|
||||||
cmCustomCommand* cc = file->GetCustomCommand();
|
cmCustomCommand* cc = file->GetCustomCommand();
|
||||||
@ -556,7 +568,7 @@ AddCustomCommandToOutput(const char* output,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
file = this->GetOrCreateSource(main_dependency);
|
file = this->GetOrCreateSource(mainDepend.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,7 +610,7 @@ AddCustomCommandToOutput(const char* output,
|
|||||||
std::vector<std::string> depends2(depends);
|
std::vector<std::string> depends2(depends);
|
||||||
if (main_dependency && main_dependency[0] != '\0')
|
if (main_dependency && main_dependency[0] != '\0')
|
||||||
{
|
{
|
||||||
depends2.push_back(main_dependency);
|
depends2.push_back(mainDepend.c_str());
|
||||||
}
|
}
|
||||||
cmCustomCommand *cc =
|
cmCustomCommand *cc =
|
||||||
new cmCustomCommand(c.c_str(),combinedArgs.c_str(),depends2, output);
|
new cmCustomCommand(c.c_str(),combinedArgs.c_str(),depends2, output);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user