summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-26 21:32:17 (GMT)
committerBrad King <brad.king@kitware.com>2011-01-26 23:02:02 (GMT)
commit88548a45fbd35205469ac9fd332349551e172496 (patch)
tree7fb78e2070cd8320d73b0f4f2c8e1b2cf962e5d3 /Source/cmAddCustomCommandCommand.cxx
parent7befc00783ca9739e7585ff4d2b645a762a38396 (diff)
downloadCMake-88548a45fbd35205469ac9fd332349551e172496.zip
CMake-88548a45fbd35205469ac9fd332349551e172496.tar.gz
CMake-88548a45fbd35205469ac9fd332349551e172496.tar.bz2
Handle relative WORKING_DIRECTORY in add_custom_(command|target)
This also fixes handling of trailing slashes in the directory name.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 7af6ec8..502829e 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -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())