diff options
author | Brad King <brad.king@kitware.com> | 2020-10-16 14:19:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-10 12:06:20 (GMT) |
commit | b285748f79b642f3ab970912bc4512ded2f18124 (patch) | |
tree | 916eb57e2a76e26f5ffcc8aa071a1f78532e208b /Source/cmAddCustomCommandCommand.cxx | |
parent | c523d1cc32f53a176ea485aa33e076e577db2d17 (diff) | |
download | CMake-b285748f79b642f3ab970912bc4512ded2f18124.zip CMake-b285748f79b642f3ab970912bc4512ded2f18124.tar.gz CMake-b285748f79b642f3ab970912bc4512ded2f18124.tar.bz2 |
cmAddCustom{Command,Target}Command: Skip conversions on genex paths
If an output or byproduct path starts in a generator expression, do not
convert it to a full path yet. That will have to be done at generate
time after evaluating the generator expressions.
Also update the `add_custom_target` byproduct path conversion added by
commit 445ff5ccdf (Byproducts: collapse full paths of custom target
byproducts, 2019-09-11, v3.16.0-rc1~103^2~1) to match the behavior of
`add_custom_command` when a path starts in a generator expression.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index c1f98fa..8194226 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -10,6 +10,7 @@ #include "cmCustomCommandLines.h" #include "cmCustomCommandTypes.h" #include "cmExecutionStatus.h" +#include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -188,7 +189,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args, case doing_output: case doing_outputs: case doing_byproducts: - if (!cmSystemTools::FileIsFullPath(copy)) { + if (!cmSystemTools::FileIsFullPath(copy) && + cmGeneratorExpression::Find(copy) != 0) { // This is an output to be generated, so it should be // under the build tree. filename = cmStrCat(mf.GetCurrentBinaryDirectory(), '/'); |