CMakeLists.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. macro(set_policy _POLICY _VALUE)
  23. if(POLICY ${_POLICY})
  24. cmake_policy(SET ${_POLICY} ${_VALUE})
  25. endif()
  26. endmacro()
  27. set_policy(CMP0020 NEW)
  28. set_policy(CMP0017 NEW)
  29. set_policy(CMP0058 NEW)
  30. set_policy(CMP0026 OLD)
  31. include(utils)
  32. include(CompilerFlags)
  33. include(DependencyConfiguration)
  34. include(QtConfiguration)
  35. include(WebClientResources)
  36. include(VersionConfiguration)
  37. include(NameConfiguration)
  38. include(PlayerConfiguration)
  39. include(InputConfiguration)
  40. include(FindBreakpad)
  41. include(BreakpadSymbols)
  42. include(ClangTidy)
  43. add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
  44. if(APPLE)
  45. include(AppleConfiguration)
  46. elseif(WIN32)
  47. include(Win32Configuration)
  48. elseif(UNIX AND (NOT APPLE))
  49. include(LinuxConfiguration)
  50. endif(APPLE)
  51. if (Qt5_POSITION_INDEPENDENT_CODE)
  52. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  53. endif(Qt5_POSITION_INDEPENDENT_CODE)
  54. add_subdirectory(external)
  55. add_subdirectory(src)
  56. include(CPackConfiguration)
  57. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS PlexMediaPlayer PMPHelper)