summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-07 13:22:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-07-07 13:22:11 (GMT)
commitd21b391cdec4d6d8ac5baa80a584aa3442ea5239 (patch)
tree85241d3c7936bebcab8006ea917c343f560d0ab9 /Source/cmFileCommand.cxx
parent3b1d54506f1840beaa0a0e8fa781bc6680777302 (diff)
parent733801b57f61233601e1c11e4cb7ed121ec4fa71 (diff)
downloadCMake-d21b391cdec4d6d8ac5baa80a584aa3442ea5239.zip
CMake-d21b391cdec4d6d8ac5baa80a584aa3442ea5239.tar.gz
CMake-d21b391cdec4d6d8ac5baa80a584aa3442ea5239.tar.bz2
Merge topic 'file-TIMESTAMP-relative-path'
733801b57f file(TIMESTAMP): Interpret relative paths w.r.t. the source tree Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7440
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 1082387..45ec343 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2817,7 +2817,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++];