summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorTheBrokenRail <connor24nolan@live.com>2022-07-02 04:18:46 (GMT)
committerBrad King <brad.king@kitware.com>2022-07-06 13:28:21 (GMT)
commit733801b57f61233601e1c11e4cb7ed121ec4fa71 (patch)
treee624552536750b5350701e804a2ffd428f543923 /Source
parentf1e38ec0a7208836c26c309693c90659e7d0baa7 (diff)
downloadCMake-733801b57f61233601e1c11e4cb7ed121ec4fa71.zip
CMake-733801b57f61233601e1c11e4cb7ed121ec4fa71.tar.gz
CMake-733801b57f61233601e1c11e4cb7ed121ec4fa71.tar.bz2
file(TIMESTAMP): Interpret relative paths w.r.t. the source tree
Fixes: #23610
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1cfe29c..ecbc5c5 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -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++];