DependencyConfiguration.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. find_package(PkgConfig)
  2. include(FetchDependencies)
  3. if(DEPENDENCY_TOKEN)
  4. set(DEPENDCY_FOLDER "")
  5. if(OPENELEC)
  6. set(DEPENDCY_FOLDER plexmediaplayer-openelec-codecs)
  7. elseif(APPLE OR WIN32)
  8. set(DEPENDCY_FOLDER plexmediaplayer-dependencies-codecs)
  9. endif()
  10. if(NOT (DEPENDCY_FOLDER STREQUAL ""))
  11. download_deps(
  12. "${DEPENDCY_FOLDER}"
  13. ARTIFACTNAME konvergo-codecs-depends
  14. DIRECTORY dir
  15. DEPHASH_VAR DEPS_HASH
  16. DYLIB_SCRIPT_PATH ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py
  17. TOKEN ${DEPENDENCY_TOKEN}
  18. )
  19. message("dependencies are: ${dir}")
  20. set(DEFAULT_ROOT ${dir})
  21. endif()
  22. endif(DEPENDENCY_TOKEN)
  23. if(WIN32)
  24. message("dependencies are: ${dir}")
  25. set(DEFAULT_ROOT "${dir}")
  26. download_deps(
  27. "windows-redist"
  28. DIRECTORY VCREDIST_DIR
  29. ARTIFACTNAME windows-redist-2015
  30. ARCHSTR windows-x86_x64
  31. )
  32. endif(WIN32)
  33. set(DEPENDENCY_ROOT ${DEFAULT_ROOT} CACHE PATH "Path where the deps are located")
  34. if(IS_DIRECTORY ${DEPENDENCY_ROOT})
  35. message(STATUS "Going to use bundled deps in directory: ${DEPENDENCY_ROOT}")
  36. list(APPEND CMAKE_FIND_ROOT_PATH ${DEPENDENCY_ROOT})
  37. list(APPEND CMAKE_PREFIX_PATH ${DEPENDENCY_ROOT})
  38. set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)
  39. set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
  40. include_directories(${DEPENDENCY_ROOT}/include)
  41. else(IS_DIRECTORY ${DEPENDENCY_ROOT})
  42. message(STATUS "Not using bundled deps")
  43. endif(IS_DIRECTORY ${DEPENDENCY_ROOT})
  44. find_package(Threads REQUIRED)
  45. find_package(PythonInterp REQUIRED)