[Cmake-commits] CMake branch, next, updated. v2.8.1-1362-ge44cda2

David Cole david.cole at kitware.com
Wed Jun 9 18:30:52 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e44cda2247d68fdbcfd2b9376cc66125fbdb2261 (commit)
       via  cd3d60b8b5ae89b9c352b9ba022ae04ab97ea0e4 (commit)
      from  6c4848494ab17207a73c94aa1b87e0bff92e2761 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e44cda2247d68fdbcfd2b9376cc66125fbdb2261
commit e44cda2247d68fdbcfd2b9376cc66125fbdb2261
Merge: 6c48484 cd3d60b
Author: David Cole <david.cole at kitware.com>
Date:   Wed Jun 9 18:28:23 2010 -0400

    Merge branch 'fix-issue-10346' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd3d60b8b5ae89b9c352b9ba022ae04ab97ea0e4
commit cd3d60b8b5ae89b9c352b9ba022ae04ab97ea0e4
Author: David Cole <david.cole at kitware.com>
Date:   Wed Jun 9 18:22:58 2010 -0400

    Fix issue #10346. Error if SOURCE_DIR is empty.
    
    See http://public.kitware.com/Bug/view.php?id=10346.
    The proposed patch for the issue could not be applied as is
    because the SOURCE_DIR always exists for an ExternalProject_Add
    call by the time we get to the place to emit the potential error.
    
    The fix is to emit the error only if the source dir is empty.
    By which, I mean devoid of files and subdirectories. If
    SOURCE_DIR is used by itself, without any DOWNLOAD_COMMAND
    or repository info, then it implies that the SOURCE_DIR is ready
    to build as-is without need for a download step. Clearly, if it
    is empty, then it is not ready to build as is. So complain if
    the SOURCE_DIR is empty.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 15749f2..d0845e6 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -738,6 +738,16 @@ function(_ep_get_git_version git_EXECUTABLE git_version_var)
 endfunction()
 
 
+function(_ep_is_dir_empty dir empty_var)
+  file(GLOB gr "${dir}/*")
+  if("${gr}" STREQUAL "")
+    set(${empty_var} 1 PARENT_SCOPE)
+  else()
+    set(${empty_var} 0 PARENT_SCOPE)
+  endif()
+endfunction()
+
+
 function(_ep_add_download_command name)
   ExternalProject_Get_Property(${name} source_dir stamp_dir download_dir tmp_dir)
 
@@ -890,7 +900,10 @@ function(_ep_add_download_command name)
       list(APPEND cmd ${CMAKE_COMMAND} -P ${stamp_dir}/extract-${name}.cmake)
     endif()
   else()
-    message(SEND_ERROR "error: no download info for '${name}' -- please specify existing SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY or DOWNLOAD_COMMAND")
+    _ep_is_dir_empty("${source_dir}" empty)
+    if(${empty})
+      message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND")
+    endif()
   endif()
 
   ExternalProject_Add_Step(${name} download

-----------------------------------------------------------------------

Summary of changes:
 Modules/ExternalProject.cmake |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list