diff options
author | Brad King <brad.king@kitware.com> | 2010-06-15 18:02:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-06-15 18:02:11 (GMT) |
commit | 7c9f39d4babf9015bc891f13845a4a2a7d4bf280 (patch) | |
tree | 646ae15829c533448decc424e787cd4955997cc8 /Modules | |
parent | f6b4de1e53a4cec387203f85c97d5353751aec12 (diff) | |
parent | cd3d60b8b5ae89b9c352b9ba022ae04ab97ea0e4 (diff) | |
download | CMake-7c9f39d4babf9015bc891f13845a4a2a7d4bf280.zip CMake-7c9f39d4babf9015bc891f13845a4a2a7d4bf280.tar.gz CMake-7c9f39d4babf9015bc891f13845a4a2a7d4bf280.tar.bz2 |
Merge branch 'fix-issue-10346'
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/ExternalProject.cmake | 15 |
1 files changed, 14 insertions, 1 deletions
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 |