CMakeLists.txt 1.9 KB

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