| 1 |
cmake_minimum_required(VERSION 3.5) |
| 2 |
project(pvr.mediaportal.tvserver) |
| 3 |
|
| 4 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) |
| 5 |
|
| 6 |
find_package(Kodi REQUIRED) |
| 7 |
find_package(TinyXML REQUIRED) |
| 8 |
|
| 9 |
set(LIVE555_INCLUDE_DIR |
| 10 |
src/lib/live555/liveMedia/include |
| 11 |
src/lib/live555/BasicUsageEnvironment/include |
| 12 |
src/lib/live555/UsageEnvironment/include |
| 13 |
src/lib/live555/groupsock/include |
| 14 |
src/lib/live555/ |
| 15 |
) |
| 16 |
|
| 17 |
set(LIVE555_DEFINES -DLIVE555 -D_WINSOCK_DEPRECATED_NO_WARNINGS -DSOCKLEN_T=socklen_t -DBSD=1) |
| 18 |
|
| 19 |
include_directories(${TINYXML_INCLUDE_DIR} |
| 20 |
${KODI_INCLUDE_DIR}/.. # Hack way with "/..", need bigger Kodi cmake rework to match right include ways |
| 21 |
${PROJECT_SOURCE_DIR}/src |
| 22 |
${PROJECT_BINARY_DIR} |
| 23 |
) |
| 24 |
|
| 25 |
if (NOT WIN32) |
| 26 |
add_options(ALL_LANGUAGES ALL_BUILDS "-fPIC") |
| 27 |
endif() |
| 28 |
|
| 29 |
# Source files |
| 30 |
set(MPTV_SOURCES src/addon.cpp |
| 31 |
src/Cards.cpp |
| 32 |
src/channels.cpp |
| 33 |
src/DateTime.cpp |
| 34 |
src/epg.cpp |
| 35 |
src/GenreTable.cpp |
| 36 |
src/GUIDialogRecordSettings.cpp |
| 37 |
src/pvrclient-mediaportal.cpp |
| 38 |
src/recordings.cpp |
| 39 |
src/settings.cpp |
| 40 |
src/Socket.cpp |
| 41 |
src/timers.cpp |
| 42 |
src/uri.cpp |
| 43 |
src/utils.cpp) |
| 44 |
|
| 45 |
if(WIN32) |
| 46 |
set(MPTV_SOURCES_WINDOWS src/windows/FileUtils.cpp |
| 47 |
src/windows/WindowsUtils.cpp) |
| 48 |
source_group("Source Files\\windows" FILES ${MPTV_SOURCES_WINDOWS}) |
| 49 |
list(APPEND MPTV_SOURCES ${MPTV_SOURCES_WINDOWS}) |
| 50 |
endif(WIN32) |
| 51 |
|
| 52 |
# Header files |
| 53 |
set(MPTV_HEADERS src/addon.h |
| 54 |
src/Cards.h |
| 55 |
src/channels.h |
| 56 |
src/DateTime.h |
| 57 |
src/epg.h |
| 58 |
src/GenreTable.h |
| 59 |
src/GUIDialogRecordSettings.h |
| 60 |
src/os-dependent.h |
| 61 |
src/pvrclient-mediaportal.h |
| 62 |
src/recordings.h |
| 63 |
src/settings.h |
| 64 |
src/Socket.h |
| 65 |
src/timers.h |
| 66 |
src/uri.h |
| 67 |
src/utils.h) |
| 68 |
source_group("Header Files" FILES ${MPTV_HEADERS}) |
| 69 |
if(WIN32) |
| 70 |
set(MPTV_HEADERS_WINDOWS |
| 71 |
src/FileUtils.h |
| 72 |
src/windows/WindowsUtils.h |
| 73 |
) |
| 74 |
source_group("Header Files\\windows" FILES ${MPTV_HEADERS_WINDOWS}) |
| 75 |
list(APPEND MPTV_HEADERS ${MPTV_HEADERS_WINDOWS}) |
| 76 |
endif(WIN32) |
| 77 |
|
| 78 |
if(WIN32) |
| 79 |
# Misc files |
| 80 |
set(RESOURCE_FILES pvr.mediaportal.tvserver/addon.xml |
| 81 |
pvr.mediaportal.tvserver/changelog.txt |
| 82 |
pvr.mediaportal.tvserver/resources/genre_translation.xml |
| 83 |
pvr.mediaportal.tvserver/resources/settings.xml |
| 84 |
pvr.mediaportal.tvserver/resources/language/resource.language.en_gb/strings.po) |
| 85 |
source_group("Resource Files" FILES ${RESOURCE_FILES}) |
| 86 |
endif(WIN32) |
| 87 |
|
| 88 |
# TSReader sources |
| 89 |
set(TSREADER_SOURCES src/lib/tsreader/ChannelInfo.cpp |
| 90 |
src/lib/tsreader/DeMultiplexer.cpp |
| 91 |
src/lib/tsreader/DvbUtil.cpp |
| 92 |
src/lib/tsreader/FileReader.cpp |
| 93 |
src/lib/tsreader/MemoryBuffer.cpp |
| 94 |
src/lib/tsreader/MemoryReader.cpp |
| 95 |
src/lib/tsreader/MemorySink.cpp |
| 96 |
src/lib/tsreader/MepoRTSPClient.cpp |
| 97 |
src/lib/tsreader/MultiFileReader.cpp |
| 98 |
src/lib/tsreader/PacketSync.cpp |
| 99 |
src/lib/tsreader/PatParser.cpp |
| 100 |
src/lib/tsreader/PidTable.cpp |
| 101 |
src/lib/tsreader/PmtParser.cpp |
| 102 |
src/lib/tsreader/Section.cpp |
| 103 |
src/lib/tsreader/SectionDecoder.cpp |
| 104 |
src/lib/tsreader/TSHeader.cpp |
| 105 |
src/lib/tsreader/TSReader.cpp |
| 106 |
) |
| 107 |
source_group("Source Files\\lib\\tsreader" FILES ${TSREADER_SOURCES}) |
| 108 |
|
| 109 |
# TSReader sources |
| 110 |
set(TSREADER_HEADERS src/lib/tsreader/ChannelInfo.h |
| 111 |
src/lib/tsreader/DeMultiplexer.h |
| 112 |
src/lib/tsreader/DvbUtil.h |
| 113 |
src/lib/tsreader/FileReader.h |
| 114 |
src/lib/tsreader/MemoryBuffer.h |
| 115 |
src/lib/tsreader/MemoryReader.h |
| 116 |
src/lib/tsreader/MemorySink.h |
| 117 |
src/lib/tsreader/MepoRTSPClient.h |
| 118 |
src/lib/tsreader/MultiFileReader.h |
| 119 |
src/lib/tsreader/PacketSync.h |
| 120 |
src/lib/tsreader/PatParser.h |
| 121 |
src/lib/tsreader/PidTable.h |
| 122 |
src/lib/tsreader/PmtParser.h |
| 123 |
src/lib/tsreader/Section.h |
| 124 |
src/lib/tsreader/SectionDecoder.h |
| 125 |
src/lib/tsreader/TSDebug.h |
| 126 |
src/lib/tsreader/TSHeader.h |
| 127 |
src/lib/tsreader/TSReader.h) |
| 128 |
source_group("Header Files\\lib\\tsreader" FILES ${TSREADER_HEADERS}) |
| 129 |
|
| 130 |
# Make sure that CMake adds all files to the MSVC project |
| •131 |
list(APPEND MPTV_SOURCES ${MPTV_HEADERS} ${TSREADER_SOURCES} ${TSREADER_HEADERS}) |
| 132 |
|
| 133 |
set(DEPLIBS ${TINYXML_LIBRARIES}) |
| 134 |
|
| 135 |
if(WIN32) |
| 136 |
list(APPEND DEPLIBS ws2_32) |
| 137 |
endif(WIN32) |
| 138 |
|
| 139 |
build_addon(pvr.mediaportal.tvserver MPTV DEPLIBS) |
| 140 |
|
| 141 |
include(CPack) |