Advertisement
Guest User

Untitled

a guest
Jun 30th, 2019
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.10 KB | None | 0 0
  1. function(downloadCEF version download_dir)
  2.     set(CEF_DIST "cef_binary_${version}_linux64")
  3.     set(CEF_DOWNLOAD_DIR "${download_dir}")
  4.     set(CEF_ROOT "${CEF_DOWNLOAD_DIR}/cef" CACHE INTERNAL "CEF_ROOT")
  5.  
  6.     if(CleanCefDownload)
  7.         execute_process(
  8.             COMMAND rm -rf "${CEF_DOWNLOAD_DIR}"
  9.         )
  10.     endif()
  11.     if(CleanCefBuild)
  12.         execute_process(
  13.             COMMAND rm -rf "${CEF_ROOT}"
  14.         )
  15.     endif()
  16.  
  17.     if(NOT IS_DIRECTORY "${CEF_ROOT}")
  18.         execute_process(
  19.             COMMAND mkdir -p "${CEF_ROOT}"
  20.         )
  21.     endif()
  22.  
  23.     set(CEF_DOWNLOAD_FILENAME "${CEF_DIST}.tar.bz2")
  24.     set(CEF_DOWNLOAD_PATH "${CEF_DOWNLOAD_DIR}/cef.tar.bz2")
  25.     set(CEF_DOWNLOAD_URL "http://opensource.spotify.com/cefbuilds/${CEF_DOWNLOAD_FILENAME}")
  26.  
  27.     #download CEF bin...
  28.     if(IS_DIRECTORY "${CEF_DOWNLOAD_DIR}")
  29.         if(NOT IS_DIRECTORY "${CEF_ROOT}")
  30.             if(NOT EXISTS "${CEF_DOWNLOAD_PATH}")
  31.                 message(STATUS "Downloading ${CEF_DOWNLOAD_FILENAME}...")
  32.                 file(
  33.                         DOWNLOAD "${CEF_DOWNLOAD_URL}" "${CEF_DOWNLOAD_PATH}"
  34.                         SHOW_PROGRESS
  35.                 )
  36.             endif()
  37.         endif()
  38.     endif()
  39.  
  40.            #execute_process(
  41.            #     COMMAND wget  "${CEF_DOWNLOAD_URL}"  -O "${CEF_DOWNLOAD_PATH}"
  42.             #)
  43.  
  44.             #extract
  45.         file(GLOB CEF_COSE "${CEF_ROOT}/CMakeLists.txt")
  46.         if(NOT NoExtractCefBin OR NOT "${CEF_COSE}")
  47.               message(STATUS "Extracting Chromium Embedded Framework...")
  48.                 execute_process(
  49.                        COMMAND rm -rf "${CEF_ROOT}/*"
  50.                        COMMAND tar -xf "${CEF_DOWNLOAD_DIR}/cef.tar.bz2" -C "${CEF_ROOT}" --strip-components=1
  51.                )
  52.         endif()
  53.         set(IS_PATCHED "${CEF_ROOT}/PATCHED")
  54.         if(NOT EXISTS "${IS_PATCHED}")
  55.        message(STATUS "Patching CEF sources")
  56.        execute_process(
  57.                 COMMAND  sh "${CMAKE_MODULE_PATH}/patchCmake.sh" "${CEF_ROOT}" && touch "${IS_PATCHED}"
  58.                 )
  59.         endif()
  60. endfunction()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement