aboutsummaryrefslogtreecommitdiff
path: root/third-party/cmake/DownloadAndExtractFile.cmake
diff options
context:
space:
mode:
authorFlorian Walch <florian@fwalch.com>2015-09-09 20:17:47 +0200
committerFlorian Walch <florian@fwalch.com>2015-09-09 20:22:00 +0200
commitde3689a46fe6b3d22a99275a08505169baa795e2 (patch)
treec3a4707b159919ea442f2fc262472ff8cc74ec52 /third-party/cmake/DownloadAndExtractFile.cmake
parent41446715b4cfe76083545090f00de429efc06833 (diff)
parentfd23d588fefab3ec38512a2135430445f28fe2c0 (diff)
downloadrneovim-de3689a46fe6b3d22a99275a08505169baa795e2.tar.gz
rneovim-de3689a46fe6b3d22a99275a08505169baa795e2.tar.bz2
rneovim-de3689a46fe6b3d22a99275a08505169baa795e2.zip
Merge #3307 'Travis: Rebuild third-party deps when updated'.
Diffstat (limited to 'third-party/cmake/DownloadAndExtractFile.cmake')
-rw-r--r--third-party/cmake/DownloadAndExtractFile.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/third-party/cmake/DownloadAndExtractFile.cmake b/third-party/cmake/DownloadAndExtractFile.cmake
index 305e37e7dd..24e431b5e5 100644
--- a/third-party/cmake/DownloadAndExtractFile.cmake
+++ b/third-party/cmake/DownloadAndExtractFile.cmake
@@ -22,12 +22,15 @@ 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}")
- file(GLOB EXISTED_FILES "${SRC_DIR}/*")
- if(EXISTED_FILES)
- message(STATUS "${SRC_DIR} is found and not empty, skipping download and extraction. ")
- return()
+if(USE_EXISTING_SRC_DIR)
+ if(EXISTS "${SRC_DIR}" AND IS_DIRECTORY "${SRC_DIR}")
+ file(GLOB EXISTED_FILES "${SRC_DIR}/*")
+ if(EXISTED_FILES)
+ message(STATUS "${SRC_DIR} is found and not empty, skipping download and extraction. ")
+ return()
+ endif()
endif()
+ message(FATAL_ERROR "USE_EXISTING_SRC_DIR set to ON, but '${SRC_DIR}' does not exist or is empty.")
endif()
# Taken from ExternalProject_Add. Let's hope we can drop this one day when