File: CMakeLists.txt

package info (click to toggle)
kodi-pvr-dvbviewer 3.7.11-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 824 kB
  • sloc: cpp: 3,705; xml: 293; makefile: 10
file content (89 lines) | stat: -rw-r--r-- 2,841 bytes parent folder | download
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
project(pvr.dvbviewer)

cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})

enable_language(CXX)

find_package(TinyXML REQUIRED)
find_package(Kodi REQUIRED)
find_package(kodiplatform REQUIRED)
find_package(p8-platform REQUIRED)

include_directories(${kodiplatform_INCLUDE_DIRS}
                    ${p8-platform_INCLUDE_DIRS}
                    ${KODI_INCLUDE_DIR}
                    ${TINYXML_INCLUDE_DIRS})

add_definitions(-D__STDC_FORMAT_MACROS)

set(DVBVIEWER_SOURCES src/client.cpp
                      src/DvbData.cpp
                      src/KVStore.cpp
                      src/RecordingReader.cpp
                      src/Settings.cpp
                      src/StreamReader.cpp
                      src/Timers.cpp
                      src/TimeshiftBuffer.cpp)

set(DVBVIEWER_HEADERS src/client.h
                      src/DvbData.h
                      src/IStreamReader.h
                      src/KVStore.h
                      src/LocalizedString.h
                      src/RecordingReader.h
                      src/Settings.h
                      src/StreamReader.h
                      src/Timers.h
                      src/TimeshiftBuffer.h)

set(DEPLIBS ${kodiplatform_LIBRARIES}
            ${p8-platform_LIBRARIES}
            ${TINYXML_LIBRARIES})

# check if the linker supports version script or symbols list
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  include(CheckCXXCompilerFlag)
  file(READ "${PROJECT_SOURCE_DIR}/symbols.exp" __symbols_exp)
  string(STRIP ${__symbols_exp} __symbols_exp)
  set(__symbols_file "${CMAKE_CURRENT_BINARY_DIR}/symbols.exp")
  unset(__ldflags)

  if(NOT __ldflags)
    # gnu ld
    file(WRITE ${__symbols_file} "{ local: *; };\n")
    set(CMAKE_REQUIRED_FLAGS "-Wl,--version-script=${__symbols_file}")
    check_cxx_compiler_flag("" LD_ACCEPTS_VERSION_SCRIPT)
    if(LD_ACCEPTS_VERSION_SCRIPT)
      string(REPLACE "\n" "; " __symbols ${__symbols_exp})
      file(WRITE ${__symbols_file} "{ global: ${__symbols}; local: *; };\n")
      set(__ldflags "-Wl,--version-script=${__symbols_file}")
    endif()
  endif()

  if(NOT __ldflags)
    # darwin ld
    file(WRITE ${__symbols_file} "\n")
    set(CMAKE_REQUIRED_FLAGS "-Wl,-exported_symbols_list,${__symbols_file}")
    check_cxx_compiler_flag("" LD_ACCEPTS_SYMBOLS_LIST)
    if(LD_ACCEPTS_SYMBOLS_LIST)
      string(REPLACE "\n" "\n_" __symbols ${__symbols_exp})
      file(WRITE ${__symbols_file} "_${__symbols}\n")
      set(__ldflags "-Wl,-exported_symbols_list,${__symbols_file}")
    endif()
  endif()

  if(__ldflags)
    add_options(ALL_LANGUAGES ALL_BUILDS "${__ldflags}")
  endif()
  unset(CMAKE_REQUIRED_FLAGS)
endif()

if(NOT MSVC)
  add_options(ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall")
endif()

build_addon(pvr.dvbviewer DVBVIEWER DEPLIBS)

include(CPack)