Skip to content

Commit 7c781f7

Browse files
committed
COMP: Add DOWNLOAD_EXTRACT_TIMESTAMP flag when needed
Throws a warning with newer CMake.
1 parent 5dab4a6 commit 7c781f7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Superbuild/External-ClangFormat.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ else()
2626
# `git config clangFormat.binary /path/to/clang-format`.
2727
endif()
2828

29+
# Set the timestamps of the extracted files to their archived
30+
# timestamps.
31+
if(${CMAKE_VERSION} VERSION_LESS 3.24)
32+
set(download_extract_timestamp_flag)
33+
else()
34+
set(download_extract_timestamp_flag DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
35+
endif()
36+
2937
if(NOT TARGET ClangFormat AND _clang_format_hash)
3038
ExternalProject_add(ClangFormat
3139
URL ${_clang_format_url}
@@ -39,5 +47,6 @@ if(NOT TARGET ClangFormat AND _clang_format_hash)
3947
LOG_TEST 0
4048
LOG_INSTALL 0
4149
INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/ITKClangFormatConfig.cmake
50+
${download_extract_timestamp_flag}
4251
)
4352
endif()

0 commit comments

Comments
 (0)