CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  8. include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  9. else()
  10. message(WARNING "Could not find conanbuildinfo.cmake - could be a problem! Make sure to run conan install first")
  11. endif()
  12. # we want this to be able to run clang-tidy
  13. set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
  14. option(OPENELEC "Make an OpenELEC build" OFF)
  15. option(LINUX_X11POWER "Enable non D-Bus screensaver management" OFF)
  16. if((NOT LINUX_X11POWER) AND (UNIX AND (NOT APPLE)))
  17. set(LINUX_DBUS ON)
  18. endif()
  19. if(OPENELEC)
  20. add_definitions(-DKONVERGO_OPENELEC=1)
  21. Message(STATUS "Making an OpenELEC build")
  22. endif(OPENELEC)
  23. if(BUILD_TARGET STREQUAL "RPI")
  24. add_definitions(-DTARGET_RPI=1)
  25. set(RPI_LIBS bcm_host)
  26. Message(STATUS "Build for Raspberry PI target")
  27. endif(BUILD_TARGET STREQUAL "RPI")
  28. option(ENABLE_HELPER "Enable PMP Helper" ON)
  29. if (ENABLE_HELPER)
  30. add_definitions(-DENABLE_HELPER=1)
  31. endif(ENABLE_HELPER)
  32. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  33. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  34. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
  35. macro(set_policy _POLICY _VALUE)
  36. if(POLICY ${_POLICY})
  37. cmake_policy(SET ${_POLICY} ${_VALUE})
  38. endif()
  39. endmacro()
  40. set_policy(CMP0020 NEW)
  41. set_policy(CMP0017 NEW)
  42. set_policy(CMP0058 NEW)
  43. set_policy(CMP0026 OLD)
  44. include(utils)
  45. include(CompilerFlags)
  46. include(DependencyConfiguration)
  47. include(QtConfiguration)
  48. include(VersionConfiguration)
  49. include(NameConfiguration)
  50. include(PlayerConfiguration)
  51. include(InputConfiguration)
  52. include(FindBreakpad)
  53. include(BreakpadSymbols)
  54. include(ClangTidy)
  55. include(WebClientConan)
  56. add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
  57. if(APPLE)
  58. include(AppleConfiguration)
  59. elseif(WIN32)
  60. include(Win32Configuration)
  61. elseif(UNIX AND (NOT APPLE))
  62. include(LinuxConfiguration)
  63. endif(APPLE)
  64. if (Qt5_POSITION_INDEPENDENT_CODE)
  65. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  66. endif(Qt5_POSITION_INDEPENDENT_CODE)
  67. add_subdirectory(external)
  68. add_subdirectory(src)
  69. include(CPackConfiguration)
  70. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS PlexMediaPlayer PMPHelper)