forked from pipelka/vdr-plugin-robotv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
149 lines (133 loc) · 4.74 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
cmake_minimum_required(VERSION 2.8)
project(robotv)
set(PLUGIN "robotv")
set(ROBOTV_VERSION "0.13.3")
# check for pkg-config
find_package(PkgConfig REQUIRED)
# check for vdr
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_CURRENT_SOURCE_DIR}/../../..")
pkg_check_modules(VDR vdr>=2.3.8)
macro(vdr_find_variable _variable)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_variable} vdr
OUTPUT_VARIABLE _variable_result)
string(REGEX REPLACE "[\r\n]" "" _variable_result "${_variable_result}")
string(TOUPPER "vdr_${_variable}" _variable_upper)
_pkgconfig_set(${_variable_upper} ${_variable_result})
endmacro(vdr_find_variable)
# get vdr installation variables
vdr_find_variable(apiversion)
vdr_find_variable(locdir)
vdr_find_variable(libdir)
vdr_find_variable(configdir)
vdr_find_variable(cachedir)
message(STATUS "API Version: '${VDR_APIVERSION}'")
message(STATUS "Locales: '${VDR_LOCDIR}'")
message(STATUS "Libraries: '${VDR_LIBDIR}'")
message(STATUS "Configuration: '${VDR_CONFIGDIR}'")
message(STATUS "Cache: '${VDR_CACHEDIR}'")
# check for avahi-client
pkg_check_modules(AVAHI avahi-client)
# set C++11 for robotv
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations")
# sqlite
set(SQLITE_FILES
src/db/sqlite3.c
src/db/sqlite3.h
src/db/sqlite3ext.h)
add_library(sqlite STATIC ${SQLITE_FILES})
target_compile_definitions(sqlite PRIVATE HAVE_USLEEP SQLITE_THREADSAFE=1 SQLITE_ENABLE_FTS4)
target_compile_options(sqlite PRIVATE -fPIC)
target_link_libraries(sqlite dl pthread)
if(${AVAHI_FOUND})
set(SDP_SOURCES
src/net/sdp-avahi.h
src/net/sdp-avahi.cpp)
endif()
# robotv plugin
set(SOURCE_FILES
src/config/config.cpp
src/config/config.h
src/db/database.cpp
src/db/database.h
src/db/storage.cpp
src/db/storage.h
src/live/channelcache.cpp
src/live/channelcache.h
src/live/livequeue.cpp
src/live/livequeue.h
src/live/livestreamer.cpp
src/live/livestreamer.h
src/net/msgpacket.cpp
src/net/msgpacket.h
src/net/os-config.cpp
src/net/os-config.h
src/recordings/artwork.cpp
src/recordings/artwork.h
src/recordings/packetplayer.cpp
src/recordings/packetplayer.h
src/recordings/recordingscache.cpp
src/recordings/recordingscache.h
src/recordings/recplayer.cpp
src/recordings/recplayer.h
src/robotv/controllers/artworkcontroller.cpp
src/robotv/controllers/artworkcontroller.h
src/robotv/controllers/channelcontroller.cpp
src/robotv/controllers/channelcontroller.h
src/robotv/controllers/controller.h
src/robotv/controllers/epgcontroller.cpp
src/robotv/controllers/epgcontroller.h
src/robotv/controllers/logincontroller.cpp
src/robotv/controllers/logincontroller.h
src/robotv/controllers/moviecontroller.cpp
src/robotv/controllers/moviecontroller.h
src/robotv/controllers/recordingcontroller.cpp
src/robotv/controllers/recordingcontroller.h
src/robotv/controllers/streamcontroller.cpp
src/robotv/controllers/streamcontroller.h
src/robotv/controllers/timercontroller.cpp
src/robotv/controllers/timercontroller.h
src/robotv/svdrp/channelcmds.cpp
src/robotv/svdrp/channelcmds.h
src/robotv/robotv.cpp
src/robotv/robotv.h
src/robotv/robotvclient.cpp
src/robotv/robotvclient.h
src/robotv/robotvcommand.h
src/robotv/robotvserver.cpp
src/robotv/robotvserver.h
src/scanner/wirbelscan.cpp
src/scanner/wirbelscan.h
src/service/epgsearch/services.h
src/service/wirbelscan/wirbelscan_services.h
src/tools/utf8/checked.h
src/tools/utf8/core.h
src/tools/utf8/unchecked.h
src/tools/hash.cpp
src/tools/hash.h
src/tools/json.hpp
src/tools/recid2uid.cpp
src/tools/recid2uid.h
src/tools/time.cpp
src/tools/time.h
src/tools/urlencode.cpp
src/tools/urlencode.h
src/tools/utf8.h
src/tools/utf8conv.h
src/tools/utf8conv.cpp
src/robotv/StreamPacketProcessor.cpp
src/robotv/StreamPacketProcessor.h
src/net/sdp.h
src/net/sdp.cpp
src/net/sdp-dummy.h
${SDP_SOURCES})
add_subdirectory(src/demuxer)
add_library(vdr-robotv SHARED ${SOURCE_FILES})
target_link_libraries(vdr-robotv robotvdmx sqlite z ${AVAHI_LIBRARIES})
target_include_directories(vdr-robotv PRIVATE src ${VDR_INCLUDE_DIRS} ../../../include ${AVAHI_CFLAGS})
target_compile_definitions(vdr-robotv PRIVATE ROBOTV_VERSION="${ROBOTV_VERSION}" PLUGIN_NAME_I18N="${PLUGIN}" HAVE_ZLIB=1)
set_target_properties(vdr-robotv PROPERTIES VERSION "${VDR_APIVERSION}")
if(${AVAHI_FOUND})
target_compile_definitions(vdr-robotv PRIVATE ROBOTV_VERSION="${ROBOTV_VERSION}" PLUGIN_NAME_I18N="${PLUGIN}" HAVE_ZLIB=1 AVAHI_ENABLED)
endif()
install(TARGETS vdr-robotv LIBRARY DESTINATION ${VDR_LIBDIR} NAMELINK_SKIP)