mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-03 20:29:56 -06:00
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP) commands to output the timestamp with a microsecond resolution. This convention is offered by python's datetime module. Before, the precision was limited to seconds. The implementation is done by extending existing cmTimestamp methods with a `microseconds` parameter. This parameter is optional in order to be backwards compatible. The timestamps are now received in a cross-platform manner using libuv, since the standard C functions like time() don't allow for sub-second precision. This requires libuv 1.28 or higher. We already require higher than that on Windows, so update the required version for other platforms. Implements: #19335
4 lines
182 B
CMake
4 lines
182 B
CMake
set(ENV{SOURCE_DATE_EPOCH} "1123456789")
|
|
string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S.%f %A=%a %B=%b %y day=%j wd=%w week=%U w_iso=%V %%I=%I epoch=%s" UTC)
|
|
message("RESULT=${RESULT}")
|