From: Rafael Kitover Date: Tue, 23 May 2023 21:42:12 +0000 (+0000) Subject: fix: Quiet cmake warning for extracted timestamps X-Git-Tag: v4.8.2~9^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0947ca3983c53ef7cf3a7882ec3b4077c8f0dfbf;p=thirdparty%2Fccache.git fix: Quiet cmake warning for extracted timestamps For zstd and hiredis downloaded from the Internet, set cmake policy CMP0135 to NEW to set the timestamps of extracted archive members to the time of extraction to suppress the cmake dev warning on newer versions of cmake. Check that the policy exists so that this works on older versions of cmake. Signed-off-by: Rafael Kitover --- diff --git a/cmake/Findhiredis.cmake b/cmake/Findhiredis.cmake index 8c01058c2..894fd335e 100644 --- a/cmake/Findhiredis.cmake +++ b/cmake/Findhiredis.cmake @@ -2,6 +2,11 @@ if(hiredis_FOUND) return() endif() +if(POLICY CMP0135) + # Set timestamps on extracted files to time of extraction. + cmake_policy(SET CMP0135 NEW) +endif() + set(hiredis_FOUND FALSE) if(HIREDIS_FROM_INTERNET AND NOT HIREDIS_FROM_INTERNET STREQUAL "AUTO") diff --git a/cmake/Findzstd.cmake b/cmake/Findzstd.cmake index ff247634e..dd18b7722 100644 --- a/cmake/Findzstd.cmake +++ b/cmake/Findzstd.cmake @@ -2,6 +2,11 @@ if(zstd_FOUND) return() endif() +if(POLICY CMP0135) + # Set timestamps on extracted files to time of extraction. + cmake_policy(SET CMP0135 NEW) +endif() + set(zstd_FOUND FALSE) if(ZSTD_FROM_INTERNET AND NOT ZSTD_FROM_INTERNET STREQUAL "AUTO")