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
+8
View File
@@ -166,6 +166,14 @@ bool cmAddCustomTargetCommand
}
}
// Convert working directory to a full path.
if(!working_directory.empty())
{
const char* build_dir = this->Makefile->GetCurrentOutputDirectory();
working_directory =
cmSystemTools::CollapseFullPath(working_directory.c_str(), build_dir);
}
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
cmTarget* target =