瀏覽代碼

Merge topic 'ExternalProject-IS_NEWER_THAN'

d73fc5dd2a ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks

Acked-by: Kitware Robot <[email protected]>
Tested-by: buildbot <[email protected]>
Merge-request: !6847
Craig Scott 4 年之前
父節點
當前提交
055d574084
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Modules/ExternalProject.cmake

+ 4 - 2
Modules/ExternalProject.cmake

@@ -1302,7 +1302,8 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
 
   file(WRITE ${script_filename}
 "
-if(NOT \"${gitclone_infofile}\" IS_NEWER_THAN \"${gitclone_stampfile}\")
+if(EXISTS \"${gitclone_stampfile}\" AND EXISTS \"${gitclone_infofile}\" AND
+  \"${gitclone_stampfile}\" IS_NEWER_THAN \"${gitclone_infofile}\")
   message(STATUS \"Avoiding repeated git clone, stamp file is up to date: '${gitclone_stampfile}'\")
   return()
 endif()
@@ -1378,7 +1379,8 @@ function(_ep_write_hgclone_script script_filename source_dir hg_EXECUTABLE hg_re
   endif()
   file(WRITE ${script_filename}
 "
-if(NOT \"${hgclone_infofile}\" IS_NEWER_THAN \"${hgclone_stampfile}\")
+if(EXISTS \"${hgclone_stampfile}\" AND EXISTS \"${hgclone_infofile}\" AND
+  \"${hgclone_stampfile}\" IS_NEWER_THAN \"${hgclone_infofile}\")
   message(STATUS \"Avoiding repeated hg clone, stamp file is up to date: '${hgclone_stampfile}'\")
   return()
 endif()