WebClientResources.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. include(WebClientVariables)
  2. option(SKIP_WEB_CLIENT "Skip downloading the web client" OFF)
  3. if(NOT SKIP_WEB_CLIENT)
  4. set(WEB_CLIENT_CPP plex-web-client-konvergo-${WEB_CLIENT_VERSION}.cpp)
  5. set(WEB_CLIENT_URL https://nightlies.plex.tv/directdl/plex-dependencies/plex-web-client-plexmediaplayer/${WEB_CLIENT_BUILDNR}/plex-web-client-konvergo-${WEB_CLIENT_VERSION}.cpp.tbz2)
  6. message(STATUS "web-client version: ${WEB_CLIENT_VERSION}")
  7. set(LOCAL_WEB_CLIENT false)
  8. if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2")
  9. file(SHA1 "${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2" EXISTING_HASH)
  10. if("${EXISTING_HASH}" STREQUAL "${WEB_CLIENT_HASH}")
  11. set(LOCAL_WEB_CLIENT true)
  12. endif("${EXISTING_HASH}" STREQUAL "${WEB_CLIENT_HASH}")
  13. endif(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2")
  14. if(NOT LOCAL_WEB_CLIENT)
  15. file(
  16. DOWNLOAD ${WEB_CLIENT_URL} ${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2
  17. EXPECTED_HASH SHA1=${WEB_CLIENT_HASH}
  18. TIMEOUT 100
  19. SHOW_PROGRESS
  20. )
  21. endif(NOT LOCAL_WEB_CLIENT)
  22. add_custom_command(
  23. OUTPUT ${WEB_CLIENT_CPP}
  24. COMMAND ${CMAKE_COMMAND} -E tar xjf ${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2
  25. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2
  26. COMMENT "Unpacking: ${WEB_CLIENT_CPP}.tbz2"
  27. )
  28. add_custom_target(UnpackWebClientResource
  29. DEPENDS ${WEB_CLIENT_CPP}
  30. )
  31. else(NOT SKIP_WEB_CLIENT)
  32. message(WARNING "Skipping web-client, you will not a functioning end product")
  33. endif(NOT SKIP_WEB_CLIENT)