smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

cmake issues with newer release #360

Closed smanders closed 2 years ago

smanders commented 2 years ago

buildpro updating from cmake 3.21.4 to 3.24.2 https://github.com/smanders/buildpro/issues/38

smanders commented 2 years ago

cmake -DXP_STEP=build /path/to/src generates new cmake warnings

CMake Warning (dev) at /usr/local/share/cmake-3.24/Modules/ExternalProject.cmake:3074 (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):
  /usr/local/share/cmake-3.24/Modules/ExternalProject.cmake:4170 (_ep_add_download_command)
  projects/patch.cmake:51 (ExternalProject_Add)
  modules/xpfunmac.cmake:215 (patch_patch)
  modules/xpfunmac.cmake:305 (ipPatch)
  _bldz/xpbase/pro/patch.cmake:3 (xpPatchProject)
  modules/macpro.cmake:195 (include)
  CMakeLists.txt:7 (proExecuteStep)
This warning is for project developers.  Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/local/share/cmake-3.24/Modules/ExternalProject.cmake:3074 (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):
  /usr/local/share/cmake-3.24/Modules/ExternalProject.cmake:4170 (_ep_add_download_command)
  modules/xpfunmac.cmake:251 (ExternalProject_Add)
  modules/xpfunmac.cmake:305 (ipPatch)
  _bldz/xpbase/pro/patch.cmake:71 (xpPatchProject)
  modules/macpro.cmake:192 (include)
  CMakeLists.txt:7 (proExecuteStep)
This warning is for project developers.  Use -Wno-dev to suppress it.

https://cmake.org/cmake/help/latest/module/ExternalProject.html#external-project-definition

smanders commented 2 years ago

in attempting to fix the issue above, I added the following to projects/patch.cmake

diff --git a/projects/patch.cmake b/projects/patch.cmake
index d16c5d3..2906357 100644
--- a/projects/patch.cmake
+++ b/projects/patch.cmake
@@ -36,7 +36,7 @@ function(patch_patch)
       xpGetArgValue(${PRO_PATCH} ARG DLURL_MSW VALUE dwnldUrl)
       xpGetArgValue(${PRO_PATCH} ARG DLMD5_MSW VALUE dwnldMd5)
       ExternalProject_Add(patch
-        DOWNLOAD_DIR ${DWNLD_DIR}
+        DOWNLOAD_DIR ${DWNLD_DIR} DOWNLOAD_EXTRACT_TIMESTAMP false
         URL ${dwnldUrl}  URL_MD5 ${dwnldMd5}
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ${CMAKE_COMMAND} -E copy_if_different
@@ -49,7 +49,7 @@ function(patch_patch)
       xpGetArgValue(${PRO_PATCH} ARG DLURL VALUE dwnldUrl)
       xpGetArgValue(${PRO_PATCH} ARG DLMD5 VALUE dwnldMd5)
       ExternalProject_Add(patch
-        DOWNLOAD_DIR ${DWNLD_DIR}
+        DOWNLOAD_DIR ${DWNLD_DIR} DOWNLOAD_EXTRACT_TIMESTAMP false
         URL ${dwnldUrl}  URL_MD5 ${dwnldMd5}
         CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${patchbld_DIR}
         BUILD_COMMAND   # use default

however, with this change patch fails to build

[  2%] Performing build step for 'patch'
/bpvol/externpro/_bldy/xpbase/Source/patch/build-aux/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>

changing DOWNLOAD_EXTRACT_TIMESTAMP from false to true and the patch build succeeds

smanders commented 2 years ago

completed with commit referenced above