CMakeLists.txt 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
  2. # use a toolchain file if any for Embedded
  3. if (EXISTS "${CMAKE_SOURCE_DIR}/toolchain.cmake")
  4. set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/toolchain.cmake")
  5. endif()
  6. project(PlexMediaPlayer CXX C)
  7. # we want this to be able to run clang-tidy
  8. set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
  9. option(OPENELEC "Make an OpenELEC build" OFF)
  10. option(LINUX_DBUS "Enable D-Bus power management" OFF)
  11. if(OPENELEC)
  12. set(LINUX_DBUS ON)
  13. add_definitions(-DKONVERGO_OPENELEC=1)
  14. Message(STATUS "Making an OpenELEC build")
  15. endif(OPENELEC)
  16. if(LINUX_DBUS)
  17. add_definitions(-DLINUX_DBUS=1)
  18. Message(STATUS "Enabling D-Bus power management")
  19. endif(LINUX_DBUS)
  20. if(BUILD_TARGET STREQUAL "RPI")
  21. add_definitions(-DTARGET_RPI=1)
  22. set(RPI_LIBS bcm_host)
  23. Message(STATUS "Build for Raspberry PI target")
  24. endif(BUILD_TARGET STREQUAL "RPI")
  25. option(ENABLE_HELPER "Enable PMP Helper" ON)
  26. if (ENABLE_HELPER)
  27. add_definitions(-DENABLE_HELPER=1)
  28. endif(ENABLE_HELPER)
  29. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  30. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  31. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
  32. macro(set_policy _POLICY _VALUE)
  33. if(POLICY ${_POLICY})
  34. cmake_policy(SET ${_POLICY} ${_VALUE})
  35. endif()
  36. endmacro()
  37. set_policy(CMP0020 NEW)
  38. set_policy(CMP0017 NEW)
  39. set_policy(CMP0058 NEW)
  40. set_policy(CMP0026 OLD)
  41. include(utils)
  42. include(CompilerFlags)
  43. include(DependencyConfiguration)
  44. include(QtConfiguration)
  45. include(WebClientResources)
  46. include(VersionConfiguration)
  47. include(NameConfiguration)
  48. include(PlayerConfiguration)
  49. include(InputConfiguration)
  50. include(FindBreakpad)
  51. include(BreakpadSymbols)
  52. include(ClangTidy)
  53. add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
  54. if(APPLE)
  55. include(AppleConfiguration)
  56. elseif(WIN32)
  57. include(Win32Configuration)
  58. elseif(UNIX AND (NOT APPLE))
  59. include(LinuxConfiguration)
  60. endif(APPLE)
  61. if (Qt5_POSITION_INDEPENDENT_CODE)
  62. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  63. endif(Qt5_POSITION_INDEPENDENT_CODE)
  64. add_subdirectory(external)
  65. add_subdirectory(src)
  66. include(CPackConfiguration)
  67. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS PlexMediaPlayer PMPHelper)