Handle relative WORKING_DIRECTORY in add_custom_(command|target)

This also fixes handling of trailing slashes in the directory name.
This commit is contained in:
Brad King
2011-01-26 16:32:17 -05:00
parent 7befc00783
commit 88548a45fb
5 changed files with 28 additions and 2 deletions
+7
View File
@@ -286,6 +286,13 @@ bool cmAddCustomCommandCommand
return false;
}
// Convert working directory to a full path.
if(!working.empty())
{
const char* build_dir = this->Makefile->GetCurrentOutputDirectory();
working = cmSystemTools::CollapseFullPath(working.c_str(), build_dir);
}
// Choose which mode of the command to use.
bool escapeOldStyle = !verbatim;
if(source.empty() && output.empty())