CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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(JellyfinMediaPlayer 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. option(LINUX_X11POWER "Enable non D-Bus screensaver management" OFF)
  11. if((NOT LINUX_X11POWER) AND (UNIX AND (NOT APPLE)))
  12. set(LINUX_DBUS ON)
  13. endif()
  14. if(OPENELEC)
  15. add_definitions(-DKONVERGO_OPENELEC=1)
  16. Message(STATUS "Making an OpenELEC build")
  17. endif(OPENELEC)
  18. if(BUILD_TARGET STREQUAL "RPI")
  19. add_definitions(-DTARGET_RPI=1)
  20. set(RPI_LIBS bcm_host)
  21. Message(STATUS "Build for Raspberry PI target")
  22. endif(BUILD_TARGET STREQUAL "RPI")
  23. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  24. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
  25. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
  26. macro(set_policy _POLICY _VALUE)
  27. if(POLICY ${_POLICY})
  28. cmake_policy(SET ${_POLICY} ${_VALUE})
  29. endif()
  30. endmacro()
  31. set_policy(CMP0020 NEW)
  32. set_policy(CMP0017 NEW)
  33. set_policy(CMP0058 NEW)
  34. set_policy(CMP0026 OLD)
  35. include(utils)
  36. include(CompilerFlags)
  37. include(DependencyConfiguration)
  38. include(QtConfiguration)
  39. include(VersionConfiguration)
  40. include(NameConfiguration)
  41. include(PlayerConfiguration)
  42. include(InputConfiguration)
  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 JellyfinMediaPlayer)