BUG: Fix dependencies of custom commands that are relative paths to files or other custom command outputs.

This commit is contained in:
Brad King 2005-03-29 10:34:58 -05:00
parent 65f1e3e1d8
commit c940351914
2 changed files with 12 additions and 4 deletions

View File

@ -2480,7 +2480,8 @@ cmLocalUnixMakefileGenerator2
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmLocalUnixMakefileGenerator2 cmLocalUnixMakefileGenerator2
::AppendAnyDepend(std::vector<std::string>& depends, const char* name) ::AppendAnyDepend(std::vector<std::string>& depends, const char* name,
bool assume_unknown_is_file)
{ {
// There are a few cases for the name of the target: // There are a few cases for the name of the target:
// - CMake target in this directory: depend on it. // - CMake target in this directory: depend on it.
@ -2589,9 +2590,15 @@ cmLocalUnixMakefileGenerator2
} }
else if(cmSystemTools::FileIsFullPath(name)) else if(cmSystemTools::FileIsFullPath(name))
{ {
// This is a path to a file. Just trust that it will be present. // This is a path to a file. Just trust the listfile author that
// it will be present or there is a rule to build it.
depends.push_back(cmSystemTools::CollapseFullPath(name)); depends.push_back(cmSystemTools::CollapseFullPath(name));
} }
else if(assume_unknown_is_file)
{
// Just assume this is a file or make target that will be present.
depends.push_back(name);
}
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -2632,7 +2639,7 @@ cmLocalUnixMakefileGenerator2
d != cc.GetDepends().end(); ++d) d != cc.GetDepends().end(); ++d)
{ {
// Add this dependency. // Add this dependency.
this->AppendAnyDepend(depends, d->c_str()); this->AppendAnyDepend(depends, d->c_str(), true);
} }
} }

View File

@ -202,7 +202,8 @@ protected:
void AppendTargetDepends(std::vector<std::string>& depends, void AppendTargetDepends(std::vector<std::string>& depends,
const cmTarget& target); const cmTarget& target);
void AppendAnyDepend(std::vector<std::string>& depends, const char* name); void AppendAnyDepend(std::vector<std::string>& depends, const char* name,
bool assume_unknown_is_file=false);
void AppendRuleDepend(std::vector<std::string>& depends, void AppendRuleDepend(std::vector<std::string>& depends,
const char* ruleFileName); const char* ruleFileName);
void AppendCustomDepends(std::vector<std::string>& depends, void AppendCustomDepends(std::vector<std::string>& depends,