forked from jellyfin/jellyfin-media-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (61 loc) · 2.01 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR)
# use a toolchain file if any for Embedded
if (EXISTS "${CMAKE_SOURCE_DIR}/toolchain.cmake")
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/toolchain.cmake")
endif()
project(JellyfinMediaPlayer CXX C)
# we want this to be able to run clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
option(OPENELEC "Make an OpenELEC build" OFF)
option(LINUX_X11POWER "Enable non D-Bus screensaver management" OFF)
if((NOT LINUX_X11POWER) AND (UNIX AND (NOT APPLE)))
set(LINUX_DBUS ON)
endif()
if(OPENELEC)
add_definitions(-DKONVERGO_OPENELEC=1)
Message(STATUS "Making an OpenELEC build")
endif(OPENELEC)
if(BUILD_TARGET STREQUAL "RPI")
add_definitions(-DTARGET_RPI=1)
set(RPI_LIBS bcm_host)
Message(STATUS "Build for Raspberry PI target")
endif(BUILD_TARGET STREQUAL "RPI")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
macro(set_policy _POLICY _VALUE)
if(POLICY ${_POLICY})
cmake_policy(SET ${_POLICY} ${_VALUE})
endif()
endmacro()
set_policy(CMP0020 NEW)
set_policy(CMP0017 NEW)
set_policy(CMP0058 NEW)
set_policy(CMP0026 OLD)
set_policy(CMP0071 NEW)
set_policy(CMP0072 NEW)
set_policy(CMP0148 OLD)
include(utils)
include(CompilerFlags)
include(DependencyConfiguration)
include(QtConfiguration)
include(VersionConfiguration)
include(NameConfiguration)
include(PlayerConfiguration)
include(InputConfiguration)
include(ClangTidy)
add_definitions(-DQS_LOG_LINE_NUMBERS -DQS_LOG_SEPARATE_THREAD)
if(APPLE)
include(AppleConfiguration)
elseif(WIN32)
include(Win32Configuration)
elseif(UNIX AND (NOT APPLE))
include(LinuxConfiguration)
endif(APPLE)
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif(Qt5_POSITION_INDEPENDENT_CODE)
add_subdirectory(external)
add_subdirectory(src)
include(CPackConfiguration)
add_custom_target(install_app_bundle COMMAND ${CMAKE_COMMAND} -P cmake_install.cmake DEPENDS JellyfinMediaPlayer)