DependencyConfiguration.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. find_package(PkgConfig)
  2. option(DISABLE_BUNDLED_DEPS "Disable the bundled deps on certain platforms" OFF)
  3. include(FetchDependencies)
  4. if(APPLE AND NOT DISABLE_BUNDLED_DEPS)
  5. download_deps(
  6. "plexmediaplayer-dependencies"
  7. ARTIFACTNAME konvergo-depends
  8. DIRECTORY dir
  9. )
  10. message("dependencies are: ${dir}")
  11. set(DEFAULT_ROOT ${dir})
  12. endif(APPLE AND NOT DISABLE_BUNDLED_DEPS)
  13. if(WIN32)
  14. download_deps(
  15. "plexmediaplayer-windows-dependencies"
  16. DIRECTORY dir
  17. ARTIFACTNAME konvergo-depends-windows
  18. ARCHSTR mingw32-x86_64
  19. )
  20. if(NOT EXISTS ${dir}/lib/mpv.lib)
  21. execute_process(
  22. COMMAND LIB /def:bin\\mpv-1.def /out:lib\\mpv.lib /MACHINE:X64
  23. WORKING_DIRECTORY ${dir}
  24. )
  25. endif(NOT EXISTS ${dir}/lib/mpv.lib)
  26. message("dependencies are: ${dir}")
  27. set(DEFAULT_ROOT "${dir}")
  28. endif(WIN32)
  29. set(DEPENDENCY_ROOT ${DEFAULT_ROOT} CACHE PATH "Path where the deps are located")
  30. if(IS_DIRECTORY ${DEPENDENCY_ROOT})
  31. message(STATUS "Going to use bundled deps in directory: ${DEPENDENCY_ROOT}")
  32. list(APPEND CMAKE_FIND_ROOT_PATH ${DEPENDENCY_ROOT})
  33. list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCY_ROOT})
  34. set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)
  35. set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
  36. include_directories(${DEPENDENCY_ROOT}/include)
  37. else(IS_DIRECTORY ${DEPENDENCY_ROOT})
  38. message(STATUS "Not using bundled deps")
  39. endif(IS_DIRECTORY ${DEPENDENCY_ROOT})
  40. find_package(Threads REQUIRED)
  41. find_package(PythonInterp REQUIRED)
  42. # on windows we need to download the updater binary seperately
  43. if(WIN32)
  44. file(DOWNLOAD https://nightlies.plex.tv/directdl/plex-dependencies/konvergo-qt/updater.exe ${CMAKE_BINARY_DIR}/updater.exe
  45. SHOW_PROGRESS
  46. EXPECTED_HASH SHA1=d3b4f70d6542fa42c8edd2b9b93fd0916bf20f07
  47. TLS_VERIFY OFF)
  48. endif(WIN32)