WebClientResources.cmake 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. include(WebClientVariables)
  2. set(WEB_CLIENT_VERSTR "${WEB_CLIENT_VERSION_NR}-${WEB_CLIENT_VERSION}")
  3. option(SKIP_WEB_CLIENT "Skip downloading the web client" OFF)
  4. set(WEB_CLIENT_FILE plex-web-client-pmp-${WEB_CLIENT_VERSTR}.tbz2)
  5. set(WEB_CLIENT_DIR ${CMAKE_BINARY_DIR}/web-client-${WEB_CLIENT_VERSTR})
  6. message(STATUS "web-client version: ${WEB_CLIENT_VERSTR}")
  7. if(NOT SKIP_WEB_CLIENT)
  8. set(WEB_CLIENT_URL https://nightlies.plex.tv/directdl/plex-dependencies/plex-web-client-plexmediaplayer/${WEB_CLIENT_BUILDNR}/${WEB_CLIENT_FILE})
  9. if(NOT EXISTS ${WEB_CLIENT_DIR}/index.html)
  10. if(NOT EXISTS ${CMAKE_BINARY_DIR}/${WEB_CLIENT_FILE})
  11. safe_download(${WEB_CLIENT_URL}
  12. FILENAME ${CMAKE_BINARY_DIR}/${WEB_CLIENT_FILE}
  13. SHOW_PROGRESS
  14. SHA1 ${WEB_CLIENT_HASH}
  15. )
  16. endif()
  17. file(MAKE_DIRECTORY ${WEB_CLIENT_DIR})
  18. message(STATUS "Unpacking web-client...")
  19. execute_process(
  20. COMMAND ${CMAKE_COMMAND} -E tar -xjf ${CMAKE_BINARY_DIR}/${WEB_CLIENT_FILE}
  21. WORKING_DIRECTORY ${WEB_CLIENT_DIR}
  22. RESULT_VARIABLE STATUS
  23. )
  24. if(NOT STATUS EQUAL 0)
  25. message(FATAL_ERROR "Failed to unpack web-client")
  26. file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/${WEB_CLIENT_FILE})
  27. endif()
  28. file(REMOVE ${CMAKE_BINARY_DIR}/${WEB_CLIENT_FILE})
  29. endif()
  30. else(NOT SKIP_WEB_CLIENT)
  31. message(WARNING "Skipping web-client, you will not a functioning end product")
  32. endif(NOT SKIP_WEB_CLIENT)