CMake/Tests/RunCMake/CommandLineTar/touch-mtime.cmake
Kasper Laudrup 0b7fd783f8 cmake -E tar: Add --touch option
Similar to GNU tar add a --touch option to the tar extract command to
skip extracting the timestamps from the files in the archive
effectively touching them as if they were just created.

Issue: #22746
2022-03-23 14:41:34 +01:00

14 lines
384 B
CMake

include(${CMAKE_CURRENT_LIST_DIR}/mtime-tests.cmake)
set(DECOMPRESSION_OPTIONS --touch)
include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
foreach(file ${CHECK_FILES})
file(TIMESTAMP ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file} MTIME UTC)
if(MTIME STREQUAL ARCHIVE_MTIME_RFC3339)
message(FATAL_ERROR
"File has unexpected timestamp ${MTIME}")
endif()
endforeach()