WebClientResources.cmake 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. TLS_VERIFY ON
  21. )
  22. endif(NOT LOCAL_WEB_CLIENT)
  23. add_custom_command(
  24. OUTPUT ${WEB_CLIENT_CPP}
  25. COMMAND ${CMAKE_COMMAND} -E tar xjf ${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2
  26. DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${WEB_CLIENT_CPP}.tbz2
  27. COMMENT "Unpacking: ${WEB_CLIENT_CPP}.tbz2"
  28. )
  29. add_custom_target(UnpackWebClientResource
  30. DEPENDS ${WEB_CLIENT_CPP}
  31. )
  32. else(NOT SKIP_WEB_CLIENT)
  33. message(WARNING "Skipping web-client, you will not a functioning end product")
  34. endif(NOT SKIP_WEB_CLIENT)