diff options
author | Jon Chronopoulos <patches@crondog.com> | 2018-09-22 07:00:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-28 15:15:33 (GMT) |
commit | f158ac19e1e52362b04ff08c309ac3cf8e429bb7 (patch) | |
tree | 38b224fd9717f4ac18a2e82088fb9461cbbbab00 /Source/cmCustomCommandGenerator.cxx | |
parent | 2d119e53093c9489c80ce9bc3f21eadc254b6e10 (diff) | |
download | CMake-f158ac19e1e52362b04ff08c309ac3cf8e429bb7.zip CMake-f158ac19e1e52362b04ff08c309ac3cf8e429bb7.tar.gz CMake-f158ac19e1e52362b04ff08c309ac3cf8e429bb7.tar.bz2 |
add_custom_{command,target}: WORKING_DIRECTORY generator expressions
This teaches add_custom_command and add_custom_target WORKING_DIRECTORY
about generator expressions
Fixes: #14089
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 6c9f9d6..5bbae17 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -64,6 +64,13 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, } this->Depends.insert(this->Depends.end(), result.begin(), result.end()); } + + const std::string& workingdirectory = this->CC.GetWorkingDirectory(); + if (!workingdirectory.empty()) { + std::unique_ptr<cmCompiledGeneratorExpression> cge = + this->GE->Parse(workingdirectory); + this->WorkingDirectory = cge->Evaluate(this->LG, this->Config); + } } cmCustomCommandGenerator::~cmCustomCommandGenerator() @@ -186,7 +193,7 @@ const char* cmCustomCommandGenerator::GetComment() const std::string cmCustomCommandGenerator::GetWorkingDirectory() const { - return this->CC.GetWorkingDirectory(); + return this->WorkingDirectory; } std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const |