diff options
author | Brad King <brad.king@kitware.com> | 2011-01-26 21:32:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-01-26 23:02:02 (GMT) |
commit | 88548a45fbd35205469ac9fd332349551e172496 (patch) | |
tree | 7fb78e2070cd8320d73b0f4f2c8e1b2cf962e5d3 /Source/cmAddCustomTargetCommand.cxx | |
parent | 7befc00783ca9739e7585ff4d2b645a762a38396 (diff) | |
download | CMake-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/cmAddCustomTargetCommand.cxx')
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index edb787b..27dea98 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -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 = |