CMakeLists.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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_X11POWER "Enable non D-Bus screensaver management" OFF)
  11. if((NOT LINUX_X11POWER) AND (UNIX AND (NOT APPLE)))
  12. set(LINUX_DBUS ON)
  13. endif()
  14. if(OPENELEC)
  15. add_definitions(-DKONVERGO_OPENELEC=1)
  16. Message(STATUS "Making an OpenELEC build")
  17. endif(OPENELEC)
  18. if(BUILD_TARGET STREQUAL "RPI")
  19. add_definitions(-DTARGET_RPI=1)
  20. set(RPI_LIBS bcm_host)
  21. Message(STATUS "Build for Raspberry PI target")
  22. endif(BUILD_TARGET STREQUAL "RPI")
  23. option(ENABLE_HELPER "Enable PMP Helper" ON)
  24. if (ENABLE_HELPER)
  25. add_definitions(-DENABLE_HELPER=1)
  26. endif(ENABLE_HELPER)
  27. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  28. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  29. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
  30. macro(set_policy _POLICY _VALUE)
  31. if(POLICY ${_POLICY})
  32. cmake_policy(SET ${_POLICY} ${_VALUE})
  33. endif()
  34. endmacro()
  35. set_policy(CMP0020 NEW)
  36. set_policy(CMP0017 NEW)
  37. set_policy(CMP0058 NEW)
  38. set_policy(CMP0026 OLD)
  39. include(utils)
  40. include(CompilerFlags)
  41. include(WebClient)
  42. include(DependencyConfiguration)
  43. include(QtConfiguration)
  44. include(VersionConfiguration)
  45. include(NameConfiguration)
  46. include(PlayerConfiguration)
  47. include(InputConfiguration)
  48. include(FindBreakpad)
  49. include(BreakpadSymbols)
  50. include(ClangTidy)
  51. add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
  52. if(APPLE)
  53. include(AppleConfiguration)
  54. elseif(WIN32)
  55. include(Win32Configuration)
  56. elseif(UNIX AND (NOT APPLE))
  57. include(LinuxConfiguration)
  58. endif(APPLE)
  59. if (Qt5_POSITION_INDEPENDENT_CODE)
  60. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  61. endif(Qt5_POSITION_INDEPENDENT_CODE)
  62. add_subdirectory(external)
  63. add_subdirectory(src)
  64. include(CPackConfiguration)
  65. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS PlexMediaPlayer PMPHelper)