CMakeLists.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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(WebClient)
  38. include(DependencyConfiguration)
  39. include(QtConfiguration)
  40. include(VersionConfiguration)
  41. include(NameConfiguration)
  42. include(PlayerConfiguration)
  43. include(InputConfiguration)
  44. include(ClangTidy)
  45. add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
  46. if(APPLE)
  47. include(AppleConfiguration)
  48. elseif(WIN32)
  49. include(Win32Configuration)
  50. elseif(UNIX AND (NOT APPLE))
  51. include(LinuxConfiguration)
  52. endif(APPLE)
  53. if (Qt5_POSITION_INDEPENDENT_CODE)
  54. SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
  55. endif(Qt5_POSITION_INDEPENDENT_CODE)
  56. add_subdirectory(external)
  57. add_subdirectory(src)
  58. include(CPackConfiguration)
  59. add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS JellyfinMediaPlayer)