Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(downloadCEF version download_dir)
- set(CEF_DIST "cef_binary_${version}_linux64")
- set(CEF_DOWNLOAD_DIR "${download_dir}")
- set(CEF_ROOT "${CEF_DOWNLOAD_DIR}/cef" CACHE INTERNAL "CEF_ROOT")
- if(CleanCefDownload)
- execute_process(
- COMMAND rm -rf "${CEF_DOWNLOAD_DIR}"
- )
- endif()
- if(CleanCefBuild)
- execute_process(
- COMMAND rm -rf "${CEF_ROOT}"
- )
- endif()
- if(NOT IS_DIRECTORY "${CEF_ROOT}")
- execute_process(
- COMMAND mkdir -p "${CEF_ROOT}"
- )
- endif()
- set(CEF_DOWNLOAD_FILENAME "${CEF_DIST}.tar.bz2")
- set(CEF_DOWNLOAD_PATH "${CEF_DOWNLOAD_DIR}/cef.tar.bz2")
- set(CEF_DOWNLOAD_URL "http://opensource.spotify.com/cefbuilds/${CEF_DOWNLOAD_FILENAME}")
- #download CEF bin...
- if(IS_DIRECTORY "${CEF_DOWNLOAD_DIR}")
- if(NOT IS_DIRECTORY "${CEF_ROOT}")
- if(NOT EXISTS "${CEF_DOWNLOAD_PATH}")
- message(STATUS "Downloading ${CEF_DOWNLOAD_FILENAME}...")
- file(
- DOWNLOAD "${CEF_DOWNLOAD_URL}" "${CEF_DOWNLOAD_PATH}"
- SHOW_PROGRESS
- )
- endif()
- endif()
- endif()
- #execute_process(
- # COMMAND wget "${CEF_DOWNLOAD_URL}" -O "${CEF_DOWNLOAD_PATH}"
- #)
- #extract
- file(GLOB CEF_COSE "${CEF_ROOT}/CMakeLists.txt")
- if(NOT NoExtractCefBin OR NOT "${CEF_COSE}")
- message(STATUS "Extracting Chromium Embedded Framework...")
- execute_process(
- COMMAND rm -rf "${CEF_ROOT}/*"
- COMMAND tar -xf "${CEF_DOWNLOAD_DIR}/cef.tar.bz2" -C "${CEF_ROOT}" --strip-components=1
- )
- endif()
- set(IS_PATCHED "${CEF_ROOT}/PATCHED")
- if(NOT EXISTS "${IS_PATCHED}")
- message(STATUS "Patching CEF sources")
- execute_process(
- COMMAND sh "${CMAKE_MODULE_PATH}/patchCmake.sh" "${CEF_ROOT}" && touch "${IS_PATCHED}"
- )
- endif()
- endfunction()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement