This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·210 lines (185 loc) · 8.1 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
##########################################################################
# Copyright 2018 RDK Management
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation, version 2
# of the license.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
#########################################################################
cmake_minimum_required (VERSION 2.6)
project (AAMP)
#find_package(GStreamer 1.4 REQUIRED)
#add_subdirectory(jsbindings)
find_package(PkgConfig REQUIRED)
if( CMAKE_USE_GST_0.10 )
message( FATAL_ERROR "gstreamer-0.10 not supported" )
else()
message("using gstreamer-1.0")
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GSTREAMERBASE REQUIRED gstreamer-app-1.0)
endif()
pkg_check_modules(CURL REQUIRED libcurl)
# Mac OS X
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -g -x objective-c++")
set(OS_LD_FLAGS "${OS_LD_FLAGS} -framework Cocoa")
string(STRIP ${OS_LD_FLAGS} OS_LD_FLAGS)
set(AAMP_CLI_LD_FLAGS "${AAMP_CLI_LD_FLAGS} -lgstvideo-1.0")
string(STRIP ${AAMP_CLI_LD_FLAGS} AAMP_CLI_LD_FLAGS)
set(AAMP_OS_SOURCES cocoa_window.mm)
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
find_package (Threads REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${GSTREAMER_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${GSTREAMERBASE_INCLUDE_DIRS})
if(CMAKE_CONTENT_METADATA_IPDVR_ENABLED)
message("CMAKE_CONTENT_METADATA_IPDVR_ENABLED set")
set(SEC_CLIENT_LIB -lSecClient )
set(SEC_CONTENT_METADATA_ENABLED "-DAAMP_CONTENT_METADATA_IPDVR_ENABLED")
elseif(CMAKE_USE_SECCLIENT)
set(SEC_CLIENT_LIB -lSecClient )
endif()
if(CMAKE_USE_OPENCDM)
message("CMAKE_USE_OPENCDM set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_OPENCDM")
endif()
set(AAMP_COMMON_DEPENDENCIES ${OS_LD_FLAGS} ${GSTREAMERBASE_LIBRARIES} ${GSTREAMER_LIBRARIES} ${CURL_LIBRARIES} ${AAMP_CLI_LD_FLAGS} -ldl -luuid ${SEC_CLIENT_LIB})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -std=c++11")
if(CMAKE_IARM_MGR)
message("CMAKE_IARM_MGR set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIARM_MGR")
endif()
set(GSTAAMP_SOURCES gstaamp.cpp gstaampsrc.cpp gstaampinit.cpp)
if(CMAKE_CDM_DRM)
message("CMAKE_CDM_DRM set")
set(GSTAAMP_SOURCES "${GSTAAMP_SOURCES}" drm/gst/gstaampcdmidecryptor.cpp drm/gst/gstaampplayreadydecryptor.cpp drm/gst/gstaampwidevinedecryptor.cpp drm/gst/gstaampclearkeydecryptor.cpp drm/gst/gstaampverimatrixdecryptor.cpp)
endif()
if(NOT DEFINED CMAKE_GST_SUBTEC_ENABLED)
set(CMAKE_GST_SUBTEC_ENABLED TRUE)
endif()
if (CMAKE_GST_SUBTEC_ENABLED)
find_library(LIBSUBTEC_LIBRARY NAMES subtec libsubtec.so)
message("LIBSUBTEC_LIBRARY ${LIBSUBTEC_LIBRARY}")
if(LIBSUBTEC_LIBRARY STREQUAL LIBSUBTEC_LIBRARY-NOTFOUND)
message("libsubtec.so not present - skipping gst_subtec build")
else()
message("Adding gst_subtec")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGST_SUBTEC_ENABLED")
add_subdirectory(gst_subtec)
endif()
endif()
if(CMAKE_AVE_DRM)
message("CMAKE_AVE_DRM set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAVE_DRM -DAAMP_STUBS_FOR_JS")
set(GSTAAMP_SOURCES "${GSTAAMP_SOURCES}" drm/ave/StubsForAVEPlayer.cpp)
elseif(CMAKE_WPEWEBKIT_JSBINDINGS)
message("CMAKE_WPEWEBKIT_JSBINDINGS set, adding stubs")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAAMP_STUBS_FOR_JS")
set(GSTAAMP_SOURCES "${GSTAAMP_SOURCES}" drm/ave/StubsForAVEPlayer.cpp)
endif()
add_library(gstaamp SHARED ${GSTAAMP_SOURCES})
if(CMAKE_CDM_DRM)
target_include_directories (gstaamp PRIVATE drm/gst)
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -lIARMBus -lds -lsystemd")
if(CMAKE_USE_OPENCDM)
message("CMAKE_USE_OPENCDM set")
set(AAMP_DEFINES "${AAMP_DEFINES} -DAAMP_HLS_DRM=1")
if (DEFINED SECAPI_ENGINE_BROADCOM_SAGE)
add_definitions( -DUSE_SECAPI_BRCMHW=1 )
if(DEFINED SAGE_SVP)
message("SAGE_SVP set")
add_definitions (-DUSE_SAGE_SVP)
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -locdm -lb_secbuf -lbrcmsvpmeta -lsec_api")
else()
message("SAGE_SVP not set")
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -locdm -lsec_api")
endif()
elseif(DEFINED SECAPI_ENGINE_BROADCOM_RAAGA)
message("SECAPI_ENGINE_BROADCOM_RAAGA set")
add_definitions( -DUSE_SECAPI_BRCMHW=1 )
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -locdm -lsec_api")
else()
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -locdm -lsec_api_crypto")
endif()
find_path (STAGING_INCDIR opencdm)
include_directories(${STAGING_INCDIR}/opencdm)
elseif(CMAKE_USE_OPENCDM_ADAPTER)
message("CMAKE_USE_OPENCDM_ADAPTER set")
set(AAMP_DEFINES "${AAMP_DEFINES} -DAAMP_HLS_DRM=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_OPENCDM_ADAPTER")
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -locdm")
find_path (STAGING_INCDIR opencdm)
include_directories(${STAGING_INCDIR}/opencdm)
else()
message("CMAKE_USE_OPENCDM not set")
if (DEFINED SECAPI_ENGINE_BROADCOM_SAGE)
add_definitions( -DUSE_SECAPI_BRCMHW=1 )
if(DEFINED SAGE_SVP)
message("SAGE_SVP set")
add_definitions (-DUSE_SAGE_SVP)
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -lplayready -lsec_api -lb_secbuf -lbrcmsvpmeta")
else()
message("SAGE_SVP not set")
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -lplayready -lsec_api")
endif()
elseif(DEFINED SECAPI_ENGINE_BROADCOM_RAAGA)
message("SECAPI_ENGINE_BROADCOM_RAAGA set")
add_definitions( -DUSE_SECAPI_BRCMHW=1 )
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -lplayready -lsec_api")
else()
set(AAMP_COMMON_DEPENDENCIES "${AAMP_COMMON_DEPENDENCIES} -lplayready -lsec_api_crypto")
endif()
find_path (STAGING_INCDIR playready)
find_path (STAGING_INCDIR playready/oem/common/inc)
find_path (STAGING_INCDIR playready/oem/ansi/inc)
include_directories(${STAGING_INCDIR}/playready)
include_directories(${STAGING_INCDIR}/playready/oem/common/inc)
include_directories(${STAGING_INCDIR}/playready/oem/ansi/inc)
endif()
set(AAMP_DEFINES "${AAMP_DEFINES} -DAAMP_MPD_DRM=1 -DDRM_BUILD_PROFILE=DRM_BUILD_PROFILE_OEM -DTARGET_LITTLE_ENDIAN=1 -DTARGET_SUPPORTS_UNALIGNED_DWORD_POINTERS=0 ${SEC_CONTENT_METADATA_ENABLED}")
else()
message("CMAKE_CDM_DRM not set")
endif()
target_link_libraries (gstaamp aamp ${AAMP_COMMON_DEPENDENCIES} )
set(LIBAAMP_DEFINES "${AAMP_DEFINES}")
if(CMAKE_SOC_PLATFORM_INTEL)
message("CMAKE_SOC_PLATFORM_INTEL set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINTELCE=1 -DAAMP_STOP_SINK_ON_SEEK=1 -DUSE_SYSLOG_HELPER_PRINT=1")
endif()
if(CMAKE_SOC_PLATFORM_REALTEK)
message("CMAKE_SOC_PLATFORM_REALTEK set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREALTEKCE=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAAMP_STUBS_FOR_JS")
set(AAMP_CLI_SOURCES ${AAMP_CLI_SOURCES} drm/ave/StubsForAVEPlayer.cpp)
endif()
if (CMAKE_AMLOGIC_SOC)
message("CMAKE_AMLOGIC_SOC set")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAMLOGIC")
target_link_libraries (gstaamp gstsvpext)
endif()
#TODO Remove once PrivateInstanceAAMP is compilation flag independent.
if(CMAKE_USE_SECCLIENT)
message("CMAKE_USE_SECCLIENT set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECCLIENT")
elseif(CMAKE_USE_SECMANAGER)
message("CMAKE_USE_SECMANAGER set")
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DUSE_SECMANAGER")
endif()
install(TARGETS gstaamp DESTINATION lib/gstreamer-1.0)
if(CMAKE_WPEWEBKIT_JSBINDINGS)
message("CMAKE_WPEWEBKIT_JSBINDINGS set")
target_link_libraries (gstaamp aampjsbindings)
set(LIBAAMP_DEFINES "${LIBAAMP_DEFINES} -DAAMP_JSCONTROLLER_ENABLED")
endif()
set_target_properties(gstaamp PROPERTIES COMPILE_FLAGS "${LIBAAMP_DEFINES}")