forked from plexinc/plex-home-theater-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
167 lines (143 loc) · 5.16 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
project("Plex Home Theater")
cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")
endif()
set(root ${PROJECT_SOURCE_DIR})
set(plexdir ${root}/plex)
set(CMAKE_MODULE_PATH ${plexdir}/CMakeModules ${CMAKE_MODULE_PATH})
include(GetGitRevisionDescription)
include(GetDate)
today(PLEX_CURRENT_DATE)
get_git_head_revision(REFSPEC PLEX_FULL_GIT_REVISION)
if(PLEX_FULL_GIT_REVISION STREQUAL "GITDIR-NOTFOUND")
if(EXISTS ${root}/GitRevision.txt)
file(STRINGS "${root}/GitRevision.txt" PLEX_GIT_REVISION)
else()
set(PLEX_GIT_REVISION "git")
endif()
else()
string(SUBSTRING ${PLEX_FULL_GIT_REVISION} 0 8 PLEX_GIT_REVISION)
endif()
set(PLEX_VERSION_MAJOR 1)
set(PLEX_VERSION_MINOR 4)
set(PLEX_VERSION_PATCH 1)
if(DEFINED ENV{BUILD_NUMBER})
set(PLEX_VERSION_BUILD "$ENV{BUILD_NUMBER}")
set(PLEX_VERSION_BUILD_NR "$ENV{BUILD_NUMBER}")
else()
set(PLEX_VERSION_BUILD "dev")
set(PLEX_VERSION_BUILD_NR "0")
endif()
set(PLEX_VERSION_STRING ${PLEX_VERSION_MAJOR}.${PLEX_VERSION_MINOR}.${PLEX_VERSION_PATCH}.${PLEX_VERSION_BUILD}-${PLEX_GIT_REVISION})
set(PLEX_VERSION_STRING_SHORT ${PLEX_VERSION_MAJOR}.${PLEX_VERSION_MINOR}.${PLEX_VERSION_PATCH})
set(PLEX_VERSION_STRING_SHORT_BUILD ${PLEX_VERSION_STRING_SHORT}.${PLEX_VERSION_BUILD})
set(PLEX_WINDOWS_VERSION ${PLEX_VERSION_MAJOR},${PLEX_VERSION_MINOR},${PLEX_VERSION_PATCH},${PLEX_VERSION_BUILD_NR})
set(XBMC_VERSION "Frodo")
configure_file(${plexdir}/git_revision.h.in git_revision.h)
message(STATUS "Building Plex Home Theater, version: ${PLEX_VERSION_STRING}")
include(CMakeFunctions)
# Now check for available functions
include(CMakeConfig)
# Now build auxilary xbmc libraries.
# Note that we want to do this before we add all
# our defines and includes, otherwise they will
# carry over
add_subdirectory(lib)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/xbmc
${root}/plex/Third-Party/gtest/include
${root}/plex/Third-Party/gmock/include
${dependdir}/include
${dependdir}/include/libcec
${dependdir}/include/freetype2
${dependdir}/include/python2.6
${dependdir}/include/python2.7
${ffmpegdir}/include
${root}/xbmc
)
# Platfrom includes
if(TARGET_POSIX)
include_directories(${root}/xbmc/linux)
endif(TARGET_POSIX)
if(TARGET_COMMON_DARWIN)
include_directories(${root}/xbmc/osx)
endif(TARGET_COMMON_DARWIN)
if(TARGET_WIN32)
include_directories(
${root}/xbmc/win32
${root}/lib/ffmpeg
${root}/lib/ffmpeg/include-xbmc-win32
${root}/lib/liblame/include
${root}/lib/win32/pcre
${root}/lib/win32
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include"
)
endif(TARGET_WIN32)
if(NOT TARGET_RPI)
# Build the texturepacker
add_subdirectory(tools/TexturePacker)
endif()
# add our visualizations
add_subdirectory(xbmc/visualizations)
# global includes
include_directories(
${plexdir}
${plexdir}/Utility
${plexdir}/Owned
${root}/xbmc/utils
${root}
${root}/xbmc/cores/dvdplayer
${root}/xbmc/settings
${root}/lib
${CMAKE_BINARY_DIR}/lib/cpluff/cpluff-prefix/src/cpluff/libcpluff
${root}/tools/darwin/depends/libcrystalhd
${root}/xbmc/cores/AudioEngine
)
if(ENABLE_PYTHON)
if(EXTERNAL_PYTHON_HOME)
if(TARGET_LINUX OR TARGET_OSX OR TARGET_RPI OR TARGET_FREEBSD)
install(DIRECTORY ${EXTERNAL_PYTHON_HOME}/lib/python${PYTHON_VERSION} DESTINATION ${LIBPATH}/lib/ COMPONENT RUNTIME
PATTERN python${PYTHON_VERSION}/test EXCLUDE
REGEX .*\\.pyc$ EXCLUDE
REGEX .*\\.pyo$ EXCLUDE
)
install(FILES ${PYTHON_INCLUDE_DIRS}/pyconfig.h DESTINATION "${LIBPATH}/include/python${PYTHON_VERSION}" COMPONENT RUNTIME)
endif()
elseif()
if(TARGET_LINUX OR TARGET_OSX OR TARGET_FREEBSD)
install(DIRECTORY /usr/lib/python${PYTHON_VERSION} DESTINATION ${LIBPATH}/lib/ COMPONENT RUNTIME
PATTERN python${PYTHON_VERSION}/test EXCLUDE
REGEX .*\\.pyc$ EXCLUDE
REGEX .*\\.pyo$ EXCLUDE
)
install(FILES ${PYTHON_INCLUDE_DIRS}/pyconfig.h DESTINATION "${LIBPATH}/include/python${PYTHON_VERSION}" COMPONENT RUNTIME)
endif()
endif()
endif()
# UPnP includes
include_directories(
${root}/lib/libUPnP/Platinum/Source/Platinum
${root}/lib/libUPnP/Platinum/Source/Core
${root}/lib/libUPnP/Platinum/Source/Extras
${root}/lib/libUPnP/Platinum/Source/Devices/MediaConnect
${root}/lib/libUPnP/Platinum/Source/Devices/MediaRenderer
${root}/lib/libUPnP/Platinum/Source/Devices/MediaServer
${root}/lib/libUPnP/Neptune/Source/Core
${root}/lib/libUPnP/Neptune/Source/System/Posix
)
add_subdirectory(xbmc)
if(TARGET_OSX)
add_subdirectory(tools/EventClients/Clients/OSXRemote)
endif()
add_subdirectory(plex)
if(XRANDR_FOUND)
add_executable(xbmc-xrandr xbmc-xrandr.c)
target_link_libraries(xbmc-xrandr ${CONFIG_LIBRARY_XRANDR} ${CONFIG_LIBRARY_X11} -lm)
install(TARGETS xbmc-xrandr DESTINATION ${BINPATH})
endif()
include(CPackConfig)