summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-05 07:48:39 -0500
committerBrad King <brad.king@kitware.com>2018-11-05 07:48:39 -0500
commit36280e6157e883fb5257f211d24582b5e7ff4244 (patch)
tree614859c927aa5dbe61da57031944de899e9c88d8 /Source
parent4cd059480a40cc4a2c7e326f8bb1fe11fe46ba0c (diff)
parent98d59417b0c6ac3ea85e315133337030dad93496 (diff)
downloadcmake-36280e6157e883fb5257f211d24582b5e7ff4244.tar.gz
Merge branch 'custom-command-work-dir-genex' into release-3.13
Merge-request: !2559
Diffstat (limited to 'Source')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx6
-rw-r--r--Source/cmAddCustomTargetCommand.cxx7
-rw-r--r--Source/cmCustomCommandGenerator.cxx6
3 files changed, 6 insertions, 13 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 91ccdf7910..53f5593e4a 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -318,12 +318,6 @@ bool cmAddCustomCommandCommand::InitialPass(
return false;
}
- // Convert working directory to a full path.
- if (!working.empty()) {
- const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory();
- working = cmSystemTools::CollapseFullPath(working, build_dir);
- }
-
// Choose which mode of the command to use.
bool escapeOldStyle = !verbatim;
if (source.empty() && output.empty()) {
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 82ee6b4ffa..ddd9b70824 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -181,13 +181,6 @@ bool cmAddCustomTargetCommand::InitialPass(
}
}
- // Convert working directory to a full path.
- if (!working_directory.empty()) {
- const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory();
- working_directory =
- cmSystemTools::CollapseFullPath(working_directory, build_dir);
- }
-
if (commandLines.empty() && !byproducts.empty()) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 5bbae17a0d..d1c173670b 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);
+ }
}
}