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 AND NOT DISABLE_BUNDLED_DEPS)
  5. download_deps(
  6. "plexmediaplayer-dependencies"
  7. ARTIFACTNAME konvergo-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(APPLE AND NOT DISABLE_BUNDLED_DEPS)
  15. if(WIN32)
  16. download_deps(
  17. "plexmediaplayer-windows-dependencies"
  18. DIRECTORY dir
  19. ARTIFACTNAME konvergo-depends-windows
  20. ARCHSTR mingw32-x86_64
  21. DEPHASH_VAR DEPS_HASH
  22. )
  23. if(NOT EXISTS ${dir}/lib/mpv.lib)
  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)