summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-12-18 14:48:40 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2019-12-18 18:57:07 (GMT)
commitf5126badd8aadd307a2d38b215cb1dc2ff43647d (patch)
tree74c74b828f39756f0f0ec7bc7e012a913160b699 /Source
parenta5f44ec92558e229cf6927b321f5f7903af8b412 (diff)
downloadCMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.zip
CMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.tar.gz
CMake-f5126badd8aadd307a2d38b215cb1dc2ff43647d.tar.bz2
add_custom_command: convert DEPENDS path arguments to absolute paths
This is only done if they are "obviously" paths in that they contain a directory separator. Fixes: #17111
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCustomCommandGenerator.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index bce27c2..c568253 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -8,6 +8,7 @@
#include <cmext/algorithm>
+#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
#include "cmGeneratorExpression.h"
@@ -29,6 +30,9 @@ void AppendPaths(const std::vector<std::string>& inputs,
cmExpandedList(cge->Evaluate(lg, config));
for (std::string& it : result) {
cmSystemTools::ConvertToUnixSlashes(it);
+ if (cmContains(it, '/') && !cmSystemTools::FileIsFullPath(it)) {
+ it = cmStrCat(lg->GetMakefile()->GetCurrentBinaryDirectory(), '/', it);
+ }
if (cmSystemTools::FileIsFullPath(it)) {
it = cmSystemTools::CollapseFullPath(it);
}