aboutsummaryrefslogtreecommitdiff
path: root/third-party/cmake/DownloadAndExtractFile.cmake
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-11-07 08:50:13 -0500
committerJohn Szakmeister <john@szakmeister.net>2014-11-07 08:50:13 -0500
commit07775c07c0c269fe70effa0489f65fb98143c12c (patch)
tree1069db9bbfec32495092cff9e56865d9491f62c1 /third-party/cmake/DownloadAndExtractFile.cmake
parent6f8c916d8408a89996ce8fbd86e48194b5a46b3e (diff)
parent90658982644b76a9e8e4abfbcd16450df26b0a32 (diff)
downloadrneovim-07775c07c0c269fe70effa0489f65fb98143c12c.tar.gz
rneovim-07775c07c0c269fe70effa0489f65fb98143c12c.tar.bz2
rneovim-07775c07c0c269fe70effa0489f65fb98143c12c.zip
Merge pull request #1411 from xu-cheng/homebrew-formula
Let homebrew handle external resources download
Diffstat (limited to 'third-party/cmake/DownloadAndExtractFile.cmake')
-rw-r--r--third-party/cmake/DownloadAndExtractFile.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/third-party/cmake/DownloadAndExtractFile.cmake b/third-party/cmake/DownloadAndExtractFile.cmake
index 14873793d9..43100c0431 100644
--- a/third-party/cmake/DownloadAndExtractFile.cmake
+++ b/third-party/cmake/DownloadAndExtractFile.cmake
@@ -18,6 +18,15 @@ if(NOT DEFINED TARGET)
message(FATAL_ERROR "TARGET must be defined.")
endif()
+set(SRC_DIR ${PREFIX}/src/${TARGET})
+
+# Check whether the source has been downloaded. If true, skip it.
+# Useful for external downloads like homebrew.
+if(EXISTS "${SRC_DIR}" AND IS_DIRECTORY "${SRC_DIR}")
+ message(STATUS "${SRC_DIR} is found, skipping download and extraction. ")
+ return()
+endif()
+
# Taken from ExternalProject_Add. Let's hope we can drop this one day when
# ExternalProject_Add allows you to disable SHOW_PROGRESS on the file download.
if(TIMEOUT)
@@ -71,8 +80,6 @@ endif()
message(STATUS "downloading... done")
-set(SRC_DIR ${PREFIX}/src/${TARGET})
-
# Slurped from a generated extract-TARGET.cmake file.
message(STATUS "extracting...
src='${file}'