CMakeLists.txt 1.7 KB

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