CMakeLists.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
  2. project(PlexMediaPlayer CXX C)
  3. # we want this to be able to run clang-tidy
  4. set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
  5. cmake_policy(SET CMP0020 NEW)
  6. cmake_policy(SET CMP0017 NEW)
  7. if (POLICY CMP0058)
  8. cmake_policy(SET CMP0058 NEW)
  9. endif()
  10. option(OPENELEC "Make an OpenELEC build" OFF)
  11. if(OPENELEC)
  12. add_definitions(-DKONVERGO_OPENELEC=1)
  13. Message(STATUS "Making an OpenELEC build")
  14. endif(OPENELEC)
  15. option(BUILD_TARGET "Destination target for the build" "")
  16. if(BUILD_TARGET STREQUAL "RPI")
  17. add_definitions(-DTARGET_RPI=1)
  18. set(RPI_LIBS bcm_host)
  19. Message(STATUS "Build for Raspberry PI target")
  20. endif(BUILD_TARGET STREQUAL "RPI")
  21. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  22. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  23. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
  24. add_definitions(-DQS_LOG_LINE_NUMBERS)
  25. include(DependencyConfiguration)
  26. include(QtConfiguration)
  27. include(VersionConfiguration)
  28. include(NameConfiguration)
  29. include(utils)
  30. include(PlayerConfiguration)
  31. include(InputConfiguration)
  32. include(FindBreakpad)
  33. include(BreakpadSymbols)
  34. include(ClangTidy)
  35. if(APPLE)
  36. include(AppleConfiguration)
  37. elseif(WIN32)
  38. include(Win32Configuration)
  39. elseif(UNIX AND (NOT APPLE))
  40. include(LinuxConfiguration)
  41. endif(APPLE)
  42. if(CMAKE_COMPILER_IS_GNUCC)
  43. include(GCCConfiguration)
  44. endif(CMAKE_COMPILER_IS_GNUCC)
  45. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNINGS}")
  46. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS}")
  47. if (Qt5_POSITION_INDEPENDENT_CODE)
  48. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  49. endif(Qt5_POSITION_INDEPENDENT_CODE)
  50. add_subdirectory(external)
  51. add_subdirectory(src)
  52. include(CPackConfiguration)
  53. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS PlexMediaPlayer PMPHelper)