mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 22:30:07 -05:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user