DownloadExternals.cmake 939 B

123456789101112131415161718
  1. # This function downloads a binary library package from our external repo.
  2. # Params:
  3. # remote_path: path to the file to download, relative to the remote repository root
  4. # prefix_var: name of a variable which will be set with the path to the extracted contents
  5. function(download_bundled_external remote_path lib_name prefix_var)
  6. set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
  7. if (NOT EXISTS "${prefix}")
  8. message(STATUS "Downloading binaries for ${lib_name}...")
  9. file(DOWNLOAD
  10. https://github.com/yuzu-emu/ext-windows-bin/raw/master/${remote_path}${lib_name}.7z
  11. "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" SHOW_PROGRESS)
  12. execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z"
  13. WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
  14. endif()
  15. message(STATUS "Using bundled binaries at ${prefix}")
  16. set(${prefix_var} "${prefix}" PARENT_SCOPE)
  17. endfunction()