mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 14:50:15 -05:00
file(TIMESTAMP): Interpret relative paths w.r.t. the source tree
Fixes: #23610
This commit is contained in:
@@ -2836,7 +2836,11 @@ bool HandleTimestampCommand(std::vector<std::string> const& args,
|
|||||||
|
|
||||||
unsigned int argsIndex = 1;
|
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++];
|
const std::string& outputVariable = args[argsIndex++];
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ run_cmake(GLOB_RECURSE)
|
|||||||
run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS)
|
run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS)
|
||||||
run_cmake(SIZE)
|
run_cmake(SIZE)
|
||||||
run_cmake(SIZE-error-does-not-exist)
|
run_cmake(SIZE-error-does-not-exist)
|
||||||
|
run_cmake(TIMESTAMP)
|
||||||
|
|
||||||
run_cmake(REMOVE-empty)
|
run_cmake(REMOVE-empty)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- '[0-9]*-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-6][0-9]Z'
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
file(TIMESTAMP "TIMESTAMP.cmake" output UTC)
|
||||||
|
message(STATUS "'${output}'")
|
||||||
Reference in New Issue
Block a user