file(TIMESTAMP): Interpret relative paths w.r.t. the source tree

Fixes: #23610
This commit is contained in:
TheBrokenRail
2022-07-02 00:18:46 -04:00
committed by Brad King
parent f1e38ec0a7
commit 733801b57f
4 changed files with 9 additions and 1 deletions

View File

@@ -2836,7 +2836,11 @@ bool HandleTimestampCommand(std::vector<std::string> const& args,
unsigned int argsIndex = 1;
const std::string& filename = args[argsIndex++];
std::string filename = args[argsIndex++];
if (!cmsys::SystemTools::FileIsFullPath(filename)) {
filename = cmStrCat(status.GetMakefile().GetCurrentSourceDirectory(), '/',
filename);
}
const std::string& outputVariable = args[argsIndex++];