Skip to content

Commit

Permalink
Merge pull request #3763 from jhlegarreta/FixWinWrappingCMakePolicyWa…
Browse files Browse the repository at this point in the history
…rnings

COMP: Set `DOWNLOAD_EXTRACT_TIMESTAMP` to `TRUE` for Windows wrapping
  • Loading branch information
thewtex authored Nov 24, 2022
2 parents cfb5027 + dbdae24 commit 49bddfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Wrapping/Generators/CastXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ else()
if(ITK_BINARY_DIR)
itk_download_attempt_check(CastXML)
endif()
# Set the CMP0135 policy to NEW: set the timestamps of the
# extracted files to their extraction timestamps. Used for
# CMake-based projects such as CastXML.
cmake_policy(PUSH)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
Expand Down
21 changes: 11 additions & 10 deletions Wrapping/Generators/SwigInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ else()
set(SWIG_VERSION ${ITK_SWIG_VERSION})

include(ExternalProject)

# Set the timestamps of the extracted files to their archived
# timestamps. Necessary to build configure/autoconf-based
# projects such as SWIG and PCRE robustly.
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 +80,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 +149,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 +252,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 49bddfa

Please sign in to comment.