aboutsummaryrefslogtreecommitdiff
path: root/cmake.deps/cmake
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-03-23 08:37:00 +0100
committerdundargoc <gocdundar@gmail.com>2023-03-28 16:18:13 +0200
commit81abd5c5c7ad0d05adecba66dd1b8fc7b238201a (patch)
tree90728889810011ea12874af2218f0666b8ba6d6d /cmake.deps/cmake
parentb02ee27e51e32590ff61b7bc1f3559b087193f79 (diff)
downloadrneovim-81abd5c5c7ad0d05adecba66dd1b8fc7b238201a.tar.gz
rneovim-81abd5c5c7ad0d05adecba66dd1b8fc7b238201a.tar.bz2
rneovim-81abd5c5c7ad0d05adecba66dd1b8fc7b238201a.zip
build: download wintools executables separately
The wintools executables are stored in a zip file, making it inconvenient to bump these during releases. Instead, unpack the executables in the deps repository and download each executable separately.
Diffstat (limited to 'cmake.deps/cmake')
-rw-r--r--cmake.deps/cmake/GetBinaryDeps.cmake32
1 files changed, 25 insertions, 7 deletions
diff --git a/cmake.deps/cmake/GetBinaryDeps.cmake b/cmake.deps/cmake/GetBinaryDeps.cmake
index bac7dff919..48e66363d3 100644
--- a/cmake.deps/cmake/GetBinaryDeps.cmake
+++ b/cmake.deps/cmake/GetBinaryDeps.cmake
@@ -10,17 +10,10 @@ function(GetBinaryDep)
"INSTALL_COMMAND"
${ARGN})
- if(NOT _gettool_TARGET OR NOT _gettool_INSTALL_COMMAND)
- message(FATAL_ERROR "Must pass INSTALL_COMMAND and TARGET")
- endif()
-
string(TOUPPER "${_gettool_TARGET}_URL" URL_VARNAME)
string(TOUPPER "${_gettool_TARGET}_SHA256" HASH_VARNAME)
set(URL ${${URL_VARNAME}})
set(HASH ${${HASH_VARNAME}})
- if(NOT URL OR NOT HASH )
- message(FATAL_ERROR "${URL_VARNAME} and ${HASH_VARNAME} must be set")
- endif()
ExternalProject_Add(${_gettool_TARGET}
URL ${URL}
@@ -33,3 +26,28 @@ function(GetBinaryDep)
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
COMMAND "${_gettool_INSTALL_COMMAND}")
endfunction()
+
+# Download executable and move it to DEPS_BIN_DIR
+function(GetExecutable)
+ cmake_parse_arguments(ARG
+ ""
+ "TARGET"
+ ""
+ ${ARGN})
+
+ string(TOUPPER "${ARG_TARGET}_URL" URL_VARNAME)
+ string(TOUPPER "${ARG_TARGET}_SHA256" HASH_VARNAME)
+ set(URL ${${URL_VARNAME}})
+ set(HASH ${${HASH_VARNAME}})
+
+ ExternalProject_Add(${ARG_TARGET}
+ URL ${URL}
+ URL_HASH SHA256=${HASH}
+ DOWNLOAD_NO_PROGRESS TRUE
+ DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}
+ DOWNLOAD_NO_EXTRACT TRUE
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy <DOWNLOADED_FILE> ${DEPS_BIN_DIR})
+endfunction()