Skip to content

Commit

Permalink
COMP: Set DOWNLOAD_EXTRACT_TIMESTAMP to TRUE for Windows wrapping
Browse files Browse the repository at this point in the history
Set `DOWNLOAD_EXTRACT_TIMESTAMP` to `TRUE` for wrapping modules in
Windows, following commit 0bfebf5.

Take advantage of the commit to define the flag at a single location.

Fixes:
```
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  Wrapping/Generators/SwigInterface/CMakeLists.txt:66 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.
```

raised for example in:
https://open.cdash.org/build/8293984/configure
  • Loading branch information
jhlegarreta committed Nov 24, 2022
1 parent 0bfebf5 commit b50e4f4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Wrapping/Generators/SwigInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ else()
set(SWIG_VERSION ${ITK_SWIG_VERSION})

include(ExternalProject)

if(${CMAKE_VERSION} VERSION_LESS 3.24)
set(download_extract_timestamp_flag)
else()
set(download_extract_timestamp_flag DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
endif()

if(WIN32)
# If we are building ITK
if(ITK_BINARY_DIR)
Expand All @@ -70,6 +77,7 @@ else()
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
${download_extract_timestamp_flag}
)
set(SWIG_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_VERSION})
else()
Expand Down Expand Up @@ -138,11 +146,6 @@ else()
install
)
endif()
if(${CMAKE_VERSION} VERSION_LESS 3.24)
set(download_extract_timestamp_flag)
else()
set(download_extract_timestamp_flag DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
endif()
set(pcre_hash "abac4c4f9df9e61d7d7761a9c50843882611752e1df0842a54318f358c28f5953025eba2d78997d21ee690756b56cc9f1c04a5ed591dd60654cc78ba16d9ecfb")
ExternalProject_Add(PCRE
URL "https://data.kitware.com/api/v1/file/hashsum/sha512/${pcre_hash}/download"
Expand Down Expand Up @@ -246,11 +249,6 @@ message(STATUS \"Swig configure successfully completed.\")
)
endif()

if(${CMAKE_VERSION} VERSION_LESS 3.24)
set(download_extract_timestamp_flag)
else()
set(download_extract_timestamp_flag DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
endif()
ExternalProject_Add(swig
URL "https://data.kitware.com/api/v1/file/hashsum/sha512/${swig_hash}/download"
URL_HASH SHA512=${swig_hash}
Expand Down

0 comments on commit b50e4f4

Please sign in to comment.