DependencyConfiguration.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. find_package(PkgConfig)
  2. option(DISABLE_BUNDLED_DEPS "Disable the bundled deps on certain platforms" OFF)
  3. include(FetchDependencies)
  4. if(NOT DISABLE_BUNDLED_DEPS)
  5. set(DEPENDCY_FOLDER "")
  6. if(OPENELEC)
  7. set(DEPENDCY_FOLDER plexmediaplayer-openelec-codecs)
  8. elseif(APPLE OR WIN32)
  9. set(DEPENDCY_FOLDER plexmediaplayer-dependencies-codecs)
  10. endif()
  11. if(NOT (DEPENDCY_FOLDER STREQUAL ""))
  12. download_deps(
  13. "${DEPENDCY_FOLDER}"
  14. ARTIFACTNAME konvergo-codecs-depends
  15. DIRECTORY dir
  16. DEPHASH_VAR DEPS_HASH
  17. DYLIB_SCRIPT_PATH ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py
  18. )
  19. message("dependencies are: ${dir}")
  20. set(DEFAULT_ROOT ${dir})
  21. endif()
  22. endif(NOT DISABLE_BUNDLED_DEPS)
  23. if(WIN32)
  24. if(NOT EXISTS ${dir}/lib/mpv.lib)
  25. if(ARCHSTR STREQUAL "windows-x86_64")
  26. set(ENV{PMP_VC_ARCH} "amd64")
  27. set(ENV{PMP_LIB_ARCH} "X64")
  28. else()
  29. set(ENV{PMP_VC_ARCH} "x86")
  30. set(ENV{PMP_LIB_ARCH} "x86")
  31. endif()
  32. execute_process(
  33. COMMAND ${PROJECT_SOURCE_DIR}/scripts/make_mpv_lib.bat
  34. WORKING_DIRECTORY ${dir}
  35. )
  36. endif(NOT EXISTS ${dir}/lib/mpv.lib)
  37. message("dependencies are: ${dir}")
  38. set(DEFAULT_ROOT "${dir}")
  39. download_deps(
  40. "windows-redist"
  41. DIRECTORY VCREDIST_DIR
  42. ARTIFACTNAME windows-redist-2015
  43. ARCHSTR windows-x86_x64
  44. )
  45. endif(WIN32)
  46. set(DEPENDENCY_ROOT ${DEFAULT_ROOT} CACHE PATH "Path where the deps are located")
  47. if(IS_DIRECTORY ${DEPENDENCY_ROOT})
  48. message(STATUS "Going to use bundled deps in directory: ${DEPENDENCY_ROOT}")
  49. list(APPEND CMAKE_FIND_ROOT_PATH ${DEPENDENCY_ROOT})
  50. list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCY_ROOT})
  51. set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)
  52. set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
  53. include_directories(${DEPENDENCY_ROOT}/include)
  54. else(IS_DIRECTORY ${DEPENDENCY_ROOT})
  55. message(STATUS "Not using bundled deps")
  56. endif(IS_DIRECTORY ${DEPENDENCY_ROOT})
  57. find_package(Threads REQUIRED)
  58. find_package(PythonInterp REQUIRED)