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
This commit is contained in:
Ben Boeckel
2019-12-18 09:48:40 -05:00
parent a5f44ec925
commit f5126badd8
4 changed files with 32 additions and 3 deletions
+4
View File
@@ -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);
}