summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommandGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-05 12:42:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-05 12:42:47 (GMT)
commit259292ebcccac1a3aba931d2437e1432f77c0945 (patch)
treecec28b487d277a2f2bc2b197db94d22ce5df1d1b /Source/cmCustomCommandGenerator.cxx
parent95894a605e3c39c73390f4db1868c457b16bf5a2 (diff)
parent98d59417b0c6ac3ea85e315133337030dad93496 (diff)
downloadCMake-259292ebcccac1a3aba931d2437e1432f77c0945.zip
CMake-259292ebcccac1a3aba931d2437e1432f77c0945.tar.gz
CMake-259292ebcccac1a3aba931d2437e1432f77c0945.tar.bz2
Merge topic 'custom-command-work-dir-genex'
98d59417b0 add_custom_{command,target}: Fix WORKING_DIRECTORY leading genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2559
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r--Source/cmCustomCommandGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 5bbae17..d1c1736 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -70,6 +70,12 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
std::unique_ptr<cmCompiledGeneratorExpression> cge =
this->GE->Parse(workingdirectory);
this->WorkingDirectory = cge->Evaluate(this->LG, this->Config);
+ // Convert working directory to a full path.
+ if (!this->WorkingDirectory.empty()) {
+ std::string const& build_dir = this->LG->GetCurrentBinaryDirectory();
+ this->WorkingDirectory =
+ cmSystemTools::CollapseFullPath(this->WorkingDirectory, build_dir);
+ }
}
}