DependencyConfiguration.cmake 1.7 KB

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