summaryrefslogtreecommitdiffstats
path: root/project/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake')
-rw-r--r--project/cmake/CMakeLists.txt335
-rw-r--r--project/cmake/KodiConfig.cmake.in34
-rw-r--r--project/cmake/README.md175
-rw-r--r--project/cmake/addons/CMakeLists.txt122
-rw-r--r--project/cmake/addons/README.md14
-rw-r--r--project/cmake/addons/bootstrap/Bootstrap.cmake (renamed from project/cmake/addons/bootstrap/bootstrap.cmake)9
-rw-r--r--project/cmake/addons/bootstrap/CMakeLists.txt7
-rw-r--r--project/cmake/addons/depends/CMakeLists.txt15
-rw-r--r--project/cmake/addons/depends/README6
-rw-r--r--project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt2
-rw-r--r--project/cmake/addons/depends/common/tinyxml/CMakeLists.txt3
-rw-r--r--project/cmake/addons/depends/windows/CMakeLists.txt23
-rw-r--r--project/cmake/addons/depends/windows/Find7Zip.cmake7
-rw-r--r--project/cmake/addons/depends/windows/Install.cmake (renamed from project/cmake/addons/depends/windows/install.cmake)0
-rw-r--r--project/cmake/addons/depends/windows/extract-7z.cmake10
-rw-r--r--project/cmake/addons/depends/windows/extract-direct.cmake2
-rw-r--r--project/cmake/cpack/CPackConfigDEB.cmake352
-rw-r--r--project/cmake/cpack/deb/NEWS.Debian24
-rw-r--r--project/cmake/cpack/deb/copyright3244
-rw-r--r--project/cmake/cpack/deb/lintian/overrides/kodi1
-rw-r--r--project/cmake/cpack/deb/menu/kodi2
-rw-r--r--project/cmake/cpack/deb/package-description.txt16
-rw-r--r--project/cmake/cpack/deb/packages/kodi-addon-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-audio-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-bin.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-eventclients-common.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-eventclients-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-eventclients-ps3.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-eventclients-wiiremote.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-inputstream-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-peripheral-dev.txt.in24
-rw-r--r--project/cmake/cpack/deb/packages/kodi-pvr-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-screensaver-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-tools-texturepacker.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi-visualization-dev.txt.in25
-rw-r--r--project/cmake/cpack/deb/packages/kodi.txt.in25
-rwxr-xr-xproject/cmake/cpack/deb/postinst5
-rwxr-xr-xproject/cmake/cpack/deb/postrm3
-rw-r--r--project/cmake/installdata/addon-bindings.txt37
-rw-r--r--project/cmake/installdata/cmake-files.txt13
-rw-r--r--project/cmake/installdata/common/addons.txt8
-rw-r--r--project/cmake/installdata/darwin/runtime.txt1
-rw-r--r--project/cmake/installdata/ios/certificates.txt1
-rw-r--r--project/cmake/installdata/ios/packaging.txt3
-rw-r--r--project/cmake/installdata/ios/runtime.txt2
-rw-r--r--project/cmake/installdata/osx/certificates.txt1
-rw-r--r--project/cmake/installdata/osx/packaging.txt4
-rw-r--r--project/cmake/installdata/osx/runtime.txt2
l---------project/cmake/installdata/rbpi/lirc.txt1
-rw-r--r--project/cmake/installdata/windows/dlls.txt8
-rw-r--r--project/cmake/installdata/windows/python.txt1
-rw-r--r--project/cmake/kodi-config.cmake.in29
-rw-r--r--project/cmake/modules/FindASS.cmake48
-rw-r--r--project/cmake/modules/FindAlsa.cmake52
-rw-r--r--project/cmake/modules/FindAvahi.cmake71
-rw-r--r--project/cmake/modules/FindBluetooth.cmake44
-rw-r--r--project/cmake/modules/FindBluray.cmake39
-rw-r--r--project/cmake/modules/FindCCache.cmake22
-rw-r--r--project/cmake/modules/FindCEC.cmake16
-rw-r--r--project/cmake/modules/FindCWiid.cmake44
-rw-r--r--project/cmake/modules/FindCXX11.cmake4
-rw-r--r--project/cmake/modules/FindCdio.cmake51
-rw-r--r--project/cmake/modules/FindCpluff.cmake44
-rw-r--r--project/cmake/modules/FindCrossGUID.cmake39
-rw-r--r--project/cmake/modules/FindCurl.cmake94
-rw-r--r--project/cmake/modules/FindD3DX11Effects.cmake25
-rw-r--r--project/cmake/modules/FindDBus.cmake52
-rw-r--r--project/cmake/modules/FindDbus.cmake21
-rw-r--r--project/cmake/modules/FindEMBEDDED.cmake3
-rw-r--r--project/cmake/modules/FindFFMPEG.cmake26
-rw-r--r--project/cmake/modules/FindFreeType.cmake49
-rw-r--r--project/cmake/modules/FindFribidi.cmake48
-rw-r--r--project/cmake/modules/FindJsonSchemaBuilder.cmake2
-rw-r--r--project/cmake/modules/FindLibDRM.cmake45
-rw-r--r--project/cmake/modules/FindLibDvd.cmake291
-rw-r--r--project/cmake/modules/FindLibSmbClient.cmake65
-rw-r--r--project/cmake/modules/FindLibXml2.cmake84
-rw-r--r--project/cmake/modules/FindLzo2.cmake45
-rw-r--r--project/cmake/modules/FindMicroHttpd.cmake125
-rw-r--r--project/cmake/modules/FindMySqlClient.cmake24
-rw-r--r--project/cmake/modules/FindNFS.cmake2
-rw-r--r--project/cmake/modules/FindOpenGLES.cmake2
-rw-r--r--project/cmake/modules/FindOpenGl.cmake4
-rw-r--r--project/cmake/modules/FindPulseAudio.cmake108
-rw-r--r--project/cmake/modules/FindPython.cmake51
-rw-r--r--project/cmake/modules/FindRTMP.cmake21
-rw-r--r--project/cmake/modules/FindSSE.cmake238
-rw-r--r--project/cmake/modules/FindSSH.cmake52
-rw-r--r--project/cmake/modules/FindSWIG.cmake27
-rw-r--r--project/cmake/modules/FindShairplay.cmake4
-rw-r--r--project/cmake/modules/FindSmbClient.cmake47
-rw-r--r--project/cmake/modules/FindSqlite3.cmake49
-rw-r--r--project/cmake/modules/FindTagLib.cmake4
-rw-r--r--project/cmake/modules/FindTinyXML.cmake2
-rw-r--r--project/cmake/modules/FindUDEV.cmake47
-rw-r--r--project/cmake/modules/FindUDev.cmake22
-rw-r--r--project/cmake/modules/FindVAAPI.cmake18
-rw-r--r--project/cmake/modules/FindVDPAU.cmake17
-rw-r--r--project/cmake/modules/FindX.cmake62
-rw-r--r--project/cmake/modules/FindXRandR.cmake51
-rw-r--r--project/cmake/modules/FindXSLT.cmake50
-rw-r--r--project/cmake/modules/FindXslt.cmake18
-rw-r--r--project/cmake/modules/FindYajl.cmake71
-rw-r--r--project/cmake/modules/LDGOLD.cmake45
-rw-r--r--project/cmake/modules/extra/ECMEnableSanitizers.cmake149
-rw-r--r--project/cmake/scripts/android/ArchSetup.cmake (renamed from project/cmake/scripts/android/archsetup.cmake)19
-rw-r--r--project/cmake/scripts/android/Install.cmake123
l---------project/cmake/scripts/android/Macros.cmake1
-rw-r--r--project/cmake/scripts/android/PathSetup.cmake (renamed from project/cmake/scripts/windows/pathsetup.cmake)5
l---------project/cmake/scripts/android/macros.cmake1
l---------project/cmake/scripts/android/pathsetup.cmake1
-rw-r--r--project/cmake/scripts/common/AddOptions.cmake78
-rw-r--r--project/cmake/scripts/common/AddonHelpers.cmake268
-rw-r--r--project/cmake/scripts/common/ArchSetup.cmake (renamed from project/cmake/scripts/common/archsetup.cmake)53
-rw-r--r--project/cmake/scripts/common/CMakeHelpers.cmake54
-rw-r--r--project/cmake/scripts/common/CheckCommits.cmake (renamed from project/cmake/scripts/common/checkcommits.cmake)0
-rw-r--r--project/cmake/scripts/common/CheckTargetPlatform.cmake (renamed from project/cmake/scripts/common/check_target_platform.cmake)32
-rw-r--r--project/cmake/scripts/common/GenerateVersionedFiles.cmake18
-rw-r--r--project/cmake/scripts/common/GeneratorSetup.cmake (renamed from project/cmake/scripts/common/generatorsetup.cmake)25
-rw-r--r--project/cmake/scripts/common/HandleDepends.cmake (renamed from project/cmake/scripts/common/handle-depends.cmake)30
-rw-r--r--project/cmake/scripts/common/Macros.cmake619
-rw-r--r--project/cmake/scripts/common/PrepareEnv.cmake (renamed from project/cmake/scripts/common/prepare-env.cmake)79
-rw-r--r--project/cmake/scripts/common/ProjectMacros.cmake (renamed from project/cmake/scripts/common/projectmacros.cmake)12
-rw-r--r--project/cmake/scripts/common/Uninstall.cmake22
-rw-r--r--project/cmake/scripts/common/addon-helpers.cmake171
-rw-r--r--project/cmake/scripts/common/addoptions.cmake82
-rw-r--r--project/cmake/scripts/common/generateversionedfiles.cmake11
-rw-r--r--project/cmake/scripts/common/macros.cmake383
-rw-r--r--project/cmake/scripts/common/managestring.cmake235
-rw-r--r--project/cmake/scripts/common/pathsetup.cmake3
-rw-r--r--project/cmake/scripts/darwin/install.cmake0
-rw-r--r--project/cmake/scripts/freebsd/ArchSetup.cmake (renamed from project/cmake/scripts/freebsd/archsetup.cmake)3
l---------project/cmake/scripts/freebsd/Install.cmake1
l---------project/cmake/scripts/freebsd/Macros.cmake1
l---------project/cmake/scripts/freebsd/PathSetup.cmake1
-rw-r--r--project/cmake/scripts/freebsd/install.cmake60
-rw-r--r--project/cmake/scripts/freebsd/macros.cmake1
-rw-r--r--project/cmake/scripts/freebsd/pathsetup.cmake1
-rw-r--r--project/cmake/scripts/ios/ArchSetup.cmake (renamed from project/cmake/scripts/ios/archsetup.cmake)16
-rw-r--r--project/cmake/scripts/ios/Install.cmake74
l---------project/cmake/scripts/ios/Macros.cmake1
l---------project/cmake/scripts/ios/PathSetup.cmake1
l---------project/cmake/scripts/ios/install.cmake1
l---------project/cmake/scripts/ios/macros.cmake1
l---------project/cmake/scripts/ios/pathsetup.cmake1
-rw-r--r--project/cmake/scripts/linux/ArchSetup.cmake41
-rw-r--r--project/cmake/scripts/linux/CodeCoverage.cmake97
-rw-r--r--project/cmake/scripts/linux/ExtraTargets.cmake12
-rw-r--r--project/cmake/scripts/linux/Install.cmake355
-rw-r--r--project/cmake/scripts/linux/Macros.cmake (renamed from project/cmake/scripts/linux/macros.cmake)40
-rw-r--r--project/cmake/scripts/linux/PathSetup.cmake39
-rw-r--r--project/cmake/scripts/linux/archsetup.cmake21
-rw-r--r--project/cmake/scripts/linux/install.cmake146
-rw-r--r--project/cmake/scripts/osx/ArchSetup.cmake (renamed from project/cmake/scripts/darwin/archsetup.cmake)12
-rw-r--r--project/cmake/scripts/osx/ExtraTargets.cmake3
-rw-r--r--project/cmake/scripts/osx/Install.cmake40
-rw-r--r--project/cmake/scripts/osx/Macros.cmake (renamed from project/cmake/scripts/darwin/macros.cmake)35
-rw-r--r--project/cmake/scripts/osx/PathSetup.cmake (renamed from project/cmake/scripts/darwin/pathsetup.cmake)0
-rw-r--r--project/cmake/scripts/rbpi/ArchSetup.cmake (renamed from project/cmake/scripts/rbpi/archsetup.cmake)10
l---------project/cmake/scripts/rbpi/Install.cmake1
l---------project/cmake/scripts/rbpi/Macros.cmake1
l---------project/cmake/scripts/rbpi/PathSetup.cmake1
l---------project/cmake/scripts/rbpi/install.cmake1
l---------project/cmake/scripts/rbpi/macros.cmake1
l---------project/cmake/scripts/rbpi/pathsetup.cmake1
-rw-r--r--project/cmake/scripts/windows/ArchSetup.cmake (renamed from project/cmake/scripts/windows/archsetup.cmake)14
-rw-r--r--project/cmake/scripts/windows/CFlagOverrides.cmake (renamed from project/cmake/scripts/windows/c-flag-overrides.cmake)2
-rw-r--r--project/cmake/scripts/windows/CXXFlagOverrides.cmake (renamed from project/cmake/scripts/windows/cxx-flag-overrides.cmake)2
-rw-r--r--project/cmake/scripts/windows/Install.cmake (renamed from project/cmake/scripts/android/install.cmake)0
-rw-r--r--project/cmake/scripts/windows/Macros.cmake66
-rw-r--r--project/cmake/scripts/windows/PathSetup.cmake (renamed from project/cmake/scripts/linux/pathsetup.cmake)0
-rw-r--r--project/cmake/scripts/windows/install.cmake0
-rw-r--r--project/cmake/scripts/windows/macros.cmake145
-rw-r--r--project/cmake/treedata/common/externals.txt1
-rw-r--r--project/cmake/treedata/common/games.txt1
-rw-r--r--project/cmake/treedata/common/network.txt2
-rw-r--r--project/cmake/treedata/common/subdirs.txt2
-rw-r--r--project/cmake/treedata/freebsd/subdirs.txt17
-rw-r--r--project/cmake/treedata/linux/subdirs.txt1
-rw-r--r--project/cmake/treedata/optional/common/cdrip.txt1
-rw-r--r--project/cmake/treedata/optional/common/dacp.txt1
-rw-r--r--project/cmake/treedata/optional/common/upnp.txt2
-rw-r--r--project/cmake/treedata/osx/subdirs.txt (renamed from project/cmake/treedata/darwin/subdirs.txt)0
-rw-r--r--project/cmake/treedata/windows/externals.txt1
-rw-r--r--project/cmake/treedata/windows/subdirs.txt3
-rw-r--r--project/cmake/xbmc-config.cmake.in4
187 files changed, 8548 insertions, 2592 deletions
diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt
index de0ea20..fa1156d 100644
--- a/project/cmake/CMakeLists.txt
+++ b/project/cmake/CMakeLists.txt
@@ -1,51 +1,62 @@
1cmake_minimum_required(VERSION 3.1) 1cmake_minimum_required(VERSION 3.1)
2project(kodi) 2project(kodi LANGUAGES CXX C ASM)
3 3
4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules) 4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules)
5if(DEPENDS_DIR) 5if(DEPENDS_DIR)
6 list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_DIR}) 6 list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_DIR})
7endif() 7endif()
8 8
9# Set CORE_SOURCE_DIR and CORE_BUILD_DIR
10get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE)
11set(CORE_BUILD_DIR build)
12
13message(STATUS "Source directory: ${CORE_SOURCE_DIR}")
14message(STATUS "Build directory: ${CMAKE_BINARY_DIR}")
15if(CMAKE_BINARY_DIR STREQUAL CORE_SOURCE_DIR)
16 message(WARNING "In-source build detected. It is recommended to build out-of-source.")
17endif()
18
19# Hide messages from Check*.cmake (e.g. CheckCSourceCompiles)
20if(NOT VERBOSE)
21 set(CMAKE_REQUIRED_QUIET ON)
22endif()
23
24# Includes
25include(modules/extra/ECMEnableSanitizers.cmake)
26include(scripts/common/GeneratorSetup.cmake)
27include(scripts/common/AddOptions.cmake)
28include(scripts/common/ArchSetup.cmake)
29include(scripts/common/Macros.cmake)
30include(scripts/common/ProjectMacros.cmake)
31include(scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake)
32include(ExternalProject)
33
34# Languages and global compiler settings
9set(CMAKE_CXX_STANDARD 11) 35set(CMAKE_CXX_STANDARD 11)
10set(CMAKE_CXX_STANDARD_REQUIRED ON) 36set(CMAKE_CXX_STANDARD_REQUIRED ON)
11set(CMAKE_CXX_EXTENSIONS OFF) 37set(CMAKE_CXX_EXTENSIONS OFF)
38set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
12 39
13# general 40# general
14option(VERBOSE "Enable verbose output?" OFF) 41option(VERBOSE "Enable verbose output?" OFF)
15option(ENABLE_DVDCSS "Enable libdvdcss support?" ON) 42option(ENABLE_DVDCSS "Enable libdvdcss support?" ON)
16option(ENABLE_UPNP "Enable UPnP support?" ON) 43option(ENABLE_UPNP "Enable UPnP support?" ON)
17option(ENABLE_NONFREE "Enable non-free components?" ON) 44option(ENABLE_NONFREE "Enable non-free components?" ON)
18option(ENABLE_MICROHTTPD "Enable MicroHttpd webserver?" ON)
19option(ENABLE_MYSQLCLIENT "Enable MySql support?" ON)
20option(ENABLE_AVAHI "Enable Avahi support?" ON)
21option(ENABLE_RTMP "Enable RTMP support?" ON)
22option(ENABLE_BLURAY "Enable BluRay support?" ON)
23option(ENABLE_PLIST "Enable AirPlay support?" ON)
24option(ENABLE_NFS "Enable NFS support?" ON)
25option(ENABLE_AIRTUNES "Enable AirTunes support?" ON) 45option(ENABLE_AIRTUNES "Enable AirTunes support?" ON)
26option(ENABLE_CEC "Enable CEC support?" ON) 46option(ENABLE_CEC "Enable CEC support?" ON)
47option(ENABLE_OPTICAL "Enable optical support?" ON)
27if(UNIX) 48if(UNIX)
28 if(NOT APPLE) 49 if(NOT APPLE)
29 option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" ON) 50 option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" ON)
30 else()
31 option(ENABLE_VTB "Enable VTB support?" OFF)
32 endif() 51 endif()
33 option(FFMPEG_PATH "Path to external ffmpeg?" "") 52 option(FFMPEG_PATH "Path to external ffmpeg?" "")
34 option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON) 53 option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON)
35 option(ENABLE_ALSA "Enable ALSA support?" ON)
36 option(ENABLE_PULSEAUDIO "Enable PulseAudio support?" ON)
37 option(ENABLE_DBUS "Enable dbus support?" ON)
38 option(ENABLE_LIBUSB "Enable libusb support?" ON)
39 option(ENABLE_UDEV "Enable UDev support?" ON)
40 option(ENABLE_OPENGL "Enable OpenGL?" ON)
41 option(ENABLE_OPENGLES "Enable OpenGLES?" ON)
42 option(ENABLE_OPENSSL "Enable OpenSSL?" ON) 54 option(ENABLE_OPENSSL "Enable OpenSSL?" ON)
43 option(ENABLE_SDL "Enable SDL?" OFF) 55 option(ENABLE_SDL "Enable SDL?" OFF)
44 option(ENABLE_X11 "Enable X11 support?" ON) 56 if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
45 option(ENABLE_EGL "Enable EGL?" OFF) 57 option(ENABLE_X11 "Enable X11 support?" ON)
46 option(ENABLE_VAAPI "Enable VAAPI support?" ON) 58 option(ENABLE_AML "Enable AML?" OFF)
47 option(ENABLE_VDPAU "Enable VDPAU support?" ON) 59 endif()
48 option(ENABLE_OPTICAL "Enable optical support?" ON)
49endif() 60endif()
50# System options 61# System options
51if(NOT WIN32) 62if(NOT WIN32)
@@ -53,25 +64,26 @@ if(NOT WIN32)
53 option(WITH_CPU "build with given cpu" OFF) 64 option(WITH_CPU "build with given cpu" OFF)
54 option(ENABLE_CCACHE "Enable Ccache support" ON) 65 option(ENABLE_CCACHE "Enable Ccache support" ON)
55endif() 66endif()
67if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL rbpi)
68 option(ENABLE_LIRC "Enable LIRC support?" ON)
69 option(ENABLE_EVENTCLIENTS "Enable event clients support?" OFF)
70endif()
56 71
57get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE) 72# Build static libraries per directory
58set(CORE_BUILD_DIR build) 73if(NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_GENERATOR STREQUAL Xcode)
59 74 set(ENABLE_STATIC_LIBS TRUE)
60message(STATUS "Source directory: ${CORE_SOURCE_DIR}") 75else()
61message(STATUS "Build directory: ${CMAKE_BINARY_DIR}") 76 set(ENABLE_STATIC_LIBS FALSE)
62 77endif()
63include(scripts/common/generatorsetup.cmake)
64include(scripts/common/addoptions.cmake)
65include(scripts/common/archsetup.cmake)
66include(scripts/common/macros.cmake)
67include(scripts/common/managestring.cmake)
68include(scripts/common/projectmacros.cmake)
69include(scripts/common/pathsetup.cmake)
70include(ExternalProject)
71 78
72core_find_git_rev() 79core_find_git_rev(APP_SCMID FULL)
73core_find_versions() 80core_find_versions()
74 81
82# Dynamically loaded libraries built with the project
83add_custom_target(${APP_NAME_LC}-libraries)
84set(LIBRARY_FILES "" CACHE STRING "" FORCE)
85mark_as_advanced(LIBRARY_FILES)
86
75set(INCLUDES ${CORE_SOURCE_DIR} 87set(INCLUDES ${CORE_SOURCE_DIR}
76 ${CORE_SOURCE_DIR}/addons/library.xbmc.addon 88 ${CORE_SOURCE_DIR}/addons/library.xbmc.addon
77 ${CORE_SOURCE_DIR}/lib 89 ${CORE_SOURCE_DIR}/lib
@@ -84,20 +96,19 @@ set(INCLUDES ${CORE_SOURCE_DIR}
84find_package(PkgConfig) 96find_package(PkgConfig)
85if(CMAKE_CROSSCOMPILING) 97if(CMAKE_CROSSCOMPILING)
86 if(PKG_CONFIG_EXECUTABLE) 98 if(PKG_CONFIG_EXECUTABLE)
87 message(STATUS "CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}")
88 set(PKG_CONFIG_FOUND TRUE) 99 set(PKG_CONFIG_FOUND TRUE)
89 endif() 100 endif()
90endif() 101endif()
91 102
92find_package(Threads REQUIRED) 103find_package(Threads REQUIRED QUIET)
93list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT}) 104list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT})
94 105
95# Required dependencies 106# Required dependencies
96set(required_deps Sqlite3 FreeType PCRE Cpluff LibDvd 107set(required_deps Sqlite3 FreeType PCRE Cpluff LibDvd
97 TinyXML Python Yajl Xslt 108 TinyXML Python Yajl
98 JPEG Lzo2 Fribidi TagLib FFMPEG CrossGUID) 109 Lzo2 Fribidi TagLib FFMPEG CrossGUID)
99if(NOT WIN32) 110if(NOT WIN32)
100 list(APPEND required_deps LibSmbClient ZLIB) 111 list(APPEND required_deps ZLIB)
101else() 112else()
102 list(APPEND required_deps D3DX11Effects) 113 list(APPEND required_deps D3DX11Effects)
103endif() 114endif()
@@ -106,18 +117,18 @@ if(CORE_SYSTEM_NAME STREQUAL android)
106endif() 117endif()
107 118
108# Optional dependencies 119# Optional dependencies
109set(optional_deps MicroHttpd MySqlClient SSH 120set(optional_deps MicroHttpd MySqlClient SSH XSLT
110 Alsa UDev Dbus Avahi 121 Alsa UDEV DBus Avahi SmbClient
111 PulseAudio VDPAU VAAPI) 122 PulseAudio VDPAU VAAPI)
112 123
113# Required, dyloaded deps 124# Required, dyloaded deps
114set(required_dyload Curl ASS) 125set(required_dyload Curl ASS)
115 126
116# Optional, dyloaded deps 127# Optional, dyloaded deps
117set(dyload_optional RTMP CEC Bluray Plist NFS) 128set(dyload_optional CEC Bluray Plist NFS)
118 129
119# Required by shared objects we link 130# Required by shared objects we link
120set(required_dep_libs PNG EXPAT) 131set(required_dep_libs EXPAT)
121 132
122# Required tools 133# Required tools
123find_package(TexturePacker REQUIRED) 134find_package(TexturePacker REQUIRED)
@@ -165,6 +176,11 @@ if(ENABLE_OPTICAL)
165 core_require_dep(Cdio) 176 core_require_dep(Cdio)
166endif() 177endif()
167 178
179if(ENABLE_LIRC)
180 set(LIRC_DEVICE /dev/lircd CACHE STRING "LIRC device to use")
181 list(APPEND DEP_DEFINES -DLIRC_DEVICE="${LIRC_DEVICE}" -DHAVE_LIRC=1)
182endif()
183
168if(ENABLE_AIRTUNES) 184if(ENABLE_AIRTUNES)
169 find_package(Shairplay) 185 find_package(Shairplay)
170 if(SHAIRPLAY_FOUND) 186 if(SHAIRPLAY_FOUND)
@@ -172,36 +188,36 @@ if(ENABLE_AIRTUNES)
172 endif() 188 endif()
173endif() 189endif()
174 190
175if(ENABLE_VTB) 191if(CORE_SYSTEM_NAME STREQUAL osx)
176 list(APPEND DEP_DEFINES -DHAVE_VIDEOTOOLBOXDECODER=1) 192 core_require_dep(Sdl)
193else()
194 core_optional_dep(Sdl)
177endif() 195endif()
178 196
179if(NOT WIN32) 197if(NOT WIN32)
180 core_optional_dep(OpenGl) 198 core_optional_dep(OpenGl)
181 if(OPENGL_FOUND) 199 if(OPENGL_FOUND)
182 if(NOT APPLE)
183 core_optional_dep(Sdl)
184 else()
185 core_require_dep(Sdl)
186 endif()
187 core_optional_dep(X ENABLE_X11) 200 core_optional_dep(X ENABLE_X11)
201 core_optional_dep(LibDRM ENABLE_X11)
188 core_optional_dep(XRandR ENABLE_X11) 202 core_optional_dep(XRandR ENABLE_X11)
189 else() 203 else()
190 core_optional_dep(OpenGLES ENABLE_OPENGLES) 204 core_optional_dep(OpenGLES)
191 if(OPENGLES_FOUND) 205 if(OPENGLES_FOUND)
192 core_optional_dep(EGL ENABLE_EGL)
193 core_optional_dep(OMX ENABLE_OMX)
194 core_optional_dep(AML ENABLE_AML)
195 core_optional_dep(X ENABLE_X11) 206 core_optional_dep(X ENABLE_X11)
196 core_optional_dep(Sdl) 207 core_optional_dep(LibDRM ENABLE_X11)
197 endif() 208 endif()
198 endif() 209 endif()
199 210 if(NOT APPLE)
200 if(CORE_SYSTEM_NAME STREQUAL rbpi) 211 core_require_dep(EGL)
201 core_require_dep(MMAL)
202 endif() 212 endif()
203endif() 213endif()
204 214
215if(CORE_SYSTEM_NAME STREQUAL android OR CORE_SYSTEM_NAME STREQUAL linux)
216 core_optional_dep(AML)
217elseif(CORE_SYSTEM_NAME STREQUAL rbpi)
218 core_require_dep(MMAL)
219endif()
220
205if(ENABLE_CCACHE) 221if(ENABLE_CCACHE)
206 core_optional_dep(CCache) 222 core_optional_dep(CCache)
207endif() 223endif()
@@ -217,7 +233,7 @@ add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp
217 -DARCH_DEFINES="${ARCH_DEFINES}" 233 -DARCH_DEFINES="${ARCH_DEFINES}"
218 -DAPP_SCMID=${APP_SCMID} 234 -DAPP_SCMID=${APP_SCMID}
219 -Dprefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 235 -Dprefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
220 -P ${PROJECT_SOURCE_DIR}/scripts/common/generateversionedfiles.cmake 236 -P ${PROJECT_SOURCE_DIR}/scripts/common/GenerateVersionedFiles.cmake
221 DEPENDS ${CORE_SOURCE_DIR}/version.txt 237 DEPENDS ${CORE_SOURCE_DIR}/version.txt
222 ${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in 238 ${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in
223 ${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in 239 ${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in
@@ -226,13 +242,15 @@ list(APPEND install_data addons/xbmc.addon/addon.xml)
226list(APPEND install_data addons/xbmc.json/addon.xml) 242list(APPEND install_data addons/xbmc.json/addon.xml)
227list(APPEND install_data addons/kodi.guilib/addon.xml) 243list(APPEND install_data addons/kodi.guilib/addon.xml)
228add_library(compileinfo OBJECT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) 244add_library(compileinfo OBJECT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp)
245set_target_properties(compileinfo PROPERTIES FOLDER "Build Utilities")
229target_compile_options(compileinfo PRIVATE "${SYSTEM_DEFINES}") 246target_compile_options(compileinfo PRIVATE "${SYSTEM_DEFINES}")
230 247
231# RC File 248# RC File
232if(WIN32) 249if(WIN32)
233 configure_file(${CORE_SOURCE_DIR}/xbmc/win32/XBMC_PC.rc.in 250 configure_file(${CORE_SOURCE_DIR}/xbmc/platform/win32/XBMC_PC.rc.in
234 ${CORE_BUILD_DIR}/xbmc/win32/XBMC_PC.rc @ONLY) 251 ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc @ONLY)
235 add_library(resources OBJECT ${CORE_BUILD_DIR}/xbmc/win32/XBMC_PC.rc) 252 add_library(resources OBJECT ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc)
253 set_target_properties(resources PROPERTIES FOLDER "Build Utilities")
236 target_include_directories(resources PRIVATE ${CORE_SOURCE_DIR}/tools/windows/packaging/media) 254 target_include_directories(resources PRIVATE ${CORE_SOURCE_DIR}/tools/windows/packaging/media)
237 set(RESOURCES $<TARGET_OBJECTS:resources>) 255 set(RESOURCES $<TARGET_OBJECTS:resources>)
238endif() 256endif()
@@ -247,23 +265,8 @@ mark_as_advanced(core_DEPENDS)
247mark_as_advanced(test_archives) 265mark_as_advanced(test_archives)
248mark_as_advanced(test_sources) 266mark_as_advanced(test_sources)
249 267
250file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/addon-bindings.txt bindings)
251foreach(binding ${bindings})
252 list(APPEND addon_bindings ${CORE_SOURCE_DIR}/${binding})
253endforeach()
254
255file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/cmake-files.txt cmakefiles)
256foreach(cmakefile ${cmakefiles})
257 list(APPEND cmake_files ${CORE_SOURCE_DIR}/${cmakefile})
258endforeach()
259
260add_subdirectory(${CORE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL) 268add_subdirectory(${CORE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL)
261 269set_target_properties(gtest PROPERTIES FOLDER "External Projects")
262# Subdirs
263core_add_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/common/*.txt
264 ${PROJECT_SOURCE_DIR}/treedata/${CORE_SYSTEM_NAME}/*.txt)
265core_add_optional_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/optional/common/*.txt
266 ${PROJECT_SOURCE_DIR}/treedata/optional/${CORE_SYSTEM_NAME}/*.txt)
267 270
268# copy files to build tree 271# copy files to build tree
269copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/common/*.txt 272copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/common/*.txt
@@ -281,23 +284,9 @@ endforeach()
281 284
282add_custom_target(pack-skins ALL 285add_custom_target(pack-skins ALL
283 DEPENDS TexturePacker::TexturePacker export-files ${XBT_FILES}) 286 DEPENDS TexturePacker::TexturePacker export-files ${XBT_FILES})
284 287set_target_properties(pack-skins PROPERTIES FOLDER "Build Utilities")
285core_link_library(exif system/libexif)
286if(CORE_SYSTEM_NAME STREQUAL linux)
287 core_link_library(sse4 system/libsse4)
288endif()
289
290core_link_library(XBMC_addon addons/library.xbmc.addon/libXBMC_addon)
291core_link_library(XBMC_codec addons/library.xbmc.codec/libXBMC_codec)
292core_link_library(XBMC_pvr addons/library.xbmc.pvr/libXBMC_pvr)
293core_link_library(KODI_adsp addons/library.kodi.adsp/libKODI_adsp)
294core_link_library(KODI_audioengine addons/library.kodi.audioengine/libKODI_audioengine)
295core_link_library(KODI_guilib addons/library.kodi.guilib/libKODI_guilib)
296core_link_library(KODI_inputstream addons/library.kodi.inputstream/libKODI_inputstream)
297core_link_library(KODI_peripheral addons/library.kodi.peripheral/libKODI_peripheral)
298 288
299file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/system/players/VideoPlayer) 289file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/system/players/VideoPlayer)
300add_custom_target(wrap-libraries ALL DEPENDS ${WRAP_FILES})
301 290
302set(LIBCEC_SONAME "${CEC_SONAME}") 291set(LIBCEC_SONAME "${CEC_SONAME}")
303if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL android) 292if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL android)
@@ -308,62 +297,166 @@ elseif(CORE_SYSTEM_NAME STREQUAL android)
308 ${CORE_BUILD_DIR}/DllPaths_generated_android.h @ONLY) 297 ${CORE_BUILD_DIR}/DllPaths_generated_android.h @ONLY)
309endif() 298endif()
310 299
300# main library (used for main binary and tests)
301add_library(lib${APP_NAME_LC} STATIC $<TARGET_OBJECTS:compileinfo>)
302set_target_properties(lib${APP_NAME_LC} PROPERTIES PREFIX "")
303add_dependencies(lib${APP_NAME_LC} libcpluff ffmpeg dvdnav crossguid)
304
311# Codegen 305# Codegen
312add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig) 306add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig)
313 307
314# Other files (IDE) 308# Other files (IDE)
315set(OTHER_FILES README.md) 309set(OTHER_FILES README.md)
316 310
311# Subdirs
312core_add_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/common/*.txt
313 ${PROJECT_SOURCE_DIR}/treedata/${CORE_SYSTEM_NAME}/*.txt)
314core_add_optional_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/optional/common/*.txt
315 ${PROJECT_SOURCE_DIR}/treedata/optional/${CORE_SYSTEM_NAME}/*.txt)
316
317target_link_libraries(lib${APP_NAME_LC} PUBLIC ${core_DEPENDS} ${SYSTEM_LDFLAGS} ${DEPLIBS} ${CMAKE_DL_LIBS})
318set_target_properties(lib${APP_NAME_LC} PROPERTIES PROJECT_LABEL "xbmc")
319source_group_by_folder(lib${APP_NAME_LC} RELATIVE ${CORE_SOURCE_DIR}/xbmc)
320if(WIN32)
321 add_precompiled_header(lib${APP_NAME_LC} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi)
322 set_language_cxx(lib${APP_NAME_LC})
323endif()
324
317# main binary 325# main binary
318add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} $<TARGET_OBJECTS:compileinfo> "${RESOURCES}" ${OTHER_FILES}) 326if(NOT CORE_SYSTEM_NAME STREQUAL android)
327 add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} "${RESOURCES}" ${OTHER_FILES})
328else()
329 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
330 add_library(${APP_NAME_LC} SHARED ${CORE_MAIN_SOURCE} "${RESOURCES}" ${OTHER_FILES})
331endif()
332add_dependencies(${APP_NAME_LC} ${APP_NAME_LC}-libraries export-files pack-skins)
319whole_archive(_MAIN_LIBRARIES ${core_DEPENDS}) 333whole_archive(_MAIN_LIBRARIES ${core_DEPENDS})
320target_link_libraries(${APP_NAME_LC} ${SYSTEM_LDFLAGS} ${_MAIN_LIBRARIES} ${DEPLIBS} ${CMAKE_DL_LIBS}) 334target_link_libraries(${APP_NAME_LC} ${_MAIN_LIBRARIES} lib${APP_NAME_LC} ${DEPLIBS})
321unset(_MAIN_LIBRARIES) 335unset(_MAIN_LIBRARIES)
322add_dependencies(${APP_NAME_LC} export-files) 336
323if(NOT WIN32) 337if(WIN32)
324 set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin")
325else()
326 set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) 338 set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON)
327 copy_main_dlls_to_buildtree() 339 set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC})
340 target_sources(kodi PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest)
341elseif(CORE_SYSTEM_NAME STREQUAL android)
342 # Nothing
343else()
344 set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin")
328endif() 345endif()
329 346
330# testing 347# testing
331copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/test-reference-data.txt NO_INSTALL) 348copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/test-reference-data.txt NO_INSTALL)
332add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CORE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp $<TARGET_OBJECTS:compileinfo>) 349add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CORE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp ${test_sources})
333whole_archive(_TEST_LIBRARIES ${core_DEPENDS} gtest ${test_archives}) 350whole_archive(_TEST_LIBRARIES ${core_DEPENDS} gtest)
334target_link_libraries(${APP_NAME_LC}-test ${SYSTEM_LDFLAGS} ${_TEST_LIBRARIES} ${DEPLIBS} ${CMAKE_DL_LIBS}) 351target_link_libraries(${APP_NAME_LC}-test PRIVATE ${SYSTEM_LDFLAGS} ${_TEST_LIBRARIES} lib${APP_NAME_LC} ${DEPLIBS} ${CMAKE_DL_LIBS})
335unset(_TEST_LIBRARIES) 352unset(_TEST_LIBRARIES)
336add_dependencies(${APP_NAME_LC}-test export-files) 353add_dependencies(${APP_NAME_LC}-test ${APP_NAME_LC}-libraries export-files)
354if(WIN32)
355 add_precompiled_header(${APP_NAME_LC}-test pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi)
356endif()
337 357
338# make test and make check (cannot be executed when cross compiling) 358# Enable unit-test related targets
339if(NOT CMAKE_CROSSCOMPILING) 359if(CORE_HOST_IS_TARGET)
340 enable_testing() 360 enable_testing()
341 gtest_add_tests(${APP_NAME_LC}-test "" ${test_sources}) 361 gtest_add_tests(${APP_NAME_LC}-test "" ${test_sources})
342 add_custom_target(check ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) 362 add_custom_target(check ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
343 add_dependencies(check ${APP_NAME_LC}-test) 363 add_dependencies(check ${APP_NAME_LC}-test)
344 364
365 # Valgrind (memcheck)
366 find_program(VALGRIND_EXECUTABLE NAMES valgrind)
367 if(VALGRIND_EXECUTABLE)
368 set(CTEST_MEMORYCHECK_COMMAND ${VALGRIND_EXECUTABLE})
369 set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --trace-children=yes --leak-check=yes --track-origins=yes")
370 include(CTest)
371 add_custom_target(check-valgrind ${CMAKE_CTEST_COMMAND} -D ExperimentalMemCheck \${ARGS} WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
372 add_dependencies(check-valgrind ${APP_NAME_LC}-test)
373 endif()
374
345 # For testing commit series 375 # For testing commit series
346 add_custom_target(check-commits ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/checkcommits.cmake 376 add_custom_target(check-commits ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/CheckCommits.cmake
347 -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}) 377 -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR})
378 set_target_properties(check-commits PROPERTIES FOLDER "Build Utilities")
379
380 # code coverage
381 if(CMAKE_BUILD_TYPE STREQUAL Coverage)
382 if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake)
383 include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake)
384 else()
385 message(FATAL_ERROR "Code coverage not (yet) implemented for platform ${CORE_SYSTEM_NAME}")
386 endif()
387 endif()
388
389 # Documentation
390 find_package(Doxygen)
391 if(DOXYGEN_FOUND)
392 add_custom_target(doc
393 COMMAND ${DOXYGEN_EXECUTABLE} ${CORE_SOURCE_DIR}/doxygen_resources/Doxyfile.doxy
394 COMMAND ${CMAKE_COMMAND} -E echo "Documentation built to: file://${CORE_SOURCE_DIR}/docs/html/index.html"
395 WORKING_DIRECTORY ${CORE_SOURCE_DIR}/doxygen_resources
396 COMMENT "Generating Doxygen documentation" VERBATIM)
397 endif()
348endif() 398endif()
349 399
350# link wrapper 400# link wrapper
351if(FFMPEG_LINK_EXECUTABLE) 401if(FFMPEG_LINK_EXECUTABLE)
352 set(CMAKE_CXX_LINK_EXECUTABLE "${FFMPEG_LINK_EXECUTABLE}") 402 set(CMAKE_CXX_LINK_EXECUTABLE "${FFMPEG_LINK_EXECUTABLE}")
353endif() 403endif()
404if(FFMPEG_CREATE_SHARED_LIBRARY)
405 set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${FFMPEG_CREATE_SHARED_LIBRARY}")
406endif()
407
408# Platform specific additional extra targets
409if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake)
410 include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake)
411endif()
412
413include(scripts/${CORE_SYSTEM_NAME}/Install.cmake)
354 414
355# randr 415# Add uninstall target
356if(ENABLE_X11 AND XRANDR_FOUND) 416if(CMAKE_GENERATOR MATCHES Makefile)
357 add_executable(kodi-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c) 417 add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/Uninstall.cmake)
358 target_link_libraries(kodi-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) 418 set_target_properties(uninstall PROPERTIES FOLDER "Build Utilities")
359endif() 419endif()
360 420
361# XBMCHelper 421# Create target that allows to build binary-addons.
362if(CORE_SYSTEM_TYPE STREQUAL darwin) 422# Use make binary-addons ADDONS="visualization.spectrum" to select the addons to build.
363 add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) 423if(CMAKE_GENERATOR STREQUAL "Unix Makefiles")
424 if(CMAKE_CROSSCOMPILING)
425 set(_cross_args CROSS_COMPILING=yes TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
426 endif()
427 if(NOT CORE_SYSTEM_NAME STREQUAL android)
428 set(_prefix ${CMAKE_BINARY_DIR}/addons)
429 set(_extra "CMAKE_EXTRA=-DPACKAGE_ZIP=ON")
430 else()
431 set(_prefix ${CMAKE_INSTALL_PREFIX})
432 endif()
433 add_custom_target(binary-addons
434 COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons clean
435 COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99
436 PREFIX=${_prefix} INSTALL_PREFIX=${_prefix} ${_cross_args} ${_extra})
437 unset(_cross_args)
438 unset(_prefix)
364endif() 439endif()
365 440
366include(scripts/${CORE_SYSTEM_NAME}/install.cmake) 441# Prepare add-on build env
442core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk)
443foreach(binding ${bindings})
444 string(REPLACE " =" ";" binding "${binding}")
445 string(REPLACE "+=" ";" binding "${binding}")
446 list(GET binding 1 header)
447 get_filename_component(file ${header} NAME)
448 configure_file(${CORE_SOURCE_DIR}/${header} ${CORE_BUILD_DIR}/include/${APP_NAME_LC}/${file} COPYONLY)
449endforeach()
450
451set(APP_LIB_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${APP_NAME_LC})
452set(APP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/${APP_NAME_LC})
453set(CXX11_SWITCH "-std=c++11")
454configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in
455 ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/${APP_NAME}Config.cmake @ONLY)
456configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddonHelpers.cmake
457 ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddonHelpers.cmake COPYONLY)
458configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddOptions.cmake
459 ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddOptions.cmake COPYONLY)
367 460
368# Status 461# Status
369message(STATUS "#---- CONFIGURATION ----#") 462message(STATUS "#---- CONFIGURATION ----#")
@@ -388,6 +481,8 @@ if(VERBOSE)
388 message(STATUS "datarootdir: ${datarootdir}") 481 message(STATUS "datarootdir: ${datarootdir}")
389 message(STATUS "#---------------------------------------------#") 482 message(STATUS "#---------------------------------------------#")
390 message(STATUS "GIT_REV: ${APP_SCMID}") 483 message(STATUS "GIT_REV: ${APP_SCMID}")
484 message(STATUS "#---------------------------------------------#")
485 message(STATUS "CPACK_GENERATOR : ${CPACK_GENERATOR}")
486 message(STATUS "CPACK_SOURCE_GENERATOR: ${CPACK_SOURCE_GENERATOR}")
487 message(STATUS "#---------------------------------------------#")
391endif() 488endif()
392message(STATUS "#---------------------------------------------#")
393
diff --git a/project/cmake/KodiConfig.cmake.in b/project/cmake/KodiConfig.cmake.in
new file mode 100644
index 0000000..c02a680
--- /dev/null
+++ b/project/cmake/KodiConfig.cmake.in
@@ -0,0 +1,34 @@
1set(APP_NAME @APP_NAME@)
2set(APP_NAME_LC @APP_NAME_LC@)
3set(APP_NAME_UC @APP_NAME_UC@)
4set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
5set(APP_VERSION_MINOR @APP_VERSION_MINOR@)
6if(NOT @APP_NAME_UC@_PREFIX)
7 set(@APP_NAME_UC@_PREFIX @APP_PREFIX@)
8endif()
9if(NOT @APP_NAME_UC@_INCLUDE_DIR)
10 set(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@)
11endif()
12if(NOT @APP_NAME_UC@_LIB_DIR)
13 set(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@)
14endif()
15if(NOT @APP_NAME_UC@_DATA_DIR)
16 set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@)
17endif()
18if(NOT WIN32)
19 set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
20endif()
21list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake)
22
23string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@")
24add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON)
25
26if(NOT CORE_SYSTEM_NAME)
27 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
28 set(CORE_SYSTEM_NAME "osx")
29 else()
30 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME)
31 endif()
32endif()
33
34include(AddonHelpers)
diff --git a/project/cmake/README.md b/project/cmake/README.md
index 28af525..f3d727e 100644
--- a/project/cmake/README.md
+++ b/project/cmake/README.md
@@ -3,14 +3,14 @@
3This files describes Kodi's CMake based buildsystem. CMake is a cross-platform 3This files describes Kodi's CMake based buildsystem. CMake is a cross-platform
4tool for generating makefiles as well as project files used by IDEs. 4tool for generating makefiles as well as project files used by IDEs.
5 5
6The current version of the buildsystem is capable of building the main Kodi 6The current version of the buildsystem is capable of building and packaging
7executable (but no packaging or dependency management yet) for the following 7Kodi for the following platforms:
8platforms:
9 8
10- Linux (GNU Makefiles) 9- Linux (GNU Makefiles, Ninja)
11- Windows (NMake Makefiles, Visual Studio 14 (2015)) 10- Windows (NMake Makefiles, Visual Studio 14 (2015), Ninja)
12- OSX (GNU Makefiles, Xcode) 11- macOS and iOS (GNU Makefiles, Xcode, Ninja)
13- Android (GNU Makefiles) 12- Android (GNU Makefiles)
13- FreeBSD (GNU Makefiles)
14 14
15Before building Kodi with CMake, please ensure that you have the platform 15Before building Kodi with CMake, please ensure that you have the platform
16specific dependencies installed. 16specific dependencies installed.
@@ -44,12 +44,12 @@ are downloaded using `DownloadBuildDeps.bat` and `DownloadMingwBuildEnv.bat`
44and that the mingw libs (ffmpeg, libdvd and others) are built using 44and that the mingw libs (ffmpeg, libdvd and others) are built using
45`make-mingwlibs.bat`. 45`make-mingwlibs.bat`.
46 46
47### OSX 47### macOS
48 48
49For OSX the required dependencies can be found in 49For macOS the required dependencies can be found in
50[docs/README.osx](https://github.com/xbmc/xbmc/tree/master/docs/README.osx). 50[docs/README.osx](https://github.com/xbmc/xbmc/tree/master/docs/README.osx).
51 51
52On OSX it is necessary to build the dependencies in `tools/depends` using 52On macOS it is necessary to build the dependencies in `tools/depends` using
53`./bootstrap && ./configure --host=<PLATFORM> && make`. The other steps such 53`./bootstrap && ./configure --host=<PLATFORM> && make`. The other steps such
54as `make -C tools/depends/target/xbmc` and `make xcode_depends` are not needed 54as `make -C tools/depends/target/xbmc` and `make xcode_depends` are not needed
55as these steps are covered already by the CMake project. 55as these steps are covered already by the CMake project.
@@ -57,7 +57,7 @@ as these steps are covered already by the CMake project.
57### Android 57### Android
58 58
59The dependencies needed to compile for Android can be found in 59The dependencies needed to compile for Android can be found in
60[docs/README.osx](https://github.com/xbmc/xbmc/tree/master/docs/README.android) 60[docs/README.android](https://github.com/xbmc/xbmc/tree/master/docs/README.android)
61. All described steps have to be executed (except 5.2 which is replaced by the 61. All described steps have to be executed (except 5.2 which is replaced by the
62respective CMake command below). 62respective CMake command below).
63 63
@@ -89,6 +89,22 @@ cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)
89 89
90`CMAKE_BUILD_TYPE` defaults to `Release`. 90`CMAKE_BUILD_TYPE` defaults to `Release`.
91 91
92#### Debian package generation
93The buildsystem is capable of generating Debian packages using CPack. To generate them, `CPACK_GENERATOR` has to be set to *DEB*, i.e. executing CMake's configure step with `-DCPACK_GENERATOR=DEB`.
94You should use CMake/CPack 3.6.0 or higher. Lower versions can generate the packages but package names will be mangled.
95
96The following optional variables (which can be passed to buildsystem when executing cmake with the -D`<variable-name>=<value>` format) can be used to manipulate package type, name and version:
97
98- `DEBIAN_PACKAGE_TYPE` controls the name and version of generated packages. Accepted values are `stable`, `unstable` and `nightly` (default is `nightly`).
99- `DEBIAN_PACKAGE_EPOCH` controls package epoch (default is `2`)
100- `DEBIAN_PACKAGE_VERSION` controls package version (default is `0`)
101- `DEBIAN_PACKAGE_REVISION` controls package revision (no default is set)
102
103Packages metadata can be changed simply by editing files present in the `cpack/deb` folder
104A lot more variables are available (see cpack/CPackDebian.cmake file) but you shouldn't mess with them unless you know what you're doing.
105
106Generated packages can be found in <BUILD_DIR>/packages.
107
92### Raspberry Pi with GNU Makefiles 108### Raspberry Pi with GNU Makefiles
93 109
94``` 110```
@@ -96,23 +112,28 @@ cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KO
96cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) 112cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)
97``` 113```
98 114
99### Windows with NMake Makefiles 115### Windows with Visual Studio project files
100 116
101``` 117```
102cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release <KODI_SRC>/project/cmake/ 118cmake -G "Visual Studio 14" <KODI_SRC>/project/cmake/
103cmake --build . # or: nmake 119cmake --build . --config "Debug" # or: Build solution with Visual Studio
104kodi.exe 120Debug\kodi.exe
105``` 121```
106 122
107### Windows with Visual Studio project files 123#### Windows installer generation
124
125The script [project/Win32BuildSetup](https://github.com/xbmc/xbmc/blob/master/project/Win32BuildSetup/BuildSetup.bat)
126builds an installable package for Windows.
127
128### Windows with NMake Makefiles
108 129
109``` 130```
110cmake -G "Visual Studio 14" <KODI_SRC>/project/cmake/ 131cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release <KODI_SRC>/project/cmake/
111cmake --build . --config "Debug" # or: Build solution with Visual Studio 132cmake --build . # or: nmake
112set KODI_HOME="%CD%" && Debug\kodi.exe 133kodi.exe
113``` 134```
114 135
115### OSX with GNU Makefiles 136### macOS with GNU Makefiles
116 137
117``` 138```
118cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/ 139cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/
@@ -120,12 +141,28 @@ cmake --build . -- VERBOSE=1 -j$(sysctl -n hw.ncpu) # or: make VERBOSE=1 -j$(sy
120./kodi.bin 141./kodi.bin
121``` 142```
122 143
123### OSX with Xcode project files 144### macOS with Xcode project files
124 145
125``` 146```
126cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake -G "Xcode" <KODI_SRC>/project/cmake/ 147cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake -G "Xcode" <KODI_SRC>/project/cmake/
127cmake --build . --config "Release" -- -verbose -jobs $(sysctl -n hw.ncpu) # or: Build solution with Xcode 148cmake --build . --config "Release" -- -verbose -jobs $(sysctl -n hw.ncpu) # or: Build solution with Xcode
128KODI_HOME=$(pwd) ./Release/kodi.bin 149./Release/kodi.bin
150```
151
152#### macOS installer generation
153
154Afterwards an installable DMG for macOS can be built with the following command:
155
156```
157cmake --build . --config "Release" --target "dmg" # or: make dmg
158```
159
160#### iOS package generation
161
162Consequently an installable DEB for iOS can be built with the following command:
163
164```
165make deb
129``` 166```
130 167
131### Android with GNU Makefiles 168### Android with GNU Makefiles
@@ -135,11 +172,107 @@ cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KO
135cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) 172cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)
136``` 173```
137 174
175#### Android package generation
176
177An installable APK for Android can be built with the following command:
178
179```
180make apk
181```
182
183## Options
184
185Kodi supports a number of build options that can enable or disable certain
186functionality.i These options must be set when running CMake with
187`-DENABLE_<OPTION>=<ON|OFF|AUTO`. The default is `AUTO` which enables
188the option if a certain dependency is found. For example CEC support is
189enabled if libCEC is available. `ON` forcefully enables the dependency
190and the CMake run will fail if the related dependency is not available.
191This is mostly useful for packagers. `OFF` will disable the feature.
192
193Example for forcefully enabling VAAPI and disabling VDPAU:
194
195```
196cmake ... -DENABLE_VAAPI=ON -DENABLE_VDPAU=OFF ...
197```
198
199Example for building with external FFMPEG:
200
201```
202cmake ... -DFFMPEG_PATH=/opt/ffmpeg -DENABLE_INTERNAL_FFMPEG=OFF ...
203```
204
205For more information and an updated list of option, please check the
206main [project/cmake/CMakeLists.txt](https://github.com/xbmc/xbmc/tree/master/project/cmake/CMakeLists.txt).
207
208## Tests
209
210Kodi uses Google Test as its testing framework. Each test file is scanned for tests and these
211are added to CTest, which is the native test driver for CMake.
212
213This scanning happens at configuration time. If tests depend on generated support files which
214should not be scanned, then those support files should be added to the SUPPORT_SOURCES
215variable as opposed to SOURCES before calling core_add_test. You might want to do this where
216the generated support files would not exist at configure time, or if they are so large that
217scanning them would take up an unreasonable amount of configure time.
218
138## Extra targets 219## Extra targets
139 220
140When using the makefile builds a few extra targets are defined: 221When using the makefile builds a few extra targets are defined:
141 222
142- `make check` builds and executes the test suite. 223- `make check` builds and executes the test suite.
224- `make check-valgrind` builds and executes the test suite with valgrind memcheck.
225- `make doc` builds the Doxygen documentation.
226
227Code coverage (with Gcov, LCOV and Gcovr) can be built on Linux:
228
229- CMake has to be executed with `-DCMAKE_BUILD_TYPE=Coverage`
230- `make coverage` generates an HTML code coverage report.
231- `make coverage_xml` generates an XML code coverage report.
232
233## Building binary addons
234
235The CMake build system integrates with the addon build system if the GNU
236Makefile generator is used. This offers an easy way to build addons for
237packagers or Kodi developers who don't work on addons.
238
239```
240make binary-addons
241```
242
243Specific addons can be built with:
244
245```
246make binary-addons ADDONS="visualization.spectrum pvr.demo"
247```
248
249Addon developers can build single addons into the Kodi build directory
250so that the addon can be tested with self-compiled specific versions of Kodi.
251
252```
253mkdir pvr.demo-build && cd pvr.demo-build
254cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=<KODI_BUILD_DIR>/build -DKODI_BUILD_DIR=<KODI_BUILD_DIR> <pvr.demo-SRC>
255make
256```
257
258It is recommended to specify the directories as absolute paths. If relative
259paths are used, they are considered relative to the build directory in which
260`cmake` was executed (aka the current working working directory).
261
262Both methods work only for already existing addons. See this
263[forum thread](http://forum.kodi.tv/showthread.php?tid=219166&pid=1934922#pid1934922)
264and [addons/README.md](https://github.com/xbmc/xbmc/blob/master/project/cmake/addons/README.md)
265for addon development and detailed documentation about the addon build system.
266
267## Sanitizers
268
269Clang and GCC support different kinds of Sanitizers. To enable a Sanitizer call CMake with the
270option `-DECM_ENABLE_SANITIZERS=’san1;san2;...'`. For more information about enabling the
271Sanitizers read the documentation in
272[modules/extra/ECMEnableSanitizers.cmake](https://github.com/xbmc/xbmc/tree/master/project/cmake/modules/extra/ECMEnableSanitizers.cmake).
273
274It is also recommended to read the sections about the Sanitizers in the [Clang
275documentation](http://clang.llvm.org/docs/).
143 276
144## Debugging the build 277## Debugging the build
145 278
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index 982d977..96e544b 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -1,12 +1,6 @@
1cmake_minimum_required(VERSION 3.1)
1project(kodi-addons) 2project(kodi-addons)
2 3
3if(WIN32)
4 # there seems to be a bug in the CMake generator implementation in CMake 2.8.x releases for WIN32
5 cmake_minimum_required(VERSION 3.0)
6else()
7 cmake_minimum_required(VERSION 2.8)
8endif()
9
10list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) 4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
11 5
12option(ADDON_TARBALL_CACHING "Cache downloaded addon source tarballs?" ON) 6option(ADDON_TARBALL_CACHING "Cache downloaded addon source tarballs?" ON)
@@ -31,14 +25,17 @@ endif()
31include(ExternalProject) 25include(ExternalProject)
32 26
33### setup all the necessary paths 27### setup all the necessary paths
34if(NOT APP_ROOT AND NOT XBMCROOT) 28if(APP_ROOT)
35 set(APP_ROOT ${PROJECT_SOURCE_DIR}/../../..) 29 set(CORE_SOURCE_DIR ${APP_ROOT})
36elseif(NOT APP_ROOT) 30 unset(APP_ROOT)
37 file(TO_CMAKE_PATH "${XBMCROOT}" APP_ROOT) 31 message(WARNING "APP_ROOT is deprecated. Please use CORE_SOURCE_DIR instead.")
32endif()
33if(NOT CORE_SOURCE_DIR)
34 set(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../..)
38else() 35else()
39 file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) 36 file(TO_CMAKE_PATH "${CORE_SOURCE_DIR}" CORE_SOURCE_DIR)
40endif() 37endif()
41get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) 38get_filename_component(CORE_SOURCE_DIR "${CORE_SOURCE_DIR}" ABSOLUTE)
42 39
43if(NOT BUILD_DIR) 40if(NOT BUILD_DIR)
44 set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") 41 set(BUILD_DIR "${CMAKE_BINARY_DIR}/build")
@@ -47,29 +44,29 @@ else()
47endif() 44endif()
48get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) 45get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE)
49 46
50if(NOT DEPENDS_PATH) 47if(NOT ADDON_DEPENDS_PATH)
51 set(DEPENDS_PATH "${BUILD_DIR}/depends") 48 set(ADDON_DEPENDS_PATH "${BUILD_DIR}/depends")
52else() 49else()
53 file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) 50 file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
54endif() 51endif()
55get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) 52get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
56 53
57if(NOT PLATFORM_DIR) 54if(NOT PLATFORM_DIR)
58 set(PLATFORM_DIR ${APP_ROOT}/project/cmake/platform/${CORE_SYSTEM_NAME}) 55 set(PLATFORM_DIR ${CORE_SOURCE_DIR}/project/cmake/platform/${CORE_SYSTEM_NAME})
59 file(TO_CMAKE_PATH "${PLATFORM_DIR}" PLATFORM_DIR) 56 file(TO_CMAKE_PATH "${PLATFORM_DIR}" PLATFORM_DIR)
60endif() 57endif()
61 58
62# make sure CMAKE_PREFIX_PATH is set 59# make sure CMAKE_PREFIX_PATH is set
63if(NOT CMAKE_PREFIX_PATH) 60if(NOT CMAKE_PREFIX_PATH)
64 set(CMAKE_PREFIX_PATH "${DEPENDS_PATH}") 61 set(CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}")
65else() 62else()
66 file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) 63 file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
67 list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}") 64 list(APPEND CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}")
68endif() 65endif()
69 66
70# check for autoconf stuff to pass on 67# check for autoconf stuff to pass on
71if(AUTOCONF_FILES) 68if(AUTOCONF_FILES)
72 separate_arguments(AUTOCONF_FILES) 69 string(REPLACE " " ";" AUTOCONF_FILES ${AUTOCONF_FILES})
73 set(CROSS_AUTOCONF "yes") 70 set(CROSS_AUTOCONF "yes")
74endif() 71endif()
75 72
@@ -80,8 +77,9 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
80 77
81set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} 78set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
82 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> 79 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
83 -DPACKAGE_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig 80 -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig
84 -DDEPENDS_PATH=${DEPENDS_PATH} 81 -DADDON_DEPENDS_PATH=${ADDON_DEPENDS_PATH}
82 -DOVERRIDE_PATHS=${OVERRIDE_PATHS}
85 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 83 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
86 -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} 84 -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE}
87 -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} 85 -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX}
@@ -108,13 +106,13 @@ if(PACKAGE_ZIP)
108 endif() 106 endif()
109 list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR}) 107 list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR})
110 108
111 MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") 109 message(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})")
112endif() 110endif()
113 111
114if(CMAKE_TOOLCHAIN_FILE) 112if(CMAKE_TOOLCHAIN_FILE)
115 list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) 113 list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
116 MESSAGE(STATUS "Toolchain specified") 114 message(STATUS "Toolchain specified")
117 MESSAGE(STATUS ${BUILD_ARGS}) 115 message(STATUS ${BUILD_ARGS})
118endif() 116endif()
119 117
120if(NOT ADDONS_TO_BUILD) 118if(NOT ADDONS_TO_BUILD)
@@ -122,7 +120,7 @@ if(NOT ADDONS_TO_BUILD)
122else() 120else()
123 string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) 121 string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD)
124 message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") 122 message(STATUS "Building following addons: ${ADDONS_TO_BUILD}")
125 separate_arguments(ADDONS_TO_BUILD) 123 string(REPLACE " " ";" ADDONS_TO_BUILD ${ADDONS_TO_BUILD})
126endif() 124endif()
127 125
128if(NOT ADDONS_DEFINITION_DIR) 126if(NOT ADDONS_DEFINITION_DIR)
@@ -133,12 +131,14 @@ endif()
133get_filename_component(ADDONS_DEFINITION_DIR "${ADDONS_DEFINITION_DIR}" ABSOLUTE) 131get_filename_component(ADDONS_DEFINITION_DIR "${ADDONS_DEFINITION_DIR}" ABSOLUTE)
134 132
135if(ADDON_SRC_PREFIX) 133if(ADDON_SRC_PREFIX)
136 get_filename_component(ADDON_SRC_PREFIX "${ADDON_SRC_PREFIX}" ABSOLUTE) 134 if(NOT IS_ABSOLUTE ${ADDON_SRC_PREFIX})
135 get_filename_component(ADDON_SRC_PREFIX "${CMAKE_BINARY_DIR}/${ADDON_SRC_PREFIX}" ABSOLUTE)
136 endif()
137 message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") 137 message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}")
138endif() 138endif()
139 139
140if(NOT APP_LIB_DIR) 140if(NOT APP_LIB_DIR)
141 set(APP_LIB_DIR "${DEPENDS_PATH}/lib/kodi") 141 set(APP_LIB_DIR "${ADDON_DEPENDS_PATH}/lib/kodi")
142else() 142else()
143 file(TO_CMAKE_PATH "${APP_LIB_DIR}" APP_LIB_DIR) 143 file(TO_CMAKE_PATH "${APP_LIB_DIR}" APP_LIB_DIR)
144endif() 144endif()
@@ -155,7 +155,7 @@ if(EXISTS ${PLATFORM_DIR}/defines.txt)
155endif() 155endif()
156 156
157# include check_target_platform() function 157# include check_target_platform() function
158include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) 158include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake)
159 159
160set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) 160set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
161if(NOT WIN32) 161if(NOT WIN32)
@@ -164,21 +164,23 @@ if(NOT WIN32)
164 if(NOT ${can_write} AND CMAKE_SYSTEM_NAME STREQUAL "Linux") 164 if(NOT ${can_write} AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
165 set(NEED_SUDO TRUE) 165 set(NEED_SUDO TRUE)
166 set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) 166 set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install)
167 message(STATUS "NEED_SUDO: ${NEED_SUDO}") 167 list(APPEND BUILD_ARGS -DOVERRIDE_PATHS=ON)
168 message(STATUS "NEED_SUDO: ${NEED_SUDO} (no write permission for ${CMAKE_INSTALL_PREFIX})")
168 endif() 169 endif()
169endif() 170endif()
170 171
171### prepare the build environment for the binary addons 172### prepare the build environment for the binary addons
172# copy the prepare-env.cmake script to the depends path so that we can include it 173# copy the PrepareEnv.cmake script to the depends path so that we can include it
173file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${APP_LIB_DIR}) 174file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake DESTINATION ${APP_LIB_DIR})
174 175
175# add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found 176# add the location of PrepareEnv.cmake to CMAKE_MODULE_PATH so that it is found
176list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR}) 177list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR})
177 178
178# include prepare-env.cmake which contains the logic to install the addon header bindings etc 179# include PrepareEnv.cmake which contains the logic to install the addon header bindings etc
179include(prepare-env) 180include(PrepareEnv)
180 181
181### add the depends subdirectory for any general dependencies 182### add the depends subdirectory for any general dependencies
183message(STATUS "\n-- ---- Preparing general dependencies ----")
182add_subdirectory(depends) 184add_subdirectory(depends)
183 185
184# add a custom target "package-addons" which will package and install all addons 186# add a custom target "package-addons" which will package and install all addons
@@ -198,12 +200,13 @@ if(NOT addons)
198 file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) 200 file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR})
199 endif() 201 endif()
200 202
201 string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") 203 string(REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}")
202 # generate the bootstrap buildsystem 204 # generate the bootstrap buildsystem
203 execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap 205 execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap
204 -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} 206 -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR}
205 -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} 207 -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR}
206 -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR} 208 -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR}
209 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
207 WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) 210 WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR})
208 211
209 # execute the generated bootstrap buildsystem 212 # execute the generated bootstrap buildsystem
@@ -218,10 +221,14 @@ if(NOT addons)
218 endif() 221 endif()
219endif() 222endif()
220 223
224# Track if at least one addon has been found. Everything else is likely an
225# error either in ADDONS_TO_BUILD or in the directory configuration.
226set(SUPPORTED_ADDON_FOUND FALSE)
227
221foreach(addon ${addons}) 228foreach(addon ${addons})
222 if(NOT (addon MATCHES platforms.txt)) 229 if(NOT (addon MATCHES platforms.txt))
223 file(STRINGS ${addon} def) 230 file(STRINGS ${addon} def)
224 separate_arguments(def) 231 string(REPLACE " " ";" def ${def})
225 list(GET def 0 id) 232 list(GET def 0 id)
226 233
227 set(ADDON_FOUND FALSE) 234 set(ADDON_FOUND FALSE)
@@ -236,17 +243,18 @@ foreach(addon ${addons})
236 endif() 243 endif()
237 244
238 if(ADDON_FOUND) 245 if(ADDON_FOUND)
239 get_filename_component(dir ${addon} PATH) 246 message(STATUS "\n-- ---- Configuring addon ${addon} ----")
247 set(SUPPORTED_ADDON_FOUND TRUE)
248
249 get_filename_component(dir ${addon} DIRECTORY)
240 250
241 # check if the addon has a platforms.txt 251 # check if the addon has a platforms.txt
242 set(platform_found FALSE) 252 set(platform_found FALSE)
243 check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) 253 check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found)
244 254
245 if (${platform_found}) 255 if(${platform_found})
246 # make sure the output directory is clean 256 # make sure the output directory is clean
247 if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}") 257 file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
248 file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
249 endif()
250 258
251 # get the URL and revision of the addon 259 # get the URL and revision of the addon
252 list(LENGTH def deflength) 260 list(LENGTH def deflength)
@@ -324,9 +332,7 @@ foreach(addon ${addons})
324 endif() 332 endif()
325 333
326 # remove any previously extracted version of the addon 334 # remove any previously extracted version of the addon
327 if(EXISTS "${BUILD_DIR}/${id}") 335 file(REMOVE_RECURSE "${BUILD_DIR}/${id}")
328 file(REMOVE_RECURSE "${BUILD_DIR}/${id}")
329 endif()
330 336
331 # extract the addon from the archive 337 # extract the addon from the archive
332 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz 338 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz
@@ -365,7 +371,7 @@ foreach(addon ${addons})
365 set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) 371 set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends)
366 372
367 if(EXISTS ${${id}_DEPENDS_DIR}) 373 if(EXISTS ${${id}_DEPENDS_DIR})
368 include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) 374 include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake)
369 add_addon_depends(${id} ${${id}_DEPENDS_DIR}) 375 add_addon_depends(${id} ${${id}_DEPENDS_DIR})
370 if(${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "") 376 if(${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "")
371 message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}") 377 message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}")
@@ -401,16 +407,28 @@ foreach(addon ${addons})
401 endif() 407 endif()
402 endif() 408 endif()
403endforeach() 409endforeach()
410message(STATUS "")
404 411
405if(NEED_SUDO) 412if(NEED_SUDO)
406 add_custom_target(install 413 add_custom_target(sudo-install
407 COMMAND ${CMAKE_COMMAND} -E echo "\n\n" 414 COMMAND ${CMAKE_COMMAND} -E echo "sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n"
408 COMMAND ${CMAKE_COMMAND} -E echo "WARNING: sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n"
409 COMMAND sudo ${CMAKE_COMMAND} -E copy_directory ${ADDON_INSTALL_DIR}/ ${CMAKE_INSTALL_PREFIX}/ 415 COMMAND sudo ${CMAKE_COMMAND} -E copy_directory ${ADDON_INSTALL_DIR}/ ${CMAKE_INSTALL_PREFIX}/
410 COMMAND sudo ${CMAKE_COMMAND} -E remove_directory ${ADDON_INSTALL_DIR}/
411 COMMAND sudo -k) 416 COMMAND sudo -k)
417
418 foreach(_id ${ALL_ADDONS_BUILDING})
419 add_dependencies(sudo-install ${_id})
420 endforeach()
421 message(WARNING "sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}")
422 message(STATUS "\nplease type \"make sudo-install\"\n\n")
423endif()
424
425if(NOT SUPPORTED_ADDON_FOUND)
426 message(FATAL_ERROR "${ADDONS_TO_BUILD} did not match any of the supported addons. \
427 A list of supported addons can be viewed by building the 'supported_addons' target. \
428 Addon definitions are loaded from ADDONS_DEFINITION_DIR (${ADDONS_DEFINITION_DIR}).")
412endif() 429endif()
413 430
414# add custom target "supported_addons" that returns all addons that are supported on this platform 431# add custom target "supported_addons" that returns all addons that are supported on this platform
415string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}") 432string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}")
416add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) \ No newline at end of file 433add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM)
434add_custom_target(need-sudo COMMAND ${CMAKE_COMMAND} -E echo ${NEED_SUDO} VERBATIM)
diff --git a/project/cmake/addons/README.md b/project/cmake/addons/README.md
index c75ead7..6470ee1 100644
--- a/project/cmake/addons/README.md
+++ b/project/cmake/addons/README.md
@@ -31,16 +31,20 @@ The buildsystem uses the following variables (which can be passed into it when e
31- `ADDONS_DEFINITION_DIR` points to the directory containing the definitions for the addons to be built 31- `ADDONS_DEFINITION_DIR` points to the directory containing the definitions for the addons to be built
32- `ADDON_SRC_PREFIX` can be used to override the add-on repository location. It must point to the locally available parent directory of the add-on(s) to build. `<addon-id>` will be appended to this path automatically 32- `ADDON_SRC_PREFIX` can be used to override the add-on repository location. It must point to the locally available parent directory of the add-on(s) to build. `<addon-id>` will be appended to this path automatically
33- `CMAKE_BUILD_TYPE` specifies the type of the build. This can be either *Debug* or *Release* (default is *Release*) 33- `CMAKE_BUILD_TYPE` specifies the type of the build. This can be either *Debug* or *Release* (default is *Release*)
34- `CMAKE_INSTALL_PREFIX` points to the directory where the built add-ons and their additional files (addon.xml, resources, ...) will be installed to (defaults to `<DEPENDS_PATH>`) 34- `CMAKE_INSTALL_PREFIX` points to the directory where the built add-ons and their additional files (addon.xml, resources, ...) will be installed to (defaults to `<ADDON_DEPENDS_PATH>`)
35- `CMAKE_TOOLCHAIN_FILE` can be used to pass a toolchain file into the add-on builds 35- `CMAKE_TOOLCHAIN_FILE` can be used to pass a toolchain file into the add-on builds
36- `DEPENDS_PATH` points to the directory containing the *include* and *lib* directories of the add-ons' dependencies. 36- `ADDON_DEPENDS_PATH` points to the directory containing the *include* and *lib* directories of the add-ons' dependencies.
37- `APP_ROOT` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory) 37- `CORE_SOURCE_DIR` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory)
38- `BUILD_DIR` points to the directory where the add-ons and their dependencies will be downloaded and built 38- `BUILD_DIR` points to the directory where the add-ons and their dependencies will be downloaded and built
39- `PACKAGE_ZIP=ON` means that the add-ons will be 'packaged' into a common folder, rather than being placed in `<CMAKE_INSTALL_PREFIX>/lib/kodi/addons` and `<CMAKE_INSTALL_PREFIX>/share/kodi/addons` 39- `PACKAGE_ZIP=ON` means that the add-ons will be 'packaged' into a common folder, rather than being placed in `<CMAKE_INSTALL_PREFIX>/lib/kodi/addons` and `<CMAKE_INSTALL_PREFIX>/share/kodi/addons`
40- `PACKAGE_DIR` points to the directory where the ZIP archived add-ons will be stored after they have been packaged (defaults to `<BUILD_DIR>/zips`) 40- `PACKAGE_DIR` points to the directory where the ZIP archived add-ons will be stored after they have been packaged (defaults to `<BUILD_DIR>/zips`)
41- `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty) 41- `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty)
42- `ADDON_TARBALL_CACHING` specifies whether downloaded add-on source tarballs should be cached or not (defaults to *ON*) 42- `ADDON_TARBALL_CACHING` specifies whether downloaded add-on source tarballs should be cached or not (defaults to *ON*)
43 43
44## Deprecated buildsystem variables
45Buildsystem will print a warning if you use any of the below-listed variables. For now they still work but you should adapt your workflow to the new variables.
46- `APP_ROOT` - Use `CORE_SOURCE_DIR` instead
47
44## Building 48## Building
45The buildsystem makes some assumptions about the environment which must be met by whoever uses it: 49The buildsystem makes some assumptions about the environment which must be met by whoever uses it:
46- Any dependencies of the add-ons must already be built and their include and library files must be present in the path pointed to by `<CMAKE_PREFIX_PATH>` (in *include* and *lib* sub-directories) 50- Any dependencies of the add-ons must already be built and their include and library files must be present in the path pointed to by `<CMAKE_PREFIX_PATH>` (in *include* and *lib* sub-directories)
@@ -55,7 +59,7 @@ In case of additional options the call might look like this:
55 59
56cmake `<path>` [-G `<generator>`] \ 60cmake `<path>` [-G `<generator>`] \
57 -DCMAKE_BUILD_TYPE=Release \ 61 -DCMAKE_BUILD_TYPE=Release \
58 -DAPP_ROOT="`<path-to-app-root>`" \ 62 -DCORE_SOURCE_DIR="`<path-to-app-root>`" \
59 -DARCH_DEFINES="-DTARGET_LINUX" \ 63 -DARCH_DEFINES="-DTARGET_LINUX" \
60 -DDEPENDS_PATH=`<path-to-built-depends>` \ 64 -DADDON_DEPENDS_PATH=`<path-to-built-depends>` \
61 -DCMAKE_INSTALL_PREFIX="`<path-to-install-directory`" 65 -DCMAKE_INSTALL_PREFIX="`<path-to-install-directory`"
diff --git a/project/cmake/addons/bootstrap/bootstrap.cmake b/project/cmake/addons/bootstrap/Bootstrap.cmake
index 25e8aa2..5d20302 100644
--- a/project/cmake/addons/bootstrap/bootstrap.cmake
+++ b/project/cmake/addons/bootstrap/Bootstrap.cmake
@@ -11,7 +11,7 @@ if(NOT ADDONS_TO_BUILD)
11else() 11else()
12 string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) 12 string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD)
13 message(STATUS "Bootstrapping following addons: ${ADDONS_TO_BUILD}") 13 message(STATUS "Bootstrapping following addons: ${ADDONS_TO_BUILD}")
14 separate_arguments(ADDONS_TO_BUILD) 14 string(REPLACE " " ";" ADDONS_TO_BUILD ${ADDONS_TO_BUILD})
15endif() 15endif()
16 16
17# find all addon definitions and go through them 17# find all addon definitions and go through them
@@ -21,16 +21,15 @@ foreach(ADDON_DEFINITION_FILE ${ADDON_DEFINITIONS})
21 if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt)) 21 if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt))
22 # read the addon definition file 22 # read the addon definition file
23 file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION) 23 file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION)
24 separate_arguments(ADDON_DEFINITION) 24 string(REPLACE " " ";" ADDON_DEFINITION ${ADDON_DEFINITION})
25 25
26 # extract the addon definition's identifier 26 # extract the addon definition's identifier
27 list(GET ADDON_DEFINITION 0 ADDON_ID) 27 list(GET ADDON_DEFINITION 0 ADDON_ID)
28 28
29 # check if the addon definition should be built 29 # check if the addon definition should be built
30 list(FIND ADDONS_TO_BUILD ${ADDON_ID} ADDONS_TO_BUILD_IDX) 30 if(ADDON_ID MATCHES "^${ADDONS_TO_BUILD}" OR ADDONS_TO_BUILD STREQUAL all)
31 if(ADDONS_TO_BUILD_IDX GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all")
32 # get the path to the addon definition directory 31 # get the path to the addon definition directory
33 get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} PATH) 32 get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} DIRECTORY)
34 33
35 # install the addon definition 34 # install the addon definition
36 message(STATUS "Bootstrapping ${ADDON_ID} addon...") 35 message(STATUS "Bootstrapping ${ADDON_ID} addon...")
diff --git a/project/cmake/addons/bootstrap/CMakeLists.txt b/project/cmake/addons/bootstrap/CMakeLists.txt
index 86950b8..c20b97e 100644
--- a/project/cmake/addons/bootstrap/CMakeLists.txt
+++ b/project/cmake/addons/bootstrap/CMakeLists.txt
@@ -1,7 +1,6 @@
1cmake_minimum_required(VERSION 3.1)
1project(kodi-addons-bootstrap) 2project(kodi-addons-bootstrap)
2 3
3cmake_minimum_required(VERSION 2.8)
4
5list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) 4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
6 5
7# make sure CMAKE_INSTALL_PREFIX is properly set 6# make sure CMAKE_INSTALL_PREFIX is properly set
@@ -52,7 +51,7 @@ function(bootstrap_repo repo_id repo_url repo_revision)
52 -DPROJECT_SOURCE_DIR=<SOURCE_DIR> 51 -DPROJECT_SOURCE_DIR=<SOURCE_DIR>
53 -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} 52 -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
54 -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} 53 -DADDONS_TO_BUILD=${ADDONS_TO_BUILD}
55 -P ${PROJECT_SOURCE_DIR}/bootstrap.cmake 54 -P ${PROJECT_SOURCE_DIR}/Bootstrap.cmake
56 ) 55 )
57endfunction() 56endfunction()
58 57
@@ -61,7 +60,7 @@ set(REPOSITORY_TO_BUILD_FOUND OFF)
61file(GLOB repos repositories/*.txt) 60file(GLOB repos repositories/*.txt)
62foreach(repo ${repos}) 61foreach(repo ${repos})
63 file(STRINGS ${repo} repo_definition) 62 file(STRINGS ${repo} repo_definition)
64 separate_arguments(repo_definition) 63 string(REPLACE " " ";" repo_definition ${repo_definition})
65 list(GET repo_definition 0 repo_id) 64 list(GET repo_definition 0 repo_id)
66 65
67 list(FIND REPOSITORY_TO_BUILD ${repo_id} idx) 66 list(FIND REPOSITORY_TO_BUILD ${repo_id} idx)
diff --git a/project/cmake/addons/depends/CMakeLists.txt b/project/cmake/addons/depends/CMakeLists.txt
index 760acf4..622701d 100644
--- a/project/cmake/addons/depends/CMakeLists.txt
+++ b/project/cmake/addons/depends/CMakeLists.txt
@@ -1,7 +1,6 @@
1cmake_minimum_required(VERSION 3.1)
1project(kodi-addons-depends) 2project(kodi-addons-depends)
2 3
3cmake_minimum_required(VERSION 2.8)
4
5list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) 4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
6 5
7if(NOT CMAKE_BUILD_TYPE) 6if(NOT CMAKE_BUILD_TYPE)
@@ -14,13 +13,13 @@ endif()
14 13
15include(ExternalProject) 14include(ExternalProject)
16 15
17if(NOT DEPENDS_PATH) 16if(NOT ADDON_DEPENDS_PATH)
18 set(DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) 17 set(ADDON_DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends)
19else() 18else()
20 file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) 19 file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
21endif() 20endif()
22get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) 21get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
23list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_PATH}) 22list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH})
24 23
25if(NOT BUILD_DIR) 24if(NOT BUILD_DIR)
26 set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") 25 set(BUILD_DIR "${CMAKE_BINARY_DIR}/build")
@@ -30,7 +29,7 @@ endif()
30get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) 29get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE)
31 30
32## use add_addon_depends to handle the cmake based dependencies 31## use add_addon_depends to handle the cmake based dependencies
33include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) 32include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake)
34add_addon_depends(depends "${PROJECT_SOURCE_DIR}") 33add_addon_depends(depends "${PROJECT_SOURCE_DIR}")
35 34
36## if there's a platform-specific sub-directory containing a CMakeLists.txt, add it to the build as well 35## if there's a platform-specific sub-directory containing a CMakeLists.txt, add it to the build as well
diff --git a/project/cmake/addons/depends/README b/project/cmake/addons/depends/README
index 66e924a..584a167 100644
--- a/project/cmake/addons/depends/README
+++ b/project/cmake/addons/depends/README
@@ -34,9 +34,9 @@ specific paths:
34 builds. 34 builds.
35 * CORE_SYSTEM_NAME is the name of the platform (e.g. "linux" or "android") in 35 * CORE_SYSTEM_NAME is the name of the platform (e.g. "linux" or "android") in
36 lower-case (defaults to lowercase(CMAKE_SYSTEM_NAME)). 36 lower-case (defaults to lowercase(CMAKE_SYSTEM_NAME)).
37 * APP_ROOT points to the root directory of the project (default is the 37 * CORE_SOURCE_DIR points to the root directory of the project (default is the
38 absolute representation of ../../.. starting from this directory). 38 absolute representation of ../../.. starting from this directory).
39 * DEPENDS_PATH points to the directory where the built dependencies 39 * ADDON_DEPENDS_PATH points to the directory where the built dependencies
40 (their include and library file) will be installed to. 40 (their include and library file) will be installed to.
41 * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines 41 * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines
42 (defaults to empty). 42 (defaults to empty).
@@ -56,6 +56,6 @@ In case of additional options the call might look like this
56 56
57 cmake <path> [-G <generator>] \ 57 cmake <path> [-G <generator>] \
58 -DCMAKE_BUILD_TYPE=Release \ 58 -DCMAKE_BUILD_TYPE=Release \
59 -DAPP_ROOT="<path-to-project-root>" \ 59 -DCORE_SOURCE_DIR="<path-to-project-root>" \
60 -DARCH_DEFINES="-DTARGET_LINUX" \ 60 -DARCH_DEFINES="-DTARGET_LINUX" \
61 -DCMAKE_INSTALL_PREFIX="<path-to-install-directory" 61 -DCMAKE_INSTALL_PREFIX="<path-to-install-directory"
diff --git a/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
index de42267..46ef93c 100644
--- a/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
+++ b/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
@@ -1 +1 @@
kodi-platform https://github.com/xbmc/kodi-platform fed924e764b4c9c722f7f5d825ce70d4b61ae54f kodi-platform https://github.com/xbmc/kodi-platform c8188d82678fec6b784597db69a68e74ff4986b5
diff --git a/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt b/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
index 5468bfb..ec396ee 100644
--- a/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
+++ b/project/cmake/addons/depends/common/tinyxml/CMakeLists.txt
@@ -1,7 +1,6 @@
1cmake_minimum_required(VERSION 3.1)
1project(tinyxml) 2project(tinyxml)
2 3
3cmake_minimum_required(VERSION 2.8)
4
5set(SOURCES src/tinystr.cpp 4set(SOURCES src/tinystr.cpp
6 src/tinyxml.cpp 5 src/tinyxml.cpp
7 src/tinyxmlerror.cpp 6 src/tinyxmlerror.cpp
diff --git a/project/cmake/addons/depends/windows/CMakeLists.txt b/project/cmake/addons/depends/windows/CMakeLists.txt
index 4480f1e..c8739c0 100644
--- a/project/cmake/addons/depends/windows/CMakeLists.txt
+++ b/project/cmake/addons/depends/windows/CMakeLists.txt
@@ -1,7 +1,6 @@
1cmake_minimum_required(VERSION 3.1)
1project(kodi-addons-depends-windows) 2project(kodi-addons-depends-windows)
2 3
3cmake_minimum_required(VERSION 2.8)
4
5list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) 4list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
6 5
7if(NOT CMAKE_BUILD_TYPE) 6if(NOT CMAKE_BUILD_TYPE)
@@ -10,13 +9,13 @@ endif()
10 9
11include(ExternalProject) 10include(ExternalProject)
12 11
13if(NOT DEPENDS_PATH) 12if(NOT ADDON_DEPENDS_PATH)
14 message(FATAL_ERROR "DEPENDS_PATH (${DEPENDS_PATH}) is not a valid target directory.") 13 message(FATAL_ERROR "ADDON_DEPENDS_PATH (${ADDON_DEPENDS_PATH}) is not a valid target directory.")
15else() 14else()
16 file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) 15 file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH)
17endif() 16endif()
18get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) 17get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE)
19list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_PATH}) 18list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH})
20 19
21if(NOT DEPENDS_TO_BUILD) 20if(NOT DEPENDS_TO_BUILD)
22 set(DEPENDS_TO_BUILD "all") 21 set(DEPENDS_TO_BUILD "all")
@@ -31,19 +30,17 @@ function(add_internal id url inputfile)
31 INSTALL_COMMAND ${CMAKE_COMMAND} 30 INSTALL_COMMAND ${CMAKE_COMMAND}
32 -DINPUTDIR=${PROJECT_BINARY_DIR}/build/${id}/src/${id} 31 -DINPUTDIR=${PROJECT_BINARY_DIR}/build/${id}/src/${id}
33 -DINPUTFILE=${inputfile} 32 -DINPUTFILE=${inputfile}
34 -DDESTDIR=${DEPENDS_PATH} 33 -DDESTDIR=${ADDON_DEPENDS_PATH}
35 -P ${PROJECT_SOURCE_DIR}/install.cmake 34 -P ${PROJECT_SOURCE_DIR}/Install.cmake
36 ) 35 )
37endfunction() 36endfunction()
38 37
39#find_package(7Zip REQUIRED)
40
41file(GLOB_RECURSE download_input_files prebuilt/*.txt) 38file(GLOB_RECURSE download_input_files prebuilt/*.txt)
42foreach(file ${download_input_files}) 39foreach(file ${download_input_files})
43 if(NOT file MATCHES install.txt) 40 if(NOT file MATCHES install.txt)
44 file(STRINGS ${file} def) 41 file(STRINGS ${file} def)
45 get_filename_component(dir ${file} PATH) 42 get_filename_component(dir ${file} DIRECTORY)
46 separate_arguments(def) 43 string(REPLACE " " ";" def ${def})
47 list(GET def 0 id) 44 list(GET def 0 id)
48 45
49 list(FIND DEPENDS_TO_BUILD ${id} idx) 46 list(FIND DEPENDS_TO_BUILD ${id} idx)
diff --git a/project/cmake/addons/depends/windows/Find7Zip.cmake b/project/cmake/addons/depends/windows/Find7Zip.cmake
deleted file mode 100644
index 82b0902..0000000
--- a/project/cmake/addons/depends/windows/Find7Zip.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
1find_program(7ZIP_EXECUTABLE NAMES 7z.exe
2 HINTS PATHS "c:/Program Files/7-Zip")
3
4include(FindPackageHandleStandardArgs)
5find_package_handle_standard_args(7Zip DEFAULT_MSG 7ZIP_EXECUTABLE)
6
7mark_as_advanced(7ZIP_EXECUTABLE)
diff --git a/project/cmake/addons/depends/windows/install.cmake b/project/cmake/addons/depends/windows/Install.cmake
index 9a3adbb..9a3adbb 100644
--- a/project/cmake/addons/depends/windows/install.cmake
+++ b/project/cmake/addons/depends/windows/Install.cmake
diff --git a/project/cmake/addons/depends/windows/extract-7z.cmake b/project/cmake/addons/depends/windows/extract-7z.cmake
deleted file mode 100644
index 95a2672..0000000
--- a/project/cmake/addons/depends/windows/extract-7z.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
1get_filename_component(file ${URL} NAME)
2file(DOWNLOAD ${URL} ${DEST}/${file})
3execute_process(COMMAND ${7ZIP_EXECUTABLE} -y x ${DEST}/${file}
4 WORKING_DIRECTORY ${DESTDIR})
5if(${file} MATCHES .tar)
6 string(REPLACE ".7z" "" tarball ${file})
7 string(REPLACE ".lzma" "" tarball ${file})
8 execute_process(COMMAND ${7ZIP_EXECUTABLE} -y x ${DESTDIR}/${tarball}
9 WORKING_DIRECTORY ${DESTDIR})
10endif()
diff --git a/project/cmake/addons/depends/windows/extract-direct.cmake b/project/cmake/addons/depends/windows/extract-direct.cmake
deleted file mode 100644
index 13cb74f..0000000
--- a/project/cmake/addons/depends/windows/extract-direct.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
1get_filename_component(file ${URL} NAME)
2file(DOWNLOAD ${URL} ${DEST}/${file})
diff --git a/project/cmake/cpack/CPackConfigDEB.cmake b/project/cmake/cpack/CPackConfigDEB.cmake
new file mode 100644
index 0000000..cb8e59e
--- /dev/null
+++ b/project/cmake/cpack/CPackConfigDEB.cmake
@@ -0,0 +1,352 @@
1# include Macros.cmake to automate generation of time/date stamps, maintainer, etc.
2include(${PROJECT_SOURCE_DIR}/scripts/common/Macros.cmake)
3
4# find stuff we need
5find_program(LSB_RELEASE_CMD lsb_release)
6find_program(DPKG_CMD dpkg)
7find_package(Git)
8find_program(GZIP_CMD gzip)
9
10# set packaging dir
11if(NOT CPACK_PACKAGE_DIRECTORY)
12 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/packages)
13endif()
14
15# force CPack generated DEBs to use the same path as CMAKE_INSTALL_PREFIX
16set(CPACK_SET_DESTDIR true)
17
18# set architecture
19if(NOT CPACK_SYSTEM_NAME)
20 set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_PROCESSOR})
21 # sanity check
22 if(CPACK_SYSTEM_NAME STREQUAL x86_64)
23 set(CPACK_SYSTEM_NAME amd64)
24 endif()
25endif()
26
27# set packaging by components
28set(CPACK_DEB_COMPONENT_INSTALL ON)
29
30# enforce Debian policy permission rules
31set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION ON)
32
33# packaging by components doesn't fully work with CMake/CPack <3.6.0
34# CPACK_DEBIAN_<COMPONENT>_FILE_NAME is a 3.6.0 addition
35# warn if detected version is lower
36if(CMAKE_VERSION VERSION_LESS 3.6)
37 message(WARNING "DEB Generator: CMake/CPack 3.6 or higher is needed to produce correctly named packages.")
38endif()
39
40# distro codename
41if(NOT DISTRO_CODENAME)
42 if(NOT LSB_RELEASE_CMD)
43 message(WARNING "DEB Generator: Can't find lsb_release in your path. Setting DISTRO_CODENAME to unknown.")
44 set(DISTRO_CODENAME unknown)
45 else()
46 execute_process(COMMAND ${LSB_RELEASE_CMD} -cs
47 OUTPUT_VARIABLE DISTRO_CODENAME
48 OUTPUT_STRIP_TRAILING_WHITESPACE)
49 endif()
50endif()
51
52# package version
53if(DEBIAN_PACKAGE_VERSION)
54 set(DISTRO_CODENAME ${DEBIAN_PACKAGE_VERSION}${DISTRO_CODENAME})
55else()
56 set(DISTRO_CODENAME 0${DISTRO_CODENAME})
57endif()
58
59# package revision
60if(DEBIAN_PACKAGE_REVISION)
61 set(DISTRO_CODENAME ${DISTRO_CODENAME}${DEBIAN_PACKAGE_REVISION})
62endif()
63
64# package type
65if(DEBIAN_PACKAGE_TYPE STREQUAL stable)
66 set(RELEASE_IDENTIFIER final)
67elseif(DEBIAN_PACKAGE_TYPE STREQUAL unstable)
68 set(RELEASE_IDENTIFIER ${APP_VERSION_TAG_LC})
69else()
70 core_find_git_rev(RELEASE_IDENTIFIER)
71endif()
72
73# package name
74string(TIMESTAMP PACKAGE_TIMESTAMP "%Y%m%d.%H%M" UTC)
75set(PACKAGE_NAME_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${RELEASE_IDENTIFIER}-${DISTRO_CODENAME})
76unset(RELEASE_IDENTIFIER)
77
78# package version
79if(DEBIAN_PACKAGE_EPOCH)
80 set(CPACK_DEBIAN_PACKAGE_VERSION ${DEBIAN_PACKAGE_EPOCH}:${PACKAGE_NAME_VERSION})
81else()
82 set(CPACK_DEBIAN_PACKAGE_VERSION 2:${PACKAGE_NAME_VERSION})
83endif()
84
85# architecture
86if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
87 if(NOT DPKG_CMD)
88 message(WARNING "DEB Generator: Can't find dpkg in your path. Setting CPACK_DEBIAN_PACKAGE_ARCHITECTURE to i386.")
89 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
90 endif()
91 execute_process(COMMAND "${DPKG_CMD}" --print-architecture
92 OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
93 OUTPUT_STRIP_TRAILING_WHITESPACE)
94endif()
95
96# package maintainer
97if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
98 userstamp()
99 set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER})
100 unset(PACKAGE_MAINTAINER)
101endif()
102
103# package description common to all packages
104if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
105 file(STRINGS ${PROJECT_SOURCE_DIR}/cpack/deb/package-description.txt DESC_LINES)
106 foreach(LINE IN LISTS DESC_LINES)
107 set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION} ${LINE}\n")
108 endforeach()
109endif()
110
111# package homepage
112if(NOT CPACK_DEBIAN_PACKAGE_HOMEPAGE)
113 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${APP_WEBSITE})
114endif()
115
116# generate a Debian compliant changelog
117set(CHANGELOG_HEADER "${APP_NAME_LC} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRO_CODENAME}\; urgency=high")
118rfc2822stamp()
119# two spaces between maintainer and timestamp is NOT a mistake
120set(CHANGELOG_FOOTER " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${RFC2822_TIMESTAMP}")
121
122if(GIT_FOUND AND GZIP_CMD AND EXISTS ${CORE_SOURCE_DIR}/.git)
123 execute_process(COMMAND ${GIT_EXECUTABLE} log --no-merges --pretty=format:"%n [%an]%n * %s" --since="last month"
124 OUTPUT_VARIABLE CHANGELOG
125 WORKING_DIRECTORY ${CORE_SOURCE_DIR}
126 OUTPUT_STRIP_TRAILING_WHITESPACE)
127 string(REPLACE "\"" "" CHANGELOG ${CHANGELOG})
128 file(WRITE ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian ${CHANGELOG_HEADER}\n${CHANGELOG}\n\n${CHANGELOG_FOOTER})
129 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian)
130 unset(CHANGELOG_HEADER)
131 unset(CHANGELOG_FOOTER)
132 unset(RFC2822_TIMESTAMP)
133else()
134 message(WARNING "DEB Generator: Can't find git and/or gzip in your path. DEB packages will be missing changelog.Debian.gz.")
135endif()
136
137# Generate NEWS.Debian
138configure_file(${PROJECT_SOURCE_DIR}/cpack/deb/NEWS.Debian
139 ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian @ONLY)
140if(GZIP_CMD)
141 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian)
142else()
143 message(WARNING "DEB Generator: Can't find gzip in your path. DEB packages will be missing NEWS.Debian.")
144endif()
145
146# Generate man pages
147configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1
148 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1 COPYONLY)
149configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1
150 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1 COPYONLY)
151configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-standalone.1
152 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1 COPYONLY)
153if(ENABLE_EVENTCLIENTS)
154 configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-ps3remote.1
155 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1 COPYONLY)
156 configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-send.1
157 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1 COPYONLY)
158 configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-wiiremote.1
159 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1 COPYONLY)
160endif()
161
162if(GZIP_CMD)
163 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1)
164 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1)
165 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1)
166 if(ENABLE_EVENTCLIENTS)
167 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1)
168 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1)
169 execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1)
170 endif()
171else()
172 message(WARNING "DEB Generator: Can't find gzip in your path. Several DEB packages will be missing man pages.")
173endif()
174
175install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1.gz
176 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1.gz
177 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1.gz
178 DESTINATION share/man/man1
179 COMPONENT kodi)
180if(ENABLE_EVENTCLIENTS)
181install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1.gz
182 DESTINATION share/man/man1
183 COMPONENT kodi-eventclients-ps3)
184install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1.gz
185 DESTINATION share/man/man1
186 COMPONENT kodi-eventclients-xbmc-send)
187install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1.gz
188 DESTINATION share/man/man1
189 COMPONENT kodi-eventclients-wiiremote)
190endif()
191
192# configure package metadata files
193file(GLOB DEBIAN_PACKAGE_FILES ${PROJECT_SOURCE_DIR}/cpack/deb/packages/*.txt.in)
194foreach(file ${DEBIAN_PACKAGE_FILES})
195 get_filename_component(package ${file} NAME_WE)
196 # filter eventclients so we don't have to support two more deps
197 # (libbluetooth-dev and libcwiid-dev) just because of wii-remote
198 string(SUBSTRING ${package} 0 17 PACKAGE_FILTER)
199 if(NOT ENABLE_EVENTCLIENTS AND PACKAGE_FILTER STREQUAL kodi-eventclients)
200 message(STATUS "DEB Generator: ${package} matches ${PACKAGE_FILTER}, skipping.")
201 # do nothing
202 else()
203 configure_file(${file}
204 ${CPACK_PACKAGE_DIRECTORY}/deb/${package}.txt @ONLY)
205 list(APPEND DEBIAN_PACKAGES ${package})
206 endif()
207endforeach()
208unset(DEBIAN_PACKAGE_FILES)
209
210# generate packages
211include(CMakeParseArguments)
212foreach(file ${DEBIAN_PACKAGES})
213 core_file_read_filtered(DEBIAN_METADATA ${CPACK_PACKAGE_DIRECTORY}/deb/${file}.txt)
214 string(REPLACE " " ";" DEBIAN_METADATA "${DEBIAN_METADATA}")
215 cmake_parse_arguments(DEB
216 ""
217 "PACKAGE_NAME;PACKAGE_ARCHITECTURE;PACKAGE_SECTION;PACKAGE_PRIORITY;PACKAGE_SHLIBDEPS"
218 "PACKAGE_DEPENDS;PACKAGE_RECOMMENDS;PACKAGE_SUGGESTS;PACKAGE_BREAKS;PACKAGE_REPLACES;PACKAGE_PROVIDES;PACKAGE_DESCRIPTION_HEADER;PACKAGE_DESCRIPTION_FOOTER"
219 ${DEBIAN_METADATA})
220 string(REPLACE ";" " " DEB_PACKAGE_DEPENDS "${DEB_PACKAGE_DEPENDS}")
221 string(REPLACE ";" " " DEB_PACKAGE_RECOMMENDS "${DEB_PACKAGE_RECOMMENDS}")
222 string(REPLACE ";" " " DEB_PACKAGE_SUGGESTS "${DEB_PACKAGE_SUGGESTS}")
223 string(REPLACE ";" " " DEB_PACKAGE_BREAKS "${DEB_PACKAGE_BREAKS}")
224 string(REPLACE ";" " " DEB_PACKAGE_REPLACES "${DEB_PACKAGE_REPLACES}")
225 string(REPLACE ";" " " DEB_PACKAGE_PROVIDES "${DEB_PACKAGE_PROVIDES}")
226 string(REPLACE ";" " " DEB_PACKAGE_DESCRIPTION_HEADER "${DEB_PACKAGE_DESCRIPTION_HEADER}")
227 string(REPLACE ";" " " DEB_PACKAGE_DESCRIPTION_FOOTER "${DEB_PACKAGE_DESCRIPTION_FOOTER}")
228
229 string(TOUPPER ${file} COMPONENT)
230
231 if(NOT DEB_PACKAGE_ARCHITECTURE)
232 message(STATUS "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE is empty. Setting to ${CPACK_SYSTEM_NAME}.")
233 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE ${CPACK_SYSTEM_NAME})
234 else()
235 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE ${DEB_PACKAGE_ARCHITECTURE})
236 endif()
237
238 if(DEB_PACKAGE_NAME)
239 if(DEB_PACKAGE_ARCHITECTURE)
240 set(CPACK_DEBIAN_${COMPONENT}_FILE_NAME ${DEB_PACKAGE_NAME}_${PACKAGE_NAME_VERSION}_${DEB_PACKAGE_ARCHITECTURE}.deb)
241 else()
242 set(CPACK_DEBIAN_${COMPONENT}_FILE_NAME ${DEB_PACKAGE_NAME}_${PACKAGE_NAME_VERSION}_${CPACK_SYSTEM_NAME}.deb)
243 endif()
244 else()
245 message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_FILE_NAME is not set.")
246 endif()
247
248 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SOURCE ${APP_NAME_LC})
249
250 if(DEB_PACKAGE_NAME)
251 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_NAME ${DEB_PACKAGE_NAME})
252 else()
253 message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_NAME is not set.")
254 endif()
255
256 if(DEB_PACKAGE_SECTION)
257 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SECTION ${DEB_PACKAGE_SECTION})
258 else()
259 message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_SECTION is not set.")
260 endif()
261
262 if(DEB_PACKAGE_PRIORITY)
263 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_PRIORITY ${DEB_PACKAGE_PRIORITY})
264 else()
265 message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_PRIORITY is not set.")
266 endif()
267
268 if(DEB_PACKAGE_SHLIBDEPS)
269 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SHLIBDEPS ON)
270 else()
271 if(DEB_PACKAGE_DEPENDS)
272 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_DEPENDS "${DEB_PACKAGE_DEPENDS}")
273 endif()
274 endif()
275
276 if(DEB_PACKAGE_RECOMMENDS)
277 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_RECOMMENDS "${DEB_PACKAGE_RECOMMENDS}")
278 endif()
279
280 if(DEB_PACKAGE_SUGGESTS)
281 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SUGGESTS "${DEB_PACKAGE_SUGGESTS}")
282 endif()
283
284 if(DEB_PACKAGE_BREAKS)
285 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_BREAKS "${DEB_PACKAGE_BREAKS}")
286 endif()
287
288 if(DEB_PACKAGE_REPLACES)
289 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_REPLACES "${DEB_PACKAGE_REPLACES}")
290 endif()
291
292 if(DEB_PACKAGE_PROVIDES)
293 set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_PROVIDES "${DEB_PACKAGE_PROVIDES}")
294 endif()
295
296 if(NOT DEB_PACKAGE_DESCRIPTION_HEADER OR NOT DEB_PACKAGE_DESCRIPTION_FOOTER)
297 message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_COMPONENT_${COMPONENT}_DESCRIPTION is not set.")
298 else()
299 set(CPACK_COMPONENT_${COMPONENT}_DESCRIPTION "\
300${DEB_PACKAGE_DESCRIPTION_HEADER}\n\
301${CPACK_DEBIAN_PACKAGE_DESCRIPTION} \
302${DEB_PACKAGE_DESCRIPTION_FOOTER}")
303 endif()
304
305 install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian.gz
306 ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian.gz
307 ${PROJECT_SOURCE_DIR}/cpack/deb/copyright
308 DESTINATION share/doc/${file}
309 COMPONENT ${file})
310
311 # kodi package exclusive files
312 if(CPACK_DEBIAN_KODI_PACKAGE_NAME)
313 set(CPACK_DEBIAN_KODI_PACKAGE_CONTROL_EXTRA
314 "${PROJECT_SOURCE_DIR}/cpack/deb/postinst;${PROJECT_SOURCE_DIR}/cpack/deb/postrm")
315 install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/lintian/overrides/kodi
316 DESTINATION share/lintian/overrides
317 COMPONENT kodi)
318 install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/menu/kodi
319 DESTINATION share/menu
320 COMPONENT kodi)
321 endif()
322endforeach()
323unset(DEBIAN_PACKAGES)
324
325### source package generation specific variables
326# source generator
327set(CPACK_SOURCE_GENERATOR TGZ)
328
329# source package name
330set(CPACK_SOURCE_PACKAGE_FILE_NAME ${APP_NAME_LC}_${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${GIT_HASH}.orig)
331
332# source dir
333set(CMAKE_SOURCE_DIR ${CORE_SOURCE_DIR})
334
335# ignore files for source package
336set(CPACK_SOURCE_IGNORE_FILES
337 "/build/"
338 "/debian/"
339 "/.git/"
340 ".gitignore"
341 "yml$"
342 "~$")
343
344# unset variables
345unset(PACKAGE_TIMESTAMP)
346unset(DISTRO_CODENAME)
347
348# reference docs
349# https://cmake.org/cmake/help/latest/module/CPack.html
350# https://cmake.org/cmake/help/latest/module/CPackDeb.html
351# https://cmake.org/cmake/help/latest/module/CPackComponent.html
352include(CPack)
diff --git a/project/cmake/cpack/deb/NEWS.Debian b/project/cmake/cpack/deb/NEWS.Debian
new file mode 100644
index 0000000..034774b
--- /dev/null
+++ b/project/cmake/cpack/deb/NEWS.Debian
@@ -0,0 +1,24 @@
1@CPACK_PACKAGE_NAME@ (@CPACK_DEBIAN_PACKAGE_VERSION@) @DISTRO_CODENAME@; urgency=high
2 * Kodi Krypton (v17.0) will have an awesome new default skin, Estuary.
3 However the vast improvements are deep in the bowels of Kodi core code.
4 .
5 Since the beginning of XBMC back in the days while it was running on
6 the XBOX there was something like DVDPlayer. As the name probably
7 implies it was used to playback DVD discs/files. During the years this
8 DVDPlayer was improved and patched up to stay within modern day
9 standards of video playback expectancy. However it became clear that
10 for the future a major overhaul and rewrite was needed to keep up and
11 be future proof. As such the developers who did the AudioEngine in v12
12 picked up this job and have now transformed it into VideoPlayer.
13 .
14 Together with some platform developers they ripped out the old
15 DVDPlayer code, chopped it into pieces, put it in the blender, picked
16 the needed pieces and put it back in without breaking the rest of Kodi.
17 This certainly wasn’t an easy job as DVDPlayer was like the bottom
18 block of a Jenga tower that needed to be replaced while still being
19 entangled throughout the whole tower. It had it’s tentacles in parts
20 of the code where it shouldn’t have been in the first place. Over a
21 year ago work started on getting this untangled and made ready to
22 be replaced by the new implementation, VideoPlayer.
23
24 -- h.udo <hudokkow@gmail.com> Tue, 05 Jul 2016 13:34:11 +0000
diff --git a/project/cmake/cpack/deb/copyright b/project/cmake/cpack/deb/copyright
new file mode 100644
index 0000000..5616264
--- /dev/null
+++ b/project/cmake/cpack/deb/copyright
@@ -0,0 +1,3244 @@
1Kodi is downloaded from http://kodi.tv/.
2Orig tarballs are generated from the script located at
3https://github.com/Kodi/Kodi/tree/master/project/cmake. The
4orig tarball is generated using the sources in https://github.com/Kodi/Kodi.
5
6Main Contact: "Team-Kodi" <team at kodi dot tv>
7
8Upstream Authors:
9
10 Andreas Setterlind [Gamester17]
11 Staffan Lindberg [pike]
12 Arne Morten Kvarving [cptspiff]
13 Anoop Menon [d4rk]
14 Joakim Plate [elupus]
15 Jonathan Marshall [jmarshall]
16 Tobias Arrskog [Topfs2]
17 Roee Vulkan [vulkanr]
18 Winfried Soltys [WiSo]
19 Yuval Tal [yuvalt]
20 John W Vanderbeck [agathorn]
21 Trent Nelson [AlTheKiller]
22 Andres Mejia [ceros]
23 Gunnar Norin [blittan]
24 Dean Ross Parry [C-Quel]
25 Sylvain Rebaud [c0diq]
26 Martin van Beurden [chadoe]
27 Scott Davilla [davilla]
28 Stephan Diederich [MaestroDD]
29 Benjamin Bertrand [Beenje]
30 Benjamin Dickgiesser [DonJ]
31 [GeminiServer]
32 Christian Granqvist [Granqvist]
33 Dave [kraqh3d]
34 Luigi Capriotti [l.capriotti]
35 Sean [malloc]
36 Kyle Hill [monkeyman]
37 [MrC]
38 [nad]
39 [nuka1195]
40 Vincent Blackwell-Price [Voinage]
41 Robert Parris [rwparris2]
42 Sigurdur H. Olafsson [sho]
43 Alasdair Campbell [Alcoheca]
44 Georgy Yunaev [oldnemesis]
45 Chris [phi2039]
46 Bob [bobo1on1]
47 David Allonby [motd2k]
48 Robert Rudd [Rudd]
49 Eric G [Tslayer]
50 Amund Scharning [tut-ankh-amon]
51 Matthias Kortstiege [VDRfan]
52 Daniel Mehrwald [AreaScout]
53 Oumar Aziz Outtara [wattazoum]
54 Chris Haley [CHI3f]
55 [Jezz_X]
56 [Smokehead]
57 Darren [Bizzeh]
58 Marc [Bobbin007]
59 Richard [Butcher]
60 Jan-Willem [Darkie]
61 Chris Branson [forza]
62 [Kreet]
63 [Ysbox]
64 Erwin Beckers [Frodo]
65 Albert Griscti-Soler [RUNTiME]
66 Phil Burr [d7o3g4q] (a.k.a. Duo Egaq)
67 Mathias Mahling [chokemaniac]
68
69Credits:
70
71Kodi - Cross-platform Media Center
72<http://Kodi.org/>
73
74 Copyright © 2005-2016 Team Kodi http://kodi.tv
75
76 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU General Public License as published by
78 the Free Software Foundation; either version 2 of the License, or
79 (at your option) any later version.
80
81 This program is distributed in the hope that it will be useful,
82 but WITHOUT ANY WARRANTY; without even the implied warranty of
83 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84 GNU General Public License for more details.
85
86 You should have received a copy of the GNU General Public License
87 along with this program. If not, see <http://www.gnu.org/licenses/>.
88
89Generic classes for raster images
90
91 Copyright © 2000, Juan Soulie <jsoulie@cplusplus.com>
92
93 Permission to use, copy, modify, distribute and sell this software or any
94 part thereof and/or its documentation for any purpose is granted without fee
95 provided that the above copyright notice and this permission notice appear
96 in all copies.
97
98 This software is provided "as is" without express or implied warranty of
99 any kind. The author shall have no liability with respect to the
100 infringement of copyrights or patents that any modification to the content
101 of this file or this file itself may incur.
102
103The FreeType Project
104<http://www.freetype.org/>
105
106 Copyright © 1996-2006, by David Turner, Robert Wilhelm, and Werner Lemberg
107
108 This file is part of the FreeType project, and may only be used,
109 modified, and distributed under the terms of the FreeType project
110 license, LICENSE.TXT. By continuing to use, modify, or distribute
111 this file you indicate that you have read the license and
112 understand and accept it fully.
113
114 A full copy of the FreeType License (FTL) is provided under section
115 "Licenses".
116
117TinyXML - simple, small, C++ XML Parser
118<http://www.grinninglizard.com/tinyxml/>
119
120 Copyright © 2000-2006 Lee Thomason (www.grinninglizard.com)
121 Copyright © 2005 Tyge Lovset
122
123 This software is provided 'as-is', without any express or implied
124 warranty. In no event will the authors be held liable for any damages
125 arising from the use of this software.
126
127 Permission is granted to anyone to use this software for any purpose,
128 including commercial applications, and to alter it and redistribute it
129 freely, subject to the following restrictions:
130
131 1. The origin of this software must not be misrepresented; you must not
132 claim that you wrote the original software. If you use this software
133 in a product, an acknowledgment in the product documentation would be
134 appreciated but is not required.
135 2. Altered source versions must be plainly marked as such, and must not be
136 misrepresented as being the original software.
137 3. This notice may not be removed or altered from any source distribution.
138
139CString Class in guilib/StdString.h
140
141 Copyright © 2002 Joseph M. O'Leary
142
143 This code is 100% free. Use it anywhere you want. Rewrite it, restructure
144 it, whatever. If you can write software that makes money off of it, good for
145 you. I kinda like capitalism. Please don't blame me if it causes your $30
146 billion dollar satellite explode in orbit. If you redistribute it in any
147 form, I'd appreciate it if you would leave this notice here.
148
149Mach-O library symbol mapping Ruby Scripts
150
151 Copyright © 2008 Elan Feingold (elan at bluemandrill dot com)
152
153 This program is free software; you can redistribute it and/or modify
154 it under the terms of the GNU General Public License as published by
155 the Free Software Foundation; either version 2 of the License, or
156 (at your option) any later version.
157
158 This program is distributed in the hope that it will be useful,
159 but WITHOUT ANY WARRANTY; without even the implied warranty of
160 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
161 GNU General Public License for more details.
162
163 You should have received a copy of the GNU General Public License
164 along with this program. If not, see <http://www.gnu.org/licenses/>.
165
166Wiimote C Library
167<http://www.wiiuse.net/>
168
169 Copyright © Michael Laforest < para >
170 < thepara (--AT--) g m a i l [--DOT--] com >
171
172 This program is free software: you can redistribute it and/or modify
173 it under the terms of the GNU General Public License as published by
174 the Free Software Foundation, either version 3 of the License, or
175 (at your option) any later version.
176
177 This program is distributed in the hope that it will be useful,
178 but WITHOUT ANY WARRANTY; without even the implied warranty of
179 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 GNU General Public License for more details.
181
182 You should have received a copy of the GNU General Public License
183 along with this program. If not, see <http://www.gnu.org/licenses/>.
184
185Wiiuse Class for Kodi
186
187 Copyright © 2009 by Cory Fields
188
189 This program is free software: you can redistribute it and/or modify
190 it under the terms of the GNU General Public License as published by
191 the Free Software Foundation, either version 3 of the License, or
192 (at your option) any later version.
193
194 This program is distributed in the hope that it will be useful,
195 but WITHOUT ANY WARRANTY; without even the implied warranty of
196 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
197 GNU General Public License for more details.
198
199 You should have received a copy of the GNU General Public License
200 along with this program. If not, see <http://www.gnu.org/licenses/>.
201
202Apple Remote Control Wrapper Classes
203
204 Copyright © 2006 Martin Kahr martinkahr.com. All rights reserved.
205
206 Permission is hereby granted, free of charge, to any person obtaining a
207 copy of this software and associated documentation files (the "Software"),
208 to deal in the Software without restriction, including without limitation
209 the rights to use, copy, modify, merge, publish, distribute, sublicense,
210 and/or sell copies of the Software, and to permit persons to whom the
211 Software is furnished to do so, subject to the following conditions:
212
213 The above copyright notice and this permission notice shall be included
214 in all copies or substantial portions of the Software.
215
216 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
217 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
218 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
219 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
220 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
221 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
222 IN THE SOFTWARE.
223
224Class to Display events received from the Apple Infrared Remote.
225
226 Copyright © 2006-2008 Amit Singh. All Rights Reserved.
227
228 Redistribution and use in source and binary forms, with or without
229 modification, are permitted provided that the following conditions
230 are met:
231 1. Redistributions of source code must retain the above copyright
232 notice, this list of conditions and the following disclaimer.
233 2. Redistributions in binary form must reproduce the above copyright
234 notice, this list of conditions and the following disclaimer in the
235 documentation and/or other materials provided with the distribution.
236
237 THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
238 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
239 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
240 ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
241 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
242 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
243 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
244 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
245 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
246 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
247 SUCH DAMAGE.
248
249ISO C9x compliant stdint.h and inttypes.h for Microsoft Visual Studio
250
251 Copyright © 2006 Alexander Chemeris
252
253 Redistribution and use in source and binary forms, with or without
254 modification, are permitted provided that the following conditions are met:
255
256 1. Redistributions of source code must retain the above copyright notice,
257 this list of conditions and the following disclaimer.
258
259 2. Redistributions in binary form must reproduce the above copyright
260 notice, this list of conditions and the following disclaimer in the
261 documentation and/or other materials provided with the distribution.
262
263 3. The name of the author may be used to endorse or promote products
264 derived from this software without specific prior written permission.
265
266 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
267 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
268 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
269 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
270 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
271 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
272 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
273 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
274 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
275 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276
277cURL - library and command line tool for transferring files with URL syntax
278<http://curl.haxx.se/>
279
280 Copyright © 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
281
282 Permission to use, copy, modify, and distribute this software for any
283 purpose with or without fee is hereby granted, provided that the above
284 copyright notice and this permission notice appear in all copies.
285
286 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
287 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
288 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
289 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
290 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
291 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
292 USE OR OTHER DEALINGS IN THE SOFTWARE.
293
294 Except as contained in this notice, the name of a copyright holder shall not
295 be used in advertising or otherwise to promote the sale, use or other
296 dealings in this Software without prior written authorization of the
297 copyright holder.
298
299RegExp.h
300
301 Copyright © 1986, 1993, 1995 by University of Toronto.
302
303 Permission is granted to anyone to use this software for any
304 purpose on any computer system, and to redistribute it in any way,
305 subject to the following restrictions:
306
307 1. The author is not responsible for the consequences of use of
308 this software, no matter how awful, even if they arise
309 from defects in it.
310
311 2. The origin of this software must not be misrepresented, either
312 by explicit claim or by omission.
313
314 3. Altered versions must be plainly marked as such, and must not
315 be misrepresented (by explicit claim or omission) as being
316 the original software.
317
318 4. This notice must not be removed or altered.
319
320GNU gettext - internationalization aids
321<http://www.gnu.org/software/gettext/>
322
323 Copyright © 1988, 1989, 1992, 1993, 1995 Free Software Foundation, Inc.
324
325 This program is free software; you can redistribute it and/or modify
326 it under the terms of the GNU General Public License as published by
327 the Free Software Foundation; either version 2 of the License, or
328 (at your option) any later version.
329
330 This program is distributed in the hope that it will be useful,
331 but WITHOUT ANY WARRANTY; without even the implied warranty of
332 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333 GNU General Public License for more details.
334
335 You should have received a copy of the GNU General Public License
336 along with this program. If not, see <http://www.gnu.org/licenses/>.
337
338DBUSServer Class
339<http://www.azurdigitalnetworks.net/>
340
341 Copyright © 2009 Azur Digital Networks
342
343 This program is free software; you can redistribute it and/or modify
344 it under the terms of the GNU General Public License as published by
345 the Free Software Foundation; either version 2 of the License, or
346 (at your option) any later version.
347
348 This program is distributed in the hope that it will be useful,
349 but WITHOUT ANY WARRANTY; without even the implied warranty of
350 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
351 GNU General Public License for more details.
352
353 You should have received a copy of the GNU General Public License
354 along with this program. If not, see <http://www.gnu.org/licenses/>.
355
356Really Slick X Screensavers
357<http://www.reallyslick.com/>
358
359 Copyright © 2002-2006 Michael Chapman
360 Copyright © 2002 Terence M. Welsh
361
362 This program is free software; you can redistribute it and/or modify
363 it under the terms of the GNU General Public License as published by
364 the Free Software Foundation; either version 2 of the License, or
365 (at your option) any later version.
366
367 This program is distributed in the hope that it will be useful,
368 but WITHOUT ANY WARRANTY; without even the implied warranty of
369 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
370 GNU General Public License for more details.
371
372 You should have received a copy of the GNU General Public License
373 along with this program. If not, see <http://www.gnu.org/licenses/>.
374
375SDLMain.h
376
377 Copyright © Darrell Walisser <dwaliss1@purdue.edu>
378 Copyright © Max Horn <max@quendi.de>
379
380 Feel free to customize this file to suit your needs.
381
382XKGeneral.h - General Utility and Helper function Class' Header
383
384 Copyright © TEAM ASSEMBLY www.team-assembly.com
385
386 This program is free software; you can redistribute it and/or modify
387 it under the terms of the GNU General Public License as published by
388 the Free Software Foundation; either version 2 of the License, or
389 (at your option) any later version.
390
391 This program is distributed in the hope that it will be useful,
392 but WITHOUT ANY WARRANTY; without even the implied warranty of
393 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
394 GNU General Public License for more details.
395
396 You should have received a copy of the GNU General Public License
397 along with this program. If not, see <http://www.gnu.org/licenses/>.
398
399Goom 2k4
400<http://www.ios-software.com/index.php3?page=projet&quoi=1&lg=AN>
401
402 Copyright © 2000-2004, Jean-Christophe Hoelt <jeko@ios-software.com>
403 Copyright © 2000-2004, Guillaume Borios <gyom@ios-software.com>
404
405 This library is free software; you can redistribute it and/or
406 modify it under the terms of the GNU Lesser General Public
407 License as published by the Free Software Foundation; either
408 version 2.1 of the License, or (at your option) any later version.
409
410 This library is distributed in the hope that it will be useful,
411 but WITHOUT ANY WARRANTY; without even the implied warranty of
412 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
413 Lesser General Public License for more details.
414
415 You should have received a copy of the GNU Lesser General Public License
416 along with this program. If not, see <http://www.gnu.org/licenses/>.
417
418 iTunes Visualizer Plug-In SDK files included in Goom 2k4 are under the
419 following license.
420
421 Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
422
423 This Apple software is supplied to you by Apple Computer, Inc. in
424 consideration of your agreement to the following terms, and your use,
425 installation, modification or redistribution of this Apple software
426 constitutes acceptance of these terms. If you do not agree with these terms,
427 please do not use, install, modify or redistribute this Apple software.
428
429 In consideration of your agreement to abide by the following terms, and
430 subject to these terms, Apple grants you a personal, non-exclusive license,
431 under Apple's intellectual property rights in this Apple Software (the
432 "Apple Software"), to use, reproduce, modify and distribute the Apple
433 Software; provided that no license is granted herein under any patents that
434 may be infringed by your modifications, derivative works or by other works
435 in which the Apple Software may be incorporated. No names, trademarks,
436 service marks or logos of Apple Computer, Inc. may be used to endorse or
437 promote products derived from the Apple Software without specific prior
438 written permission from Apple. Except as expressly stated herein, no other
439 rights or licenses, express or implied, are granted by Apple and nothing
440 herein grants any license under any patents except claims of Apple patents
441 that cover this Apple Software as originally provided by Apple, and only to
442 the extent necessary to use and distribute this Apple Software as originally
443 provided by Apple.
444
445 The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
446 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
447 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
448 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
449 COMBINATION WITH ANY PRODUCT.
450
451 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
452 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
453 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
454 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
455 AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER
456 THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
457 OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
458
459XAnalyser, frequence spectrum analyser for X Window
460<http://arvin.schnell-web.net/xanalyser/>
461
462 Copyright © 1998 Arvin Schnell
463
464 This program is free software; you can redistribute it and/or modify
465 it under the terms of the GNU General Public License as published by
466 the Free Software Foundation; either version 2 of the License, or
467 (at your option) any later version.
468
469 This program is distributed in the hope that it will be useful,
470 but WITHOUT ANY WARRANTY; without even the implied warranty of
471 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
472 GNU General Public License for more details.
473
474 You should have received a copy of the GNU General Public License
475 along with this program. If not, see <http://www.gnu.org/licenses/>.
476
477XMMS - Cross-platform multimedia player
478<http://www.xmms.org/>
479
480 Copyright © 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson
481 and 4Front Technologies
482
483 This program is free software; you can redistribute it and/or modify
484 it under the terms of the GNU General Public License as published by
485 the Free Software Foundation; either version 2 of the License, or
486 (at your option) any later version.
487
488 This program is distributed in the hope that it will be useful,
489 but WITHOUT ANY WARRANTY; without even the implied warranty of
490 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
491 GNU General Public License for more details.
492
493 You should have received a copy of the GNU General Public License
494 along with this program. If not, see <http://www.gnu.org/licenses/>.
495
496Pthreads-win32 - POSIX Threads Library for Win32
497<http://sourceware.org/pthreads-win32/>
498
499 Copyright © 1998 John E. Bossom
500
501 This library is free software; you can redistribute it and/or
502 modify it under the terms of the GNU Library General Public
503 License as published by the Free Software Foundation; either
504 version 2 of the License, or (at your option) any later version.
505
506 This library is distributed in the hope that it will be useful,
507 but WITHOUT ANY WARRANTY; without even the implied warranty of
508 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
509 Library General Public License for more details.
510
511 You should have received a copy of the GNU Library General Public License
512 along with this program. If not, see <http://www.gnu.org/licenses/>.
513
514projectM - OpenGL based advanced music visualization program
515<http://projectm.sourceforge.net/>
516
517 Copyright © 2003-2007 projectM Team
518
519 This library is free software; you can redistribute it and/or
520 modify it under the terms of the GNU Lesser General Public
521 License as published by the Free Software Foundation; either
522 version 2.1 of the License, or (at your option) any later version.
523
524 This library is distributed in the hope that it will be useful,
525 but WITHOUT ANY WARRANTY; without even the implied warranty of
526 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
527 Lesser General Public License for more details.
528
529 You should have received a copy of the GNU Lesser General Public License
530 along with this program. If not, see <http://www.gnu.org/licenses/>.
531
532GLEW - The OpenGL Extension Wrangler Library
533<http://glew.sourceforge.net/>
534
535 Copyright © 2002-2008, Milan Ikits <milan ikits[]ieee org>
536 Copyright © 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
537 Copyright © 2002, Lev Povalahev
538 Copyright © 1999-2007 Brian Paul
539 Copyright © 2007 The Khronos Group Inc.
540 All Rights Reserved.
541
542 Falls under three licenses, which are the Modified BSD License, the Mesa 3-D
543 License (MIT License), and the Khronos License (MIT License).
544
545 Modified BSD License
546
547 Redistribution and use in source and binary forms, with or without
548 modification, are permitted provided that the following conditions are met:
549
550 * Redistributions of source code must retain the above copyright notice,
551 this list of conditions and the following disclaimer.
552 * Redistributions in binary form must reproduce the above copyright notice,
553 this list of conditions and the following disclaimer in the documentation
554 and/or other materials provided with the distribution.
555 * The name of the author may be used to endorse or promote products
556 derived from this software without specific prior written permission.
557
558 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
559 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
560 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
561 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
562 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
563 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
564 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
565 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
566 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
567 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
568 THE POSSIBILITY OF SUCH DAMAGE.
569
570 Mesa 3-D License (MIT License)
571
572 Permission is hereby granted, free of charge, to any person obtaining a
573 copy of this software and associated documentation files (the "Software"),
574 to deal in the Software without restriction, including without limitation
575 the rights to use, copy, modify, merge, publish, distribute, sublicense,
576 and/or sell copies of the Software, and to permit persons to whom the
577 Software is furnished to do so, subject to the following conditions:
578
579 The above copyright notice and this permission notice shall be included
580 in all copies or substantial portions of the Software.
581
582 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
583 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
584 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
585 BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
586 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
587 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
588
589 Khronos License (MIT License)
590
591 Permission is hereby granted, free of charge, to any person obtaining a
592 copy of this software and/or associated documentation files (the
593 "Materials"), to deal in the Materials without restriction, including
594 without limitation the rights to use, copy, modify, merge, publish,
595 distribute, sublicense, and/or sell copies of the Materials, and to
596 permit persons to whom the Materials are furnished to do so, subject to
597 the following conditions:
598
599 The above copyright notice and this permission notice shall be included
600 in all copies or substantial portions of the Materials.
601
602 THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
603 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
604 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
605 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
606 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
607 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
608 MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
609
610OpenDAAP
611<http://www.opendaap.org/>
612
613 Copyright © 2004 Forza (Chris Barnett)
614 Copyright © the authors of libOpenDAAP
615
616 This program is free software; you can redistribute it and/or modify
617 it under the terms of the GNU General Public License as published by
618 the Free Software Foundation; either version 2 of the License, or
619 (at your option) any later version.
620
621 This program is distributed in the hope that it will be useful,
622 but WITHOUT ANY WARRANTY; without even the implied warranty of
623 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
624 GNU General Public License for more details.
625
626 You should have received a copy of the GNU General Public License
627 along with this program. If not, see <http://www.gnu.org/licenses/>.
628
629zlib - A Massively Spiffy Yet Delicately Unobtrusive Compression Library
630<http://www.zlib.net/>
631
632 Copyright © 1995-2002 Jean-loup Gailly and Mark Adler.
633
634 This software is provided 'as-is', without any express or implied
635 warranty. In no event will the authors be held liable for any damages
636 arising from the use of this software.
637
638 Permission is granted to anyone to use this software for any purpose,
639 including commercial applications, and to alter it and redistribute it
640 freely, subject to the following restrictions:
641
642 1. The origin of this software must not be misrepresented; you must not
643 claim that you wrote the original software. If you use this software
644 in a product, an acknowledgment in the product documentation would be
645 appreciated but is not required.
646 2. Altered source versions must be plainly marked as such, and must not be
647 misrepresented as being the original software.
648 3. This notice may not be removed or altered from any source distribution.
649
650iso9660.h
651
652 Copyright © The Joker / Avalaunch team
653
654 This program is free software; you can redistribute it and/or modify
655 it under the terms of the GNU General Public License as published by
656 the Free Software Foundation; either version 2 of the License, or
657 (at your option) any later version.
658
659 This program is distributed in the hope that it will be useful,
660 but WITHOUT ANY WARRANTY; without even the implied warranty of
661 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
662 GNU General Public License for more details.
663
664 You should have received a copy of the GNU General Public License
665 along with this program. If not, see <http://www.gnu.org/licenses/>.
666
667Neptune Portable C++ Runtime Library
668<http://neptune.sourceforge.net/>
669
670 Copyright © 2001-2006 Gilles Boccon-Gibod
671 Copyright © 2002-2008, Axiomatic Systems, LLC.
672 All rights reserved.
673
674 Redistribution and use in source and binary forms, with or without
675 modification, are permitted provided that the following conditions are met:
676 * Redistributions of source code must retain the above copyright
677 notice, this list of conditions and the following disclaimer.
678 * Redistributions in binary form must reproduce the above copyright
679 notice, this list of conditions and the following disclaimer in the
680 documentation and/or other materials provided with the distribution.
681 * Neither the name of the <organization> nor the
682 names of its contributors may be used to endorse or promote products
683 derived from this software without specific prior written permission.
684
685 THIS SOFTWARE IS PROVIDED BY AXIOMATIC SYSTEMS ''AS IS'' AND ANY
686 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
687 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
688 DISCLAIMED. IN NO EVENT SHALL AXIOMATIC SYSTEMS BE LIABLE FOR ANY
689 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
690 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
691 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
692 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
693 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
694 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
695
696MMST implementation taken from the xine-mms plugin made by Major MMS
697(http://geocities.com/majormms/).
698
699 Copyright © 2005-2008 Team Kodi
700 Copyright © 2002 Abhijeet Phatak <abhijeetphatak@yahoo.com>
701 Copyright © 2002 the xine project
702 Copyright © 2000-2001 major mms
703
704 This program is free software; you can redistribute it and/or modify
705 it under the terms of the GNU General Public License as published by
706 the Free Software Foundation; either version 2 of the License, or
707 (at your option) any later version.
708
709 This program is distributed in the hope that it will be useful,
710 but WITHOUT ANY WARRANTY; without even the implied warranty of
711 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
712 GNU General Public License for more details.
713
714 You should have received a copy of the GNU General Public License
715 along with this program. If not, see <http://www.gnu.org/licenses/>.
716
717Ogg Bitstream Library
718<http://www.xiph.org/>
719
720 Copyright © 1994-2002 Xiph.Org Foundation http://www.xiph.org/
721
722 Redistribution and use in source and binary forms, with or without
723 modification, are permitted provided that the following conditions are met:
724
725 * Redistributions of source code must retain the above copyright notice,
726 this list of conditions and the following disclaimer.
727 * Redistributions in binary form must reproduce the above copyright
728 notice, this list of conditions and the following disclaimer in the
729 documentation and/or other materials provided with the distribution.
730 * Neither the name of the Xiph.org Foundation nor the names of its
731 contributors may be used to endorse or promote products derived from
732 this software without specific prior written permission.
733
734 This software is provided by the copyright holders and contributors “as is”
735 and any express or implied warranties, including, but not limited to, the
736 implied warranties of merchantability and fitness for a particular purpose
737 are disclaimed. In no event shall the foundation or contributors be liable
738 for any direct, indirect, incidental, special, exemplary, or consequential
739 damages (including, but not limited to, procurement of substitute goods or
740 services; loss of use, data, or profits; or business interruption) however
741 caused and on any theory of liability, whether in contract, strict
742 liability, or tort (including negligence or otherwise) arising in any way
743 out of the use of this software, even if advised of the possibility of such
744 damage.
745
746The Vorbis General Audio Compression Codec
747<http://www.xiph.org/>
748
749 Copyright © 2002, Xiph.org Foundation
750
751 Redistribution and use in source and binary forms, with or without
752 modification, are permitted provided that the following conditions are met:
753
754 * Redistributions of source code must retain the above copyright notice,
755 this list of conditions and the following disclaimer.
756 * Redistributions in binary form must reproduce the above copyright
757 notice, this list of conditions and the following disclaimer in the
758 documentation and/or other materials provided with the distribution.
759 * Neither the name of the Xiph.org Foundation nor the names of its
760 contributors may be used to endorse or promote products derived from
761 this software without specific prior written permission.
762
763 This software is provided by the copyright holders and contributors “as is”
764 and any express or implied warranties, including, but not limited to, the
765 implied warranties of merchantability and fitness for a particular purpose
766 are disclaimed. In no event shall the foundation or contributors be liable
767 for any direct, indirect, incidental, special, exemplary, or consequential
768 damages (including, but not limited to, procurement of substitute goods or
769 services; loss of use, data, or profits; or business interruption) however
770 caused and on any theory of liability, whether in contract, strict
771 liability, or tort (including negligence or otherwise) arising in any way
772 out of the use of this software, even if advised of the possibility of such
773 damage.
774
775LAME Ain't an Mp3 Encoder
776<http://lame.sourceforge.net/>
777
778 Copyright © 1999 Mark Taylor
779
780 This program is free software; you can redistribute it and/or modify
781 it under the terms of the GNU General Public License as published by
782 the Free Software Foundation; either version 2 of the License, or
783 (at your option) any later version.
784
785 This program is distributed in the hope that it will be useful,
786 but WITHOUT ANY WARRANTY; without even the implied warranty of
787 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788 GNU General Public License for more details.
789
790 You should have received a copy of the GNU General Public License
791 along with this program. If not, see <http://www.gnu.org/licenses/>.
792
793GNU libmicrohttpd
794<http://www.gnu.org/software/libmicrohttpd/>
795
796 (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing
797 authors)
798
799 This library is free software; you can redistribute it and/or
800 modify it under the terms of the GNU Lesser General Public
801 License as published by the Free Software Foundation; either
802 version 2.1 of the License, or (at your option) any later version.
803
804 This library is distributed in the hope that it will be useful,
805 but WITHOUT ANY WARRANTY; without even the implied warranty of
806 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
807 Lesser General Public License for more details.
808
809 You should have received a copy of the GNU Lesser General Public License
810 along with this program. If not, see <http://www.gnu.org/licenses/>.
811
812libmodplug
813<http://modplug-xmms.sourceforge.net>
814
815 Copyright 2002-2003 Kenton Varda <temporal@gauge3d.org>,
816 Olivier Lapicque <olivierl@jps.net>,
817 Colin DeVilbiss <crdevilb@mtu.edu>,
818 Markus Fick <marf@gmx.net>,
819 Adam Goode <adam@evdebs.org>
820
821 This library is free software; you can redistribute it and/or
822 modify it under the terms of the GNU Lesser General Public
823 License as published by the Free Software Foundation; either
824 version 2.1 of the License, or (at your option) any later version.
825
826 This library is distributed in the hope that it will be useful,
827 but WITHOUT ANY WARRANTY; without even the implied warranty of
828 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
829 Lesser General Public License for more details.
830
831 You should have received a copy of the GNU Lesser General Public License
832 along with this program. If not, see <http://www.gnu.org/licenses/>.
833
834Python Programming Language
835<http://www.python.org/>
836
837 Copyright © 2001-2008 Python Software Foundation. All rights reserved.
838 Copyright © 2000 BeOpen.com. All rights reserved.
839 Copyright © 1995-2001 Corporation for National Research Initiatives. All
840 rights reserved.
841 Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
842
843 Python is distributed under the Python Software Foundation License
844 version 2. A copy of the license may be retrieved from
845 http://www.python.org/psf/license/ and is repeated below under the section
846 "License: PSF License for Python 2.4".
847
848libopendaap - library which enables applications to discover, and connect to,
849iTunes music shares.
850<http://craz.net/programs/itunes/libopendaap.html>
851
852 Copyright © 2004 David Hammerton.
853
854 Permission is hereby granted, free of charge, to any person obtaining a copy
855 of this software and associated documentation files (the "Software"), to
856 deal in the Software without restriction, including without limitation the
857 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
858 sell copies of the Software, and to permit persons to whom the Software is
859 furnished to do so, subject to the following conditions:
860
861 The above copyright notice and this permission notice shall be included in
862 all copies or substantial portions of the Software.
863
864 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
865 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
866 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
867 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
868 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
869 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
870 IN THE SOFTWARE.
871
872libsamplerate - audio rate conversion library
873<http://www.mega-nerd.com/SRC/>
874
875 Copyright © 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
876
877 This program is free software; you can redistribute it and/or modify
878 it under the terms of the GNU General Public License as published by
879 the Free Software Foundation; either version 2 of the License, or
880 (at your option) any later version.
881
882 This program is distributed in the hope that it will be useful,
883 but WITHOUT ANY WARRANTY; without even the implied warranty of
884 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
885 GNU General Public License for more details.
886
887 You should have received a copy of the GNU General Public License
888 along with this program. If not, see <http://www.gnu.org/licenses/>.
889
890MediaMVP Media Center
891<http://www.mvpmc.org/>
892
893 Copyright © 2004-2006, Eric Lund, Jon Gettler, Sergio Slobodrian
894 http://www.mvpmc.org/
895
896 This library is free software; you can redistribute it and/or
897 modify it under the terms of the GNU Lesser General Public
898 License as published by the Free Software Foundation; either
899 version 2.1 of the License, or (at your option) any later version.
900
901 This library is distributed in the hope that it will be useful,
902 but WITHOUT ANY WARRANTY; without even the implied warranty of
903 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
904 Lesser General Public License for more details.
905
906 You should have received a copy of the GNU Lesser General Public License
907 along with this program. If not, see <http://www.gnu.org/licenses/>.
908
909MySQL
910<http://www.mysql.com/>
911
912 Copyright © 2000-2003 MySQL AB
913
914 This program is free software; you can redistribute it and/or modify
915 it under the terms of the GNU General Public License as published by
916 the Free Software Foundation; either version 2 of the License.
917
918 This program is distributed in the hope that it will be useful,
919 but WITHOUT ANY WARRANTY; without even the implied warranty of
920 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
921 GNU General Public License for more details.
922
923 You should have received a copy of the GNU General Public License
924 along with this program. If not, see <http://www.gnu.org/licenses/>.
925
926libid3tag - ID3 tag manipulation library
927<http://www.underbit.com/products/mad/>
928
929 Copyright © 2000-2004 Underbit Technologies, Inc.
930
931 This program is free software; you can redistribute it and/or modify
932 it under the terms of the GNU General Public License as published by
933 the Free Software Foundation; either version 2 of the License, or
934 (at your option) any later version.
935
936 This program is distributed in the hope that it will be useful,
937 but WITHOUT ANY WARRANTY; without even the implied warranty of
938 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
939 GNU General Public License for more details.
940
941 You should have received a copy of the GNU General Public License
942 along with this program. If not, see <http://www.gnu.org/licenses/>.
943
944Simple DirectMedia Layer
945<http://www.libsdl.org/>
946
947 Copyright © 1997-2006 Sam Lantinga
948
949 This library is free software; you can redistribute it and/or
950 modify it under the terms of the GNU Lesser General Public
951 License as published by the Free Software Foundation; either
952 version 2.1 of the License, or (at your option) any later version.
953
954 This library is distributed in the hope that it will be useful,
955 but WITHOUT ANY WARRANTY; without even the implied warranty of
956 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
957 Lesser General Public License for more details.
958
959 You should have received a copy of the GNU Lesser General Public License
960 along with this program. If not, see <http://www.gnu.org/licenses/>.
961
962libfribidi - Free Implementation of the Unicode BiDi algorithm
963<http://www.fribidi.org/>
964
965 Copyright © 1999,2000 Dov Grobgeld
966 Copyright © 2001,2002 Behdad Esfahbod
967
968 This library is free software; you can redistribute it and/or
969 modify it under the terms of the GNU Lesser General Public
970 License as published by the Free Software Foundation; either
971 version 2.1 of the License, or (at your option) any later version.
972
973 This library is distributed in the hope that it will be useful,
974 but WITHOUT ANY WARRANTY; without even the implied warranty of
975 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
976 Lesser General Public License for more details.
977
978 You should have received a copy of the GNU Lesser General Public License
979 along with this program. If not, see <http://www.gnu.org/licenses/>.
980
981CDRip - library that provides methods for extracting data from audio CDs
982<http://libcdrip.sourceforge.net/>
983
984 Copyright © 1999 - 2002 Albert L. Faber
985
986 This program is free software; you can redistribute it and/or modify
987 it under the terms of the GNU General Public License as published by
988 the Free Software Foundation; either version 2 of the License, or
989 (at your option) any later version.
990
991 This program is distributed in the hope that it will be useful,
992 but WITHOUT ANY WARRANTY; without even the implied warranty of
993 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
994 GNU General Public License for more details.
995
996 You should have received a copy of the GNU General Public License
997 along with this program. If not, see <http://www.gnu.org/licenses/>.
998
999Platinum - UPnP library
1000<http://www.plutinosoft.com/>
1001
1002 Copyright © 2004-2008, Plutinosoft, LLC. All rights reserved.
1003
1004 This program is free software; you can redistribute it and/or modify
1005 it under the terms of the GNU General Public License as published by
1006 the Free Software Foundation; either version 2 of the License, or
1007 (at your option) any later version.
1008
1009 This program is distributed in the hope that it will be useful,
1010 but WITHOUT ANY WARRANTY; without even the implied warranty of
1011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1012 GNU General Public License for more details.
1013
1014 You should have received a copy of the GNU General Public License
1015 along with this program. If not, see <http://www.gnu.org/licenses/>.
1016
1017SQLite - library that implements a self-contained, serverless,
1018zero-configuration, transactional SQL database engine.
1019<http://www.sqlite.org/>
1020
1021 Copyright © 2004, Leo Seib, Hannover
1022
1023 Permission is hereby granted, free of charge, to any person obtaining a copy
1024 of this software and associated documentation files (the "Software"), to
1025 deal in the Software without restriction, including without limitation the
1026 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1027 sell copies of the Software, and to permit persons to whom the Software is
1028 furnished to do so, subject to the following conditions:
1029
1030 The above copyright notice and this permission notice shall be included in
1031 all copies or substantial portions of the Software.
1032
1033 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1034 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1035 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1036 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1037 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1038 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1039 IN THE SOFTWARE.
1040
1041CxImage - C++ image processing and conversion library
1042<http://www.xdp.it/cximage.htm>
1043
1044 Copyright © 2001 - 2008, Davide Pizzolato
1045
1046 Original CImage and CImageIterator implementation are:
1047 Copyright © 1995, Alejandro Aguilar Sierra
1048 (asierra(at)servidor(dot)unam(dot)mx)
1049
1050 Covered code is provided under this license on an "as is" basis, without
1051 warranty of any kind, either expressed or implied, including, without
1052 limitation, warranties that the covered code is free of defects,
1053 merchantable, fit for a particular purpose or non-infringing. The entire
1054 risk as to the quality and performance of the covered code is with you.
1055 Should any covered code prove defective in any respect, you (not the initial
1056 developer or any other contributor) assume the cost of any necessary
1057 servicing, repair or correction. This disclaimer of warranty constitutes an
1058 essential part of this license. No use of any covered code is authorized
1059 hereunder except under this disclaimer.
1060
1061 Permission is hereby granted to use, copy, modify, and distribute this
1062 source code, or portions hereof, for any purpose, including commercial
1063 applications, freely and without fee, subject to the following restrictions:
1064
1065 1. The origin of this software must not be misrepresented; you must not
1066 claim that you wrote the original software. If you use this software
1067 in a product, an acknowledgment in the product documentation would be
1068 appreciated but is not required.
1069
1070 2. Altered source versions must be plainly marked as such, and must not be
1071 misrepresented as being the original software.
1072
1073 3. This notice may not be removed or altered from any source distribution.
1074
1075 Portions of CxImage are under different copyright and under different
1076 licenses.
1077
1078 JasPer
1079 Copyright © 2001-2006 Michael David Adams
1080 Copyright © 1999-2000 Image Power, Inc.
1081 Copyright © 1999-2000 The University of British Columbia
1082 All Rights Reserved.
1083
1084 Permission is hereby granted, free of charge, to any person (the
1085 "User") obtaining a copy of this software and associated documentation
1086 files (the "Software"), to deal in the Software without restriction,
1087 including without limitation the rights to use, copy, modify, merge,
1088 publish, distribute, and/or sell copies of the Software, and to permit
1089 persons to whom the Software is furnished to do so, subject to the
1090 following conditions:
1091
1092 1. The above copyright notices and this permission notice (which
1093 includes the disclaimer below) shall be included in all copies or
1094 substantial portions of the Software.
1095
1096 2. The name of a copyright holder shall not be used to endorse or
1097 promote products derived from the Software without specific prior
1098 written permission.
1099
1100 THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
1101 LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER
1102 THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
1103 "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
1104 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
1105 PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO
1106 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1107 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1108 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1109 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1110 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE
1111 PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE
1112 THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY.
1113 EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS
1114 BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL
1115 PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS
1116 GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE
1117 ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE
1118 IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL
1119 SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES,
1120 AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL
1121 SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH
1122 THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH,
1123 PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH
1124 RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY
1125 EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
1126
1127 JBIG
1128 Copyright © Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/
1129
1130 This program is free software; you can redistribute it and/or modify
1131 it under the terms of the GNU General Public License as published by
1132 the Free Software Foundation; either version 2 of the License, or
1133 (at your option) any later version.
1134
1135 This program is distributed in the hope that it will be useful,
1136 but WITHOUT ANY WARRANTY; without even the implied warranty of
1137 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1138 GNU General Public License for more details.
1139
1140 You should have received a copy of the GNU General Public License
1141 along with this program. If not, see <http://www.gnu.org/licenses/>.
1142
1143 MNG
1144 Copyright © 2000-2007 Gerard Juyn (gerard@libmng.com)
1145
1146 For the purposes of this copyright and license, "Contributing Authors"
1147 is defined as the following set of individuals:
1148
1149 Gerard Juyn
1150 Glenn Randers-Pehrson
1151
1152 The MNG Library is supplied "AS IS". The Contributing Authors
1153 disclaim all warranties, expressed or implied, including, without
1154 limitation, the warranties of merchantability and of fitness for any
1155 purpose. The Contributing Authors assume no liability for direct,
1156 indirect, incidental, special, exemplary, or consequential damages,
1157 which may result from the use of the MNG Library, even if advised of
1158 the possibility of such damage.
1159
1160 Permission is hereby granted to use, copy, modify, and distribute this
1161 source code, or portions hereof, for any purpose, without fee, subject
1162 to the following restrictions:
1163
1164 1. The origin of this source code must not be misrepresented;
1165 you must not claim that you wrote the original software.
1166
1167 2. Altered versions must be plainly marked as such and must not be
1168 misrepresented as being the original source.
1169
1170 3. This Copyright notice may not be removed or altered from any source
1171 or altered source distribution.
1172
1173 The Contributing Authors specifically permit, without fee, and
1174 encourage the use of this source code as a component to supporting
1175 MNG and JNG file format in commercial products. If you use this
1176 source code in a product, acknowledgment would be highly appreciated.
1177
1178 JPEG
1179 Copyright © 1994-1998, Thomas G. Lane.
1180
1181 JPEG code is under the Independent JPEG Group License which can be found at
1182 http://dev.w3.org/cvsweb/Amaya/libjpeg/Attic/README?rev=1.2 and is repeated
1183 under the section "License: IJG License".
1184
1185 TIFF
1186 Copyright © 1988-1997 Sam Leffler
1187 Copyright © 1991-1997 Silicon Graphics, Inc.
1188
1189 Permission is hereby granted, free of charge, to any person obtaining a copy
1190 of this software and associated documentation files (the "Software"), to
1191 deal in the Software without restriction, including without limitation the
1192 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1193 sell copies of the Software, and to permit persons to whom the Software is
1194 furnished to do so, subject to the following conditions:
1195
1196 The above copyright notice and this permission notice shall be included in
1197 all copies or substantial portions of the Software.
1198
1199 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1200 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1201 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1202 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1203 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1204 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1205 IN THE SOFTWARE.
1206
1207 PNG
1208 Copyright © 1998, 1999 Glenn Randers-Pehrson
1209
1210 This software is provided 'as-is', without any express or implied
1211 warranty. In no event will the authors be held liable for any damages
1212 arising from the use of this software.
1213
1214 Permission is granted to anyone to use this software for any purpose,
1215 including commercial applications, and to alter it and redistribute it
1216 freely, subject to the following restrictions:
1217
1218 1. The origin of this software must not be misrepresented; you must not
1219 claim that you wrote the original software. If you use this software
1220 in a product, an acknowledgment in the product documentation would be
1221 appreciated but is not required.
1222 2. Altered source versions must be plainly marked as such, and must not be
1223 misrepresented as being the original software.
1224 3. This notice may not be removed or altered from any source distribution.
1225
1226 Dave Coffin's raw photo decoder
1227 Copyright © 1997-2009 by Dave Coffin, dcoffin a cybercom o net
1228
1229 Covered code is provided under this license on an "as is" basis, without
1230 warranty of any kind, either expressed or implied, including, without
1231 limitation, warranties that the covered code is free of defects,
1232 merchantable, fit for a particular purpose or non-infringing. The entire
1233 risk as to the quality and performance of the covered code is with you.
1234 Should any covered code prove defective in any respect, you (not the initial
1235 developer or any other contributor) assume the cost of any necessary
1236 servicing, repair or correction. This disclaimer of warranty constitutes an
1237 essential part of this license. No use of any covered code is authorized
1238 hereunder except under this disclaimer.
1239
1240 No license is required to download and use libdcr. However,
1241 to lawfully redistribute libdcr, you must either (a) offer, at
1242 no extra charge, full source code for all executable files
1243 containing RESTRICTED functions, (b) distribute this code under
1244 the GPL Version 2 or later, (c) remove all RESTRICTED functions,
1245 re-implement them, or copy them from an earlier, unrestricted
1246 revision of dcraw.c, or (d) purchase a license from the author
1247 of dcraw.c.
1248
1249PortAudio - portable cross-platform Audio API
1250<http://www.portaudio.com/>
1251
1252 Copyright © 1999-2002 Ross Bencina and Phil Burk
1253
1254 Permission is hereby granted, free of charge, to any person obtaining a copy
1255 of this software and associated documentation files (the "Software"), to
1256 deal in the Software without restriction, including without limitation the
1257 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1258 sell copies of the Software, and to permit persons to whom the Software is
1259 furnished to do so, subject to the following conditions:
1260
1261 The above copyright notice and this permission notice shall be included in
1262 all copies or substantial portions of the Software.
1263
1264 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1265 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1266 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1267 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1268 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1269 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1270 IN THE SOFTWARE.
1271
1272Audioscrobbler - The Social Music Technology Playground
1273<http://www.audioscrobbler.net/>
1274
1275 Copyright © 2003 Russell Garrett (russ-scrobbler@garrett.co.uk)
1276
1277 This program is free software; you can redistribute it and/or modify
1278 it under the terms of the GNU General Public License as published by
1279 the Free Software Foundation; either version 2 of the License, or
1280 (at your option) any later version.
1281
1282 This program is distributed in the hope that it will be useful,
1283 but WITHOUT ANY WARRANTY; without even the implied warranty of
1284 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1285 GNU General Public License for more details.
1286
1287 You should have received a copy of the GNU General Public License
1288 along with this program. If not, see <http://www.gnu.org/licenses/>.
1289
1290Samba - Opening Windows to a Wider World
1291<http://www.samba.org/>
1292
1293 Copyright © Andrew Tridgell 1998
1294 Copyright © Richard Sharpe 2000
1295 Copyright © John Terpsra 2000
1296 Copyright © Tom Jansen (Ninja ISD) 2002
1297 Copyright © Derrell Lipman 2003
1298
1299 This program is free software; you can redistribute it and/or modify
1300 it under the terms of the GNU General Public License as published by
1301 the Free Software Foundation; either version 2 of the License, or
1302 (at your option) any later version.
1303
1304 This program is distributed in the hope that it will be useful,
1305 but WITHOUT ANY WARRANTY; without even the implied warranty of
1306 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1307 GNU General Public License for more details.
1308
1309 You should have received a copy of the GNU General Public License
1310 along with this program. If not, see <http://www.gnu.org/licenses/>.
1311
1312PCRE - Perl Compatible Regular Expressions
1313<http://www.pcre.org/>
1314
1315 Copyright © 1997-2007 University of Cambridge
1316
1317 Redistribution and use in source and binary forms, with or without
1318 modification, are permitted provided that the following conditions are met:
1319
1320 * Redistributions of source code must retain the above copyright notice,
1321 this list of conditions and the following disclaimer.
1322
1323 * Redistributions in binary form must reproduce the above copyright
1324 notice, this list of conditions and the following disclaimer in the
1325 documentation and/or other materials provided with the distribution.
1326
1327 * Neither the name of the University of Cambridge nor the names of its
1328 contributors may be used to endorse or promote products derived from
1329 this software without specific prior written permission.
1330
1331 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1332 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1333 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1334 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
1335 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1336 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1337 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1338 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1339 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1340 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1341 POSSIBILITY OF SUCH DAMAGE.
1342
1343HDHomeRun - Networked Digital Tuner
1344<http://www.silicondust.com/>
1345
1346 Copyright © 2006-2008 Silicondust Engineering Ltd. <www.silicondust.com>
1347
1348 This library is free software; you can redistribute it and/or
1349 modify it under the terms of the GNU Lesser General Public
1350 License as published by the Free Software Foundation; either
1351 version 3 of the License, or (at your option) any later version.
1352
1353 This library is distributed in the hope that it will be useful,
1354 but WITHOUT ANY WARRANTY; without even the implied warranty of
1355 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1356 Lesser General Public License for more details.
1357
1358 You should have received a copy of the GNU Lesser General Public
1359 License along with this library. If not, see
1360 <http://www.gnu.org/licenses/>.
1361
1362 As a special exception to the GNU Lesser General Public License,
1363 you may link, statically or dynamically, an application with a
1364 publicly distributed version of the Library to produce an
1365 executable file containing portions of the Library, and
1366 distribute that executable file under terms of your choice,
1367 without any of the additional requirements listed in clause 4 of
1368 the GNU Lesser General Public License.
1369
1370 By "a publicly distributed version of the Library", we mean
1371 either the unmodified Library as distributed by Silicondust, or a
1372 modified version of the Library that is distributed under the
1373 conditions defined in the GNU Lesser General Public License.
1374
1375LibASS - portable library for SSA/ASS subtitles rendering
1376<http://sourceforge.net/projects/libass/>
1377
1378 Copyright © 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
1379
1380 This program is free software; you can redistribute it and/or modify
1381 it under the terms of the GNU General Public License as published by
1382 the Free Software Foundation; either version 2 of the License, or
1383 (at your option) any later version.
1384
1385 This program is distributed in the hope that it will be useful,
1386 but WITHOUT ANY WARRANTY; without even the implied warranty of
1387 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1388 GNU General Public License for more details.
1389
1390 You should have received a copy of the GNU General Public License
1391 along with this program. If not, see <http://www.gnu.org/licenses/>.
1392
1393libRTV - ReplayTV library
1394
1395 Copyright © 2002 John Todd Larason <jtl@molehill.org>
1396
1397 This program is free software; you can redistribute it and/or modify
1398 it under the terms of the GNU General Public License as published by
1399 the Free Software Foundation; either version 2 of the License, or
1400 (at your option) any later version.
1401
1402 This program is distributed in the hope that it will be useful,
1403 but WITHOUT ANY WARRANTY; without even the implied warranty of
1404 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1405 GNU General Public License for more details.
1406
1407 You should have received a copy of the GNU General Public License
1408 along with this program. If not, see <http://www.gnu.org/licenses/>.
1409
1410libiconv - iconv() implementation
1411<http://www.gnu.org/software/libiconv/>
1412
1413 Copyright © 1999-2003 Free Software Foundation, Inc.
1414
1415 This library is free software; you can redistribute it and/or
1416 modify it under the terms of the GNU Library General Public
1417 License as published by the Free Software Foundation; either
1418 version 2 of the License, or (at your option) any later version.
1419
1420 This library is distributed in the hope that it will be useful,
1421 but WITHOUT ANY WARRANTY; without even the implied warranty of
1422 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1423 Library General Public License for more details.
1424
1425 You should have received a copy of the GNU Library General Public License
1426 along with this program. If not, see <http://www.gnu.org/licenses/>.
1427
1428Boost C++ Libraries
1429<http://www.boost.org/>
1430
1431 Copyright © 2001, 2002 Peter Dimov and Multi Media Ltd.
1432 Copyright © 2007 Peter Dimov
1433
1434 Permission is hereby granted, free of charge, to any person or organization
1435 obtaining a copy of the software and accompanying documentation covered by
1436 this license (the "Software") to use, reproduce, display, distribute,
1437 execute, and transmit the Software, and to prepare derivative works of the
1438 Software, and to permit third-parties to whom the Software is furnished to
1439 do so, all subject to the following:
1440
1441 The copyright notices in the Software and this entire statement, including
1442 the above license grant, this restriction and the following disclaimer,
1443 must be included in all copies of the Software, in whole or in part, and
1444 all derivative works of the Software, unless such copies or derivative
1445 works are solely in the form of machine-executable object code generated by
1446 a source language processor.
1447
1448 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1449 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1450 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
1451 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
1452 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
1453 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1454 DEALINGS IN THE SOFTWARE.
1455
1456HTS Tvheadend - Combined DVB receiver, Digital Video Recorder and Showtime
1457streaming server for Linux.
1458<http://www.lonelycoder.com/hts/>
1459
1460 Copyright © 2008 Andreas Öman
1461
1462 This program is free software: you can redistribute it and/or modify
1463 it under the terms of the GNU General Public License as published by
1464 the Free Software Foundation, either version 3 of the License, or
1465 (at your option) any later version.
1466
1467 This program is distributed in the hope that it will be useful,
1468 but WITHOUT ANY WARRANTY; without even the implied warranty of
1469 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1470 GNU General Public License for more details.
1471
1472 You should have received a copy of the GNU General Public License
1473 along with this program. If not, see <http://www.gnu.org/licenses/>.
1474
1475GNU Compact Disc Input and Control Library
1476<http://www.gnu.org/software/libcdio/index.html>
1477
1478 Copyright © 2001 Herbert Valerio Riedel <hvr@gnu.org>
1479 Copyright © 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
1480
1481 This program is free software; you can redistribute it and/or modify
1482 it under the terms of the GNU General Public License as published by
1483 the Free Software Foundation; either version 2 of the License, or
1484 (at your option) any later version.
1485
1486 This program is distributed in the hope that it will be useful,
1487 but WITHOUT ANY WARRANTY; without even the implied warranty of
1488 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1489 GNU General Public License for more details.
1490
1491 You should have received a copy of the GNU General Public License
1492 along with this program. If not, see <http://www.gnu.org/licenses/>.
1493
1494SNESAPU - SNES APU emulator library
1495<http://www.alpha-ii.com/>
1496
1497 Copyright © 2001-2006 Alpha-II
1498
1499 This library is free software; you can redistribute it and/or
1500 modify it under the terms of the GNU Lesser General Public
1501 License as published by the Free Software Foundation; either
1502 version 2.1 of the License, or (at your option) any later version.
1503
1504 This library is distributed in the hope that it will be useful,
1505 but WITHOUT ANY WARRANTY; without even the implied warranty of
1506 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1507 Lesser General Public License for more details.
1508
1509 You should have received a copy of the GNU Lesser General Public License
1510 along with this program. If not, see <http://www.gnu.org/licenses/>.
1511
1512Musepack Decoder Library
1513<http://www.musepack.net/>
1514
1515 Copyright © 2005, The Musepack Development Team. All rights reserved.
1516
1517 Redistribution and use in source and binary forms, with or without
1518 modification, are permitted provided that the following conditions are
1519 met:
1520
1521 * Redistributions of source code must retain the above copyrig
1522 notice, this list of conditions and the following disclaimer.
1523
1524 * Redistributions in binary form must reproduce the above
1525 copyright notice, this list of conditions and the following
1526 disclaimer in the documentation and/or other materials provided
1527 with the distribution.
1528
1529 * Neither the name of the The Musepack Development Team nor the
1530 names of its contributors may be used to endorse or promote
1531 products derived from this software without specific prior
1532 written permission.
1533
1534 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1535 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1536 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1537 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1538 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1539 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1540 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1541 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1542 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1543 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1544 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1545
1546FLAC - Free Lossless Audio Codec
1547
1548 Copyright © 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
1549
1550 This program is free software; you can redistribute it and/or modify
1551 it under the terms of the GNU General Public License as published by
1552 the Free Software Foundation; either version 2 of the License, or
1553 (at your option) any later version.
1554
1555 This program is distributed in the hope that it will be useful,
1556 but WITHOUT ANY WARRANTY; without even the implied warranty of
1557 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1558 GNU General Public License for more details.
1559
1560 You should have received a copy of the GNU General Public License
1561 along with this program. If not, see <http://www.gnu.org/licenses/>.
1562
1563Gens APU from Gens
1564<http://info.sonicretro.org/Gens/GS>
1565
1566 Copyright © 2002 by Stéphane Dallongeville
1567
1568 This program is free software; you can redistribute it and/or modify
1569 it under the terms of the GNU General Public License as published by
1570 the Free Software Foundation; either version 2 of the License, or
1571 (at your option) any later version.
1572
1573 This program is distributed in the hope that it will be useful,
1574 but WITHOUT ANY WARRANTY; without even the implied warranty of
1575 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1576 GNU General Public License for more details.
1577
1578 You should have received a copy of the GNU General Public License
1579 along with this program. If not, see <http://www.gnu.org/licenses/>.
1580
1581vgmstream - library for playback of various video game audio formats
1582<http://vgmstream.sourceforge.net/>
1583
1584 Copyright © 2008-2009 Adam Gashlin, Fastelbja, Ronny Elfert
1585
1586 Permission to use, copy, modify, and/or distribute this software for any
1587 purpose with or without fee is hereby granted, provided that the above
1588 copyright notice and this permission notice appear in all copies.
1589
1590 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1591 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1592 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
1593 SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1594 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1595 OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1596 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1597
1598nosefart - NES sound format player
1599<http://nosefart.sourceforge.net/>
1600
1601 Copyright © 1998-2000 Matthew Conte (matt@conte.com)
1602
1603 This program is free software; you can redistribute it and/or modify
1604 it under the terms of the GNU General Public License as published by
1605 the Free Software Foundation; either version 2 of the License, or
1606 (at your option) any later version.
1607
1608 This program is distributed in the hope that it will be useful,
1609 but WITHOUT ANY WARRANTY; without even the implied warranty of
1610 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1611 GNU General Public License for more details.
1612
1613 You should have received a copy of the GNU General Public License
1614 along with this program. If not, see <http://www.gnu.org/licenses/>.
1615
1616MAD - MPEG Audio Decoder
1617<http://www.underbit.com/products/mad/>
1618
1619 Copyright © 2000-2004 Underbit Technologies, Inc
1620
1621 This program is free software; you can redistribute it and/or modify
1622 it under the terms of the GNU General Public License as published by
1623 the Free Software Foundation; either version 2 of the License, or
1624 (at your option) any later version.
1625
1626 This program is distributed in the hope that it will be useful,
1627 but WITHOUT ANY WARRANTY; without even the implied warranty of
1628 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1629 GNU General Public License for more details.
1630
1631 You should have received a copy of the GNU General Public License
1632 along with this program. If not, see <http://www.gnu.org/licenses/>.
1633
1634SID Player Music Library V2
1635<http://sidplay2.sourceforge.net/>
1636
1637 Copyright © Michael Schwendt <mschwendt@yahoo.com>
1638 Copyright © 2000 by Simon White
1639 Copyright © 2001-2002 by Jarno Paananen
1640 Copyright © 2004 Dag Lem <resid@nimrod.no>
1641
1642 This program is free software; you can redistribute it and/or modify
1643 it under the terms of the GNU General Public License as published by
1644 the Free Software Foundation; either version 2 of the License, or
1645 (at your option) any later version.
1646
1647 This program is distributed in the hope that it will be useful,
1648 but WITHOUT ANY WARRANTY; without even the implied warranty of
1649 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1650 GNU General Public License for more details.
1651
1652 You should have received a copy of the GNU General Public License
1653 along with this program. If not, see <http://www.gnu.org/licenses/>.
1654
1655Xbox ADPCM audio codec
1656<http://www.winamp.com/plugins/details/147392>
1657
1658 Copyright © Luigi Auriemma
1659
1660 This program is free software; you can redistribute it and/or modify
1661 it under the terms of the GNU General Public License as published by
1662 the Free Software Foundation; either version 2 of the License, or
1663 (at your option) any later version.
1664
1665 This program is distributed in the hope that it will be useful,
1666 but WITHOUT ANY WARRANTY; without even the implied warranty of
1667 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1668 GNU General Public License for more details.
1669
1670 You should have received a copy of the GNU General Public License
1671 along with this program. If not, see <http://www.gnu.org/licenses/>.
1672
1673ST-Sound - general "Nostalgic" Computer Sound Emulator
1674<http://leonard.oxg.free.fr>
1675
1676 Copyright © 1995-1999 Arnaud Carré ( http://leonard.oxg.free.fr )
1677
1678 This program is free software; you can redistribute it and/or modify
1679 it under the terms of the GNU General Public License as published by
1680 the Free Software Foundation; either version 2 of the License, or
1681 (at your option) any later version.
1682
1683 This program is distributed in the hope that it will be useful,
1684 but WITHOUT ANY WARRANTY; without even the implied warranty of
1685 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1686 GNU General Public License for more details.
1687
1688 You should have received a copy of the GNU General Public License
1689 along with this program. If not, see <http://www.gnu.org/licenses/>.
1690
1691TiMidity++ - software synthesizer
1692<http://timidity.sourceforge.net/>
1693
1694 Copyright © 1999-2002 Masanao Izumo <mo@goice.co.jp>
1695 Copyright © 1995 Tuukka Toivonen <tt@cgs.fi>
1696
1697 This program is free software; you can redistribute it and/or modify
1698 it under the terms of the GNU General Public License as published by
1699 the Free Software Foundation; either version 2 of the License, or
1700 (at your option) any later version.
1701
1702 This program is distributed in the hope that it will be useful,
1703 but WITHOUT ANY WARRANTY; without even the implied warranty of
1704 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1705 GNU General Public License for more details.
1706
1707 You should have received a copy of the GNU General Public License
1708 along with this program. If not, see <http://www.gnu.org/licenses/>.
1709
1710FFmpeg - complete, cross-platform solution to record, convert and stream audio
1711and video
1712<http://www.ffmpeg.org/>
1713
1714 Copyright © Fabrice Bellard
1715 Copyright © Alex Beregszaszi
1716 Copyright © BERO
1717 Copyright © Mario Brito
1718 Copyright © Ronald Bultje
1719 Copyright © Tim Ferguson
1720 Copyright © Brian Foley
1721 Copyright © Arpad Gereoffy
1722 Copyright © Philip Gladstone
1723 Copyright © Vladimir Gneushev
1724 Copyright © Wolfgang Hesseler
1725 Copyright © Falk Hueffner
1726 Copyright © Zdenek Kabelac
1727 Copyright © Robin Kay
1728 Copyright © Todd Kirby
1729 Copyright © Nick Kurshev
1730 Copyright © Mike Melanson
1731 Copyright © Michael Niedermayer
1732 Copyright © François Revol
1733 Copyright © Roman Shaposhnik
1734 Copyright © Dieter Shirley
1735 Copyright © Juan J. Sierralta
1736 Copyright © Ewald Snel
1737 Copyright © Leon van Stuivenberg
1738 Copyright © Roberto Togni
1739 Copyright © Lionel Ulmer
1740
1741 Falls under two licenses, the LGPL-2.1 and GPL-2.
1742
1743 LGPL-2.1
1744
1745 This library is free software; you can redistribute it and/or
1746 modify it under the terms of the GNU Lesser General Public
1747 License as published by the Free Software Foundation; either
1748 version 2.1 of the License, or (at your option) any later version.
1749
1750 This library is distributed in the hope that it will be useful,
1751 but WITHOUT ANY WARRANTY; without even the implied warranty of
1752 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1753 Lesser General Public License for more details.
1754
1755 You should have received a copy of the GNU Lesser General Public License
1756 along with this program. If not, see <http://www.gnu.org/licenses/>.
1757
1758 GPL-2
1759
1760 This program is free software; you can redistribute it and/or modify
1761 it under the terms of the GNU General Public License as published by
1762 the Free Software Foundation; either version 2 of the License, or
1763 (at your option) any later version.
1764
1765 This program is distributed in the hope that it will be useful,
1766 but WITHOUT ANY WARRANTY; without even the implied warranty of
1767 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1768 GNU General Public License for more details.
1769
1770 You should have received a copy of the GNU General Public License
1771 along with this program. If not, see <http://www.gnu.org/licenses/>.
1772
1773nuttcp - TCP/UDP network testing tool
1774<http://www.lcp.nrl.navy.mil/nuttcp/>
1775
1776 Copyright © 1995-1999 WIDE Project.
1777
1778 Redistribution and use in source and binary forms, with or without
1779 modification, are permitted provided that the following conditions
1780 are met:
1781 1. Redistributions of source code must retain the above copyright
1782 notice, this list of conditions and the following disclaimer.
1783 2. Redistributions in binary form must reproduce the above copyright
1784 notice, this list of conditions and the following disclaimer in the
1785 documentation and/or other materials provided with the distribution.
1786 3. Neither the name of the project nor the names of its contributors
1787 may be used to endorse or promote products derived from this software
1788 without specific prior written permission.
1789
1790 THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1791 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1792 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1793 ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
1794 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1795 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1796 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1797 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1798 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1799 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1800 SUCH DAMAGE.
1801
1802libdvdnav and libdvdread - libraries to read DVDs and navigate DVD menus
1803<http://www.mplayerhq.hu/>
1804
1805 Copyright © 2001-2004 Rich Wareham <richwareham@users.sourceforge.net>
1806 Copyright © 2000, 2001, 2002 H�kan Hjort <d95hjort@dtek.chalmers.se>
1807 Copyright © 1998, 1999 Eric Smith <eric@brouhaha.com>
1808 Copyright © 2001, 2002 Billy Biggs <vektor@dumbterm.net>
1809 Copyright © 2000, 2001 Martin Norb�ck
1810 Copyright © 2000, 2001 Bj�rn Englund
1811
1812 This program is free software; you can redistribute it and/or modify
1813 it under the terms of the GNU General Public License as published by
1814 the Free Software Foundation; either version 2 of the License, or
1815 (at your option) any later version.
1816
1817 This program is distributed in the hope that it will be useful,
1818 but WITHOUT ANY WARRANTY; without even the implied warranty of
1819 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1820 GNU General Public License for more details.
1821
1822 You should have received a copy of the GNU General Public License
1823 along with this program. If not, see <http://www.gnu.org/licenses/>.
1824
1825libdca - free library for decoding DTS Coherent Acoustics streams
1826<http://www.videolan.org/developers/libdca.html>
1827
1828 Copyright © 2004 Gildas Bazin <gbazin@videolan.org>
1829
1830 This program is free software; you can redistribute it and/or modify
1831 it under the terms of the GNU General Public License as published by
1832 the Free Software Foundation; either version 2 of the License, or
1833 (at your option) any later version.
1834
1835 This program is distributed in the hope that it will be useful,
1836 but WITHOUT ANY WARRANTY; without even the implied warranty of
1837 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1838 GNU General Public License for more details.
1839
1840 You should have received a copy of the GNU General Public License
1841 along with this program. If not, see <http://www.gnu.org/licenses/>.
1842
1843libspucc - library that's part of the Xine project
1844<http://www.xine-project.org/home>
1845
1846 Copyright © 2000-2008 the xine project
1847 Copyright © Christian Vogler cvogler@gradient.cis.upenn.edu - December 2001
1848
1849 This program is free software; you can redistribute it and/or modify
1850 it under the terms of the GNU General Public License as published by
1851 the Free Software Foundation; either version 2 of the License, or
1852 (at your option) any later version.
1853
1854 This program is distributed in the hope that it will be useful,
1855 but WITHOUT ANY WARRANTY; without even the implied warranty of
1856 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1857 GNU General Public License for more details.
1858
1859 You should have received a copy of the GNU General Public License
1860 along with this program. If not, see <http://www.gnu.org/licenses/>.
1861
1862libmpeg2 - a free MPEG-2 video stream decoder
1863<http://libmpeg2.sourceforge.net/>
1864
1865 Copyright © 2000-2004 Michel Lespinasse <walken@zoy.org>
1866 Copyright © 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
1867
1868 This program is free software; you can redistribute it and/or modify
1869 it under the terms of the GNU General Public License as published by
1870 the Free Software Foundation; either version 2 of the License, or
1871 (at your option) any later version.
1872
1873 This program is distributed in the hope that it will be useful,
1874 but WITHOUT ANY WARRANTY; without even the implied warranty of
1875 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1876 GNU General Public License for more details.
1877
1878 You should have received a copy of the GNU General Public License
1879 along with this program. If not, see <http://www.gnu.org/licenses/>.
1880
1881libdvdcss - library designed for accessing encrypted DVDs
1882<http://www.videolan.org/developers/libdvdcss.html>
1883
1884 Copyright © 1999-2001 VideoLAN
1885
1886 This program is free software; you can redistribute it and/or modify
1887 it under the terms of the GNU General Public License as published by
1888 the Free Software Foundation; either version 2 of the License, or
1889 (at your option) any later version.
1890
1891 This program is distributed in the hope that it will be useful,
1892 but WITHOUT ANY WARRANTY; without even the implied warranty of
1893 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1894 GNU General Public License for more details.
1895
1896 You should have received a copy of the GNU General Public License
1897 along with this program. If not, see <http://www.gnu.org/licenses/>.
1898
1899Sample frequency change classes
1900
1901 Copyright © Spoon (www.dbpoweramp.com) March 2002 dbpoweramp@dbpoweramp.com
1902
1903 The code is based on original SSRC by Naoki Shibata
1904 <http://shibatch.sourceforge.net/
1905
1906 This library is free software; you can redistribute it and/or
1907 modify it under the terms of the GNU Lesser General Public
1908 License as published by the Free Software Foundation; either
1909 version 2.1 of the License, or (at your option) any later version.
1910
1911 This library is distributed in the hope that it will be useful,
1912 but WITHOUT ANY WARRANTY; without even the implied warranty of
1913 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1914 Lesser General Public License for more details.
1915
1916 You should have received a copy of the GNU Lesser General Public License
1917 along with this program. If not, see <http://www.gnu.org/licenses/>.
1918
1919Kodi-xrandr.c
1920
1921 Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
1922 Copyright © 2002 Hewlett Packard Company, Inc.
1923 Copyright © 2006 Intel Corporation
1924
1925 Permission to use, copy, modify, distribute, and sell this software and its
1926 documentation for any purpose is hereby granted without fee, provided that
1927 the above copyright notice appear in all copies and that both that copyright
1928 notice and this permission notice appear in supporting documentation, and
1929 that the name of the copyright holders not be used in advertising or
1930 publicity pertaining to distribution of the software without specific,
1931 written prior permission. The copyright holders make no representations
1932 about the suitability of this software for any purpose. It is provided "as
1933 is" without express or implied warranty.
1934
1935 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1936 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1937 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1938 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1939 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1940 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
1941 OF THIS SOFTWARE.
1942
1943Kodi/Crc32.cpp and Kodi/Crc32.h
1944
1945 Copyright (C) 2005-2009 Team Kodi
1946 http://kodi.tv
1947
1948 This program is free software; you can redistribute it and/or modify
1949 it under the terms of the GNU General Public License as published by
1950 the Free Software Foundation; either version 2 of the License, or
1951 (at your option) any later version.
1952
1953 This program is distributed in the hope that it will be useful,
1954 but WITHOUT ANY WARRANTY; without even the implied warranty of
1955 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1956 GNU General Public License for more details.
1957
1958 You should have received a copy of the GNU General Public License
1959 along with this program. If not, see <http://www.gnu.org/licenses/>.
1960
1961 Portion of this code was taken from efone.
1962 efone - Distributed internet phone system.
1963
1964 (c) 1999,2000 Krzysztof Dabrowski
1965 (c) 1999,2000 ElysiuM deeZine
1966
1967 This program is free software; you can redistribute it and/or
1968 modify it under the terms of the GNU General Public License
1969 as published by the Free Software Foundation; either version
1970 2 of the License, or (at your option) any later version.
1971
1972 based on implementation by Finn Yannick Jacobs
1973
1974guilib/AnimatedGif.cpp and guilib/AnimatedGif.h
1975
1976 Copyright (c) 2000, Juan Soulie <jsoulie@cplusplus.com>
1977
1978 Permission to use, copy, modify, distribute and sell this software or any
1979 part thereof and/or its documentation for any purpose is granted without fee
1980 provided that the above copyright notice and this permission notice appear
1981 in all copies.
1982
1983 This software is provided "as is" without express or implied warranty of
1984 any kind. The author shall have no liability with respect to the
1985 infringement of copyrights or patents that any modification to the content
1986 of this file or this file itself may incur.
1987
1988json-cpp - lightweight data-interchange format
1989<http://jsoncpp.sourceforge.net/>
1990
1991 Author is Baptiste Lepilleur <blep@users.sourceforge.net>
1992
1993 The json-cpp library and this documentation are in Public Domain.
1994
1995Crystal HD
1996<http://www.broadcom.com/support/crystal_hd/>
1997
1998 Copyright(c) 2006-2009 Broadcom Corporation.
1999
2000 The Crystal HD library is free software: you can redistribute it and/or
2001 modify it under the terms of the GNU Lesser General Public License as
2002 published by the Free Software Foundation, version 2.1 of the License.
2003
2004 The Crystal HD library is distributed in the hope that it will be useful,
2005 but WITHOUT ANY WARRANTY; without even the implied warranty of
2006 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2007 GNU Lesser General Public License for more details.
2008 You should have received a copy of the GNU Lesser General Public License
2009 along with this header. If not, see <http://www.gnu.org/licenses/>.
2010
2011 The Crystal HD driver is free software; you can redistribute it and/or
2012 modify it under the terms of the GNU General Public License as published by
2013 the Free Software Foundation, version 2 of the License.
2014
2015 The Crystal HD driver is distributed in the hope that it will be useful,
2016 but WITHOUT ANY WARRANTY; without even the implied warranty of
2017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2018 GNU General Public License for more details.
2019
2020 You should have received a copy of the GNU General Public License
2021 along with this driver. If not, see <http://www.gnu.org/licenses/>.
2022
2023OpenSSH
2024<http://www.openssh.org/>
2025
2026 Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
2027 All rights reserved.
2028
2029 See the section 'License: OpenSSH' for full license terms.
2030
2031Enca - Extremely Naive Charset Analyser
2032<http://freshmeat.net/projects/enca/>
2033
2034 Copyright (C) 2000-2003 David Necas (Yeti) <yeti@physics.muni.cz>
2035 Copyright (C) 2009 Michal Cihar <michal@cihar.com>
2036
2037 This program is free software; you can redistribute it and/or modify it
2038 under the terms of version 2 of the GNU General Public License as published
2039 by the Free Software Foundation.
2040
2041 This program is distributed in the hope that it will be useful, but WITHOUT
2042 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2043 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
2044 more details.
2045
2046 You should have received a copy of the GNU General Public License
2047 along with this program. If not, see <http://www.gnu.org/licenses/>.
2048
2049C-Pluff - a plug-in framework for C
2050<http://www.c-pluff.org/>
2051
2052 Copyright 2007 Johannes Lehtinen
2053
2054 Permission is hereby granted, free of charge, to any person obtaining a
2055 copy of this software and associated documentation files (the "Software"),
2056 to deal in the Software without restriction, including without limitation
2057 the rights to use, copy, modify, merge, publish, distribute, sublicense,
2058 and/or sell copies of the Software, and to permit persons to whom the
2059 Software is furnished to do so, subject to the following conditions:
2060
2061 The above copyright notice and this permission notice shall be included
2062 in all copies or substantial portions of the Software.
2063
2064 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2065 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2066 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2067 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2068 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2069 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2070 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2071
2072 C-Pluff uses data structure implementations from Kazlib library.
2073
2074 KazLib copyright and license
2075 ----------------------------
2076
2077 Hash Table Data Type
2078 List Abstract Data Type
2079 Copyright (C) 1997 Kaz Kylheku <kaz@ashi.footprints.net>
2080
2081 Free Software License:
2082
2083 All rights are reserved by the author, with the following exceptions:
2084 Permission is granted to freely reproduce and distribute this software,
2085 possibly in exchange for a fee, provided that this copyright notice appears
2086 intact. Permission is also granted to adapt this software to produce
2087 derivative works, as long as the modified versions carry this copyright
2088 notice and additional notices stating that the work has been modified.
2089 This source code may be translated into executable form and incorporated
2090 into proprietary software; there is no requirement for such software to
2091 contain a copyright notice related to this source.
2092
2093J2ME Event Client
2094
2095 Copyright (c) 2008 topfs2
2096
2097 This program is free software; you can redistribute it and/or modify
2098 it under the terms of the GNU General Public License as published by
2099 the Free Software Foundation; either version 2 of the License, or
2100 (at your option) any later version.
2101
2102 This program is distributed in the hope that it will be useful,
2103 but WITHOUT ANY WARRANTY; without even the implied warranty of
2104 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2105 GNU General Public License for more details.
2106
2107 You should have received a copy of the GNU General Public License
2108 along with this program. If not, see <http://www.gnu.org/licenses/>.
2109
2110OSXRemote Client
2111
2112 Created by Stephan Diederich.
2113 Copyright 2008 University Heidelberg. All rights reserved.
2114
2115 This program is free software: you can redistribute it and/or modify
2116 it under the terms of the GNU General Public License as published by
2117 the Free Software Foundation, either version 3 of the License, or
2118 (at your option) any later version.
2119
2120 This program is distributed in the hope that it will be useful,
2121 but WITHOUT ANY WARRANTY; without even the implied warranty of
2122 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2123 GNU General Public License for more details.
2124
2125 You should have received a copy of the GNU General Public License
2126 along with this program. If not, see <http://www.gnu.org/licenses/>.
2127
2128HIDRemote Classes used by OSXRemote Client
2129
2130 Copyright (c) 2007-2009 IOSPIRIT GmbH (http://www.iospirit.com/)
2131 All rights reserved.
2132
2133 Redistribution and use in source and binary forms, with or without
2134 modification, are permitted provided that the following conditions are met:
2135
2136 * Redistributions of source code must retain the above copyright notice,
2137 this list of conditions and the following disclaimer.
2138
2139 * Redistributions in binary form must reproduce the above copyright notice,
2140 this list of conditions and the following disclaimer in the documentation
2141 and/or other materials provided with the distribution.
2142
2143 * Neither the name of IOSPIRIT GmbH nor the names of its contributors may be
2144 used to endorse or promote products derived from this software without
2145 specific prior written permission.
2146
2147 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2148 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2149 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2150 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2151 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2152 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2153 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2154 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2155 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2156 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2157 POSSIBILITY OF SUCH DAMAGE.
2158
2159Implementation of POSIX directory browsing functions and types for Win32.
2160
2161 Copyright Kevlin Henney, 1997, 2003. All rights reserved.
2162
2163 Permission to use, copy, modify, and distribute this software and its
2164 documentation for any purpose is hereby granted without fee, provided
2165 that this copyright and permissions notice appear in all copies and
2166 derivatives.
2167
2168 This software is supplied "as is" without express or implied warranty.
2169
2170 But that said, if there are any problems please get in touch.
2171
2172Bitstream Vera Fonts
2173
2174 Copyright (C) 2003 Bitstream, Inc.
2175 All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
2176
2177 Permission is hereby granted, free of charge, to any person obtaining a
2178 copy of the fonts accompanying this license ("Fonts") and associated
2179 documentation files (the "Font Software"), to reproduce and distribute
2180 the Font Software, including without limitation the rights to use, copy,
2181 merge, publish, distribute, and/or sell copies of the Font Software, and
2182 to permit persons to whom the Font Software is furnished to do so,
2183 subject to the following conditions:
2184
2185 The above copyright and trademark notices and this permission notice
2186 shall be included in all copies of one or more of the Font Software
2187 typefaces.
2188
2189 The Font Software may be modified, altered, or added to, and in
2190 particular the designs of glyphs or characters in the Fonts may be
2191 modified and additional glyphs or characters may be added to the Fonts,
2192 only if the fonts are renamed to names not containing either the words
2193 "Bitstream" or the word "Vera".
2194
2195 This License becomes null and void to the extent applicable to Fonts or
2196 Font Software that has been modified and is distributed under the
2197 "Bitstream Vera" names.
2198
2199 The Font Software may be sold as part of a larger software package but
2200 no copy of one or more of the Font Software typefaces may be sold by
2201 itself.
2202
2203 THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2204 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
2205 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
2206 COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
2207 BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
2208 OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
2209 OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2210 OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
2211 SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
2212
2213 Except as contained in this notice, the names of Gnome, the Gnome
2214 Foundation, and Bitstream Inc., shall not be used in advertising or
2215 otherwise to promote the sale, use or other dealings in this Font
2216 Software without prior written authorization from the Gnome Foundation
2217 or Bitstream Inc., respectively. For further information, contact:
2218 <fonts@gnome.org>.
2219
2220DejaVu Fonts
2221
2222 Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
2223 Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
2224 Bitstream Vera Fonts Copyright
2225 ------------------------------
2226 Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
2227 a trademark of Bitstream, Inc.
2228 Permission is hereby granted, free of charge, to any person obtaining a copy
2229 of the fonts accompanying this license ("Fonts") and associated
2230 documentation files (the "Font Software"), to reproduce and distribute the
2231 Font Software, including without limitation the rights to use, copy, merge,
2232 publish, distribute, and/or sell copies of the Font Software, and to permit
2233 persons to whom the Font Software is furnished to do so, subject to the
2234 following conditions:
2235 The above copyright and trademark notices and this permission notice shall
2236 be included in all copies of one or more of the Font Software typefaces.
2237 The Font Software may be modified, altered, or added to, and in particular
2238 the designs of glyphs or characters in the Fonts may be modified and
2239 additional glyphs or characters may be added to the Fonts, only if the fonts
2240 are renamed to names not containing either the words "Bitstream" or the word
2241 "Vera".
2242 This License becomes null and void to the extent applicable to Fonts or Font
2243 Software that has been modified and is distributed under the "Bitstream
2244 Vera" names.
2245 The Font Software may be sold as part of a larger software package but no
2246 copy of one or more of the Font Software typefaces may be sold by itself.
2247 THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2248 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
2249 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
2250 TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
2251 FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
2252 ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
2253 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
2254 THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
2255 FONT SOFTWARE.
2256 Except as contained in this notice, the names of Gnome, the Gnome
2257 Foundation, and Bitstream Inc., shall not be used in advertising or
2258 otherwise to promote the sale, use or other dealings in this Font Software
2259 without prior written authorization from the Gnome Foundation or Bitstream
2260 Inc., respectively. For further information, contact: fonts at gnome dot
2261 org.
2262 Arev Fonts Copyright
2263 ------------------------------
2264 Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
2265 Permission is hereby granted, free of charge, to any person obtaining
2266 a copy of the fonts accompanying this license ("Fonts") and
2267 associated documentation files (the "Font Software"), to reproduce
2268 and distribute the modifications to the Bitstream Vera Font Software,
2269 including without limitation the rights to use, copy, merge, publish,
2270 distribute, and/or sell copies of the Font Software, and to permit
2271 persons to whom the Font Software is furnished to do so, subject to
2272 the following conditions:
2273 The above copyright and trademark notices and this permission notice
2274 shall be included in all copies of one or more of the Font Software
2275 typefaces.
2276 The Font Software may be modified, altered, or added to, and in
2277 particular the designs of glyphs or characters in the Fonts may be
2278 modified and additional glyphs or characters may be added to the
2279 Fonts, only if the fonts are renamed to names not containing either
2280 the words "Tavmjong Bah" or the word "Arev".
2281 This License becomes null and void to the extent applicable to Fonts
2282 or Font Software that has been modified and is distributed under the
2283 "Tavmjong Bah Arev" names.
2284 The Font Software may be sold as part of a larger software package but
2285 no copy of one or more of the Font Software typefaces may be sold by
2286 itself.
2287 THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2288 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
2289 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
2290 OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
2291 TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2292 INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
2293 DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2294 FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
2295 OTHER DEALINGS IN THE FONT SOFTWARE.
2296 Except as contained in this notice, the name of Tavmjong Bah shall not
2297 be used in advertising or otherwise to promote the sale, use or other
2298 dealings in this Font Software without prior written authorization
2299 from Tavmjong Bah. For further information, contact: tavmjong @ free
2300
2301SlingboxLib - Library to communicate with Slingbox devices
2302<http://www.stonyx.com>
2303
2304 Copyright (C) 2010-2011 Stonyx
2305
2306 This library is free software. You can redistribute it and/or modify it
2307 under the terms of the GNU General Public License Version 2 (or at your
2308 option any later version) as published by The Free Software Foundation.
2309
2310 This library is distributed in the hope that it will be useful, but
2311 WITHOUT ANY WARRANTY; without even the implied warranty of
2312 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2313 General Public License for more details.
2314
2315 You should have received a copy of the GNU General Public License
2316 along with this program. If not, see <http://www.gnu.org/licenses/>.
2317
2318ASAP (Another Slight Atari Player)
2319<http://asap.sourceforge.net>
2320
2321 Copyright (C) 2005-2009 Piotr Fusik
2322
2323 ASAP is free software; you can redistribute it and/or modify it
2324 under the terms of the GNU General Public License as published
2325 by the Free Software Foundation; either version 2 of the License,
2326 or (at your option) any later version.
2327
2328 ASAP is distributed in the hope that it will be useful,
2329 but WITHOUT ANY WARRANTY; without even the implied warranty
2330 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2331 See the GNU General Public License for more details.
2332
2333 You should have received a copy of the GNU General Public License
2334 along with this program. If not, see <http://www.gnu.org/licenses/>.
2335
2336CMyth - C library for communicating with MythTv server
2337<http://www.mvpmc.org>
2338
2339 Copyright (C) 2004-2006, Eric Lund, Jon Gettler
2340
2341 This library is free software; you can redistribute it and/or
2342 modify it under the terms of the GNU Lesser General Public
2343 License as published by the Free Software Foundation; either
2344 version 2.1 of the License, or (at your option) any later version.
2345
2346 This library is distributed in the hope that it will be useful,
2347 but WITHOUT ANY WARRANTY; without even the implied warranty of
2348 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2349 Lesser General Public License for more details.
2350
2351 You should have received a copy of the GNU Lesser General Public License
2352 along with this program. If not, see <http://www.gnu.org/licenses/>.
2353
2354libapetag - Library for manipulating APE tags.
2355<http://src.gnu-darwin.org/ports/audio/easytag/work/easytag-2.1/src/libapetag/>
2356
2357 Copyright (c) 2002 Artur Polaczynski (Ar't) All rights reserved.
2358
2359 This program is free software; you can redistribute it and/or modify
2360 it under the terms of the GNU Lesser General Public License as
2361 published by the Free Software Foundation; either version 2.1
2362 of the License, or (at your option) any later version.
2363
2364 This program is distributed in the hope that it will be useful,
2365 but WITHOUT ANY WARRANTY; without even the implied warranty of
2366 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2367 GNU Lesser General Public License for more details.
2368
2369 You should have received a copy of the GNU Lesser General Public License
2370 along with this program. If not, see <http://www.gnu.org/licenses/>.
2371
2372libbluray - Blu-ray disc playback support library
2373
2374 Copyright (C) 2010, hpi1
2375 Copyright (C) 2010, fraxinas
2376 Copyright (C) 2010, John Stebbins
2377 Copyright (C) 2010, Joakim
2378 Copyright (C) 2010, Obliter0n
2379 Copyright (C) 2010, William Hahne
2380
2381 This library is free software; you can redistribute it and/or
2382 modify it under the terms of the GNU Lesser General Public
2383 License as published by the Free Software Foundation; either
2384 version 2.1 of the License, or (at your option) any later version.
2385
2386 This library is distributed in the hope that it will be useful,
2387 but WITHOUT ANY WARRANTY; without even the implied warranty of
2388 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2389 Lesser General Public License for more details.
2390
2391 You should have received a copy of the GNU Lesser General Public License
2392 along with this library. If not, see <http://www.gnu.org/licenses/>.
2393
2394libexif - library to parse EXIF files
2395
2396 Copyright (C) 2001-2009, Lutz Müller <urc8@rz.uni-karlsruhe.de>
2397 Copyright (C) 2004-2009, Jan Patera <patera@users.sourceforge.net>
2398 Copyright (C) 2004, Joerg Hoh<joerg@devone.org>
2399 Copyright (C) 2005-2006, Hubert Figuiere <hub@figuiere.net>
2400 Copyright (C) 2002-2005, Hans Ulrich Niedermann <gp@n-dimensional.de>
2401 Copyright (C) 2007-2010, Dan Fandrich <dan@coneharvesters.com>
2402
2403 This library is free software; you can redistribute it and/or
2404 modify it under the terms of the GNU Lesser General Public
2405 License as published by the Free Software Foundation; either
2406 version 2.1 of the License, or (at your option) any later version.
2407
2408 This library is distributed in the hope that it will be useful,
2409 but WITHOUT ANY WARRANTY; without even the implied warranty of
2410 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2411 Lesser General Public License for more details.
2412
2413 You should have received a copy of the GNU Lesser General Public License
2414 along with this library. If not, see <http://www.gnu.org/licenses/>.
2415
2416libnfs - NFS client library
2417
2418 Copyright (C) 2010-2011 Ronnie Sahlberg <ronniesahlberg@gmail.com>
2419
2420 This library is free software; you can redistribute it and/or
2421 modify it under the terms of the GNU Lesser General Public
2422 License as published by the Free Software Foundation; either
2423 version 2.1 of the License, or (at your option) any later version.
2424
2425 This library is distributed in the hope that it will be useful,
2426 but WITHOUT ANY WARRANTY; without even the implied warranty of
2427 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2428 Lesser General Public License for more details.
2429
2430 You should have received a copy of the GNU Lesser General Public License
2431 along with this library. If not, see <http://www.gnu.org/licenses/>.
2432
2433librtmp - toolkit for RTMP streams
2434
2435 Copyright (C) 2009 Andrej Stepanchuk
2436 Copyright (C) 2009-2010 Howard Chu
2437
2438 This program is free software; you can redistribute it and/or modify
2439 it under the terms of the GNU General Public License as published by
2440 the Free Software Foundation; either version 2 of the License, or
2441 (at your option) any later version.
2442
2443 This program is distributed in the hope that it will be useful,
2444 but WITHOUT ANY WARRANTY; without even the implied warranty of
2445 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2446 GNU General Public License for more details.
2447
2448 You should have received a copy of the GNU General Public License
2449 along with this program. If not, see <http://www.gnu.org/licenses/>.
2450
2451libsquish - Open source DXT compression library
2452
2453 Copyright (C) 2006 Simon Brown <si@sjbrown.co.uk>
2454
2455 Permission is hereby granted, free of charge, to any person obtaining
2456 a copy of this software and associated documentation files (the
2457 "Software"), to deal in the Software without restriction, including
2458 without limitation the rights to use, copy, modify, merge, publish,
2459 distribute, sublicense, and/or sell copies of the Software, and to
2460 permit persons to whom the Software is furnished to do so, subject to
2461 the following conditions:
2462
2463 The above copyright notice and this permission notice shall be included
2464 in all copies or substantial portions of the Software.
2465
2466 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2467 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2468 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2469 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2470 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2471 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2472 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2473
2474LZO Library - LZO real-time data compression library
2475
2476 Copyright (C) 1996-1997 Markus Franz Xaver Johannes Oberhumer
2477
2478 The LZO library is free software; you can redistribute it and/or
2479 modify it under the terms of the GNU General Public License as
2480 published by the Free Software Foundation; either version 2 of
2481 the License, or (at your option) any later version.
2482
2483 The LZO library is distributed in the hope that it will be useful,
2484 but WITHOUT ANY WARRANTY; without even the implied warranty of
2485 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2486 GNU General Public License for more details.
2487
2488 You should have received a copy of the GNU General Public License
2489 along with this program. If not, see <http://www.gnu.org/licenses/>.
2490
2491Licenses:
2492
2493License: GPL
2494
2495A copy of the GPL can be found on Debian systems at
2496/usr/share/common-licenses/GPL.
2497
2498License: LGPL
2499
2500A copy of the LGPL can be found on Debian systems at
2501/usr/share/common-licenses/LGPL.
2502
2503License: FTL
2504 The FreeType Project LICENSE
2505 ----------------------------
2506
2507 2006-Jan-27
2508
2509 Copyright 1996-2002, 2006 by
2510 David Turner, Robert Wilhelm, and Werner Lemberg
2511
2512
2513
2514Introduction
2515============
2516
2517 The FreeType Project is distributed in several archive packages;
2518 some of them may contain, in addition to the FreeType font engine,
2519 various tools and contributions which rely on, or relate to, the
2520 FreeType Project.
2521
2522 This license applies to all files found in such packages, and
2523 which do not fall under their own explicit license. The license
2524 affects thus the FreeType font engine, the test programs,
2525 documentation and makefiles, at the very least.
2526
2527 This license was inspired by the BSD, Artistic, and IJG
2528 (Independent JPEG Group) licenses, which all encourage inclusion
2529 and use of free software in commercial and freeware products
2530 alike. As a consequence, its main points are that:
2531
2532 o We don't promise that this software works. However, we will be
2533 interested in any kind of bug reports. (`as is' distribution)
2534
2535 o You can use this software for whatever you want, in parts or
2536 full form, without having to pay us. (`royalty-free' usage)
2537
2538 o You may not pretend that you wrote this software. If you use
2539 it, or only parts of it, in a program, you must acknowledge
2540 somewhere in your documentation that you have used the
2541 FreeType code. (`credits')
2542
2543 We specifically permit and encourage the inclusion of this
2544 software, with or without modifications, in commercial products.
2545 We disclaim all warranties covering The FreeType Project and
2546 assume no liability related to The FreeType Project.
2547
2548
2549 Finally, many people asked us for a preferred form for a
2550 credit/disclaimer to use in compliance with this license. We thus
2551 encourage you to use the following text:
2552
2553 """
2554 Portions of this software are copyright © <year> The FreeType
2555 Project (www.freetype.org). All rights reserved.
2556 """
2557
2558 Please replace <year> with the value from the FreeType version you
2559 actually use.
2560
2561
2562Legal Terms
2563===========
2564
25650. Definitions
2566--------------
2567
2568 Throughout this license, the terms `package', `FreeType Project',
2569 and `FreeType archive' refer to the set of files originally
2570 distributed by the authors (David Turner, Robert Wilhelm, and
2571 Werner Lemberg) as the `FreeType Project', be they named as alpha,
2572 beta or final release.
2573
2574 `You' refers to the licensee, or person using the project, where
2575 `using' is a generic term including compiling the project's source
2576 code as well as linking it to form a `program' or `executable'.
2577 This program is referred to as `a program using the FreeType
2578 engine'.
2579
2580 This license applies to all files distributed in the original
2581 FreeType Project, including all source code, binaries and
2582 documentation, unless otherwise stated in the file in its
2583 original, unmodified form as distributed in the original archive.
2584 If you are unsure whether or not a particular file is covered by
2585 this license, you must contact us to verify this.
2586
2587 The FreeType Project is copyright (C) 1996-2000 by David Turner,
2588 Robert Wilhelm, and Werner Lemberg. All rights reserved except as
2589 specified below.
2590
25911. No Warranty
2592--------------
2593
2594 THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
2595 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
2596 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2597 PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
2598 BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
2599 USE, OF THE FREETYPE PROJECT.
2600
26012. Redistribution
2602-----------------
2603
2604 This license grants a worldwide, royalty-free, perpetual and
2605 irrevocable right and license to use, execute, perform, compile,
2606 display, copy, create derivative works of, distribute and
2607 sublicense the FreeType Project (in both source and object code
2608 forms) and derivative works thereof for any purpose; and to
2609 authorize others to exercise some or all of the rights granted
2610 herein, subject to the following conditions:
2611
2612 o Redistribution of source code must retain this license file
2613 (`FTL.TXT') unaltered; any additions, deletions or changes to
2614 the original files must be clearly indicated in accompanying
2615 documentation. The copyright notices of the unaltered,
2616 original files must be preserved in all copies of source
2617 files.
2618
2619 o Redistribution in binary form must provide a disclaimer that
2620 states that the software is based in part of the work of the
2621 FreeType Team, in the distribution documentation. We also
2622 encourage you to put an URL to the FreeType web page in your
2623 documentation, though this isn't mandatory.
2624
2625 These conditions apply to any software derived from or based on
2626 the FreeType Project, not just the unmodified files. If you use
2627 our work, you must acknowledge us. However, no fee need be paid
2628 to us.
2629
26303. Advertising
2631--------------
2632
2633 Neither the FreeType authors and contributors nor you shall use
2634 the name of the other for commercial, advertising, or promotional
2635 purposes without specific prior written permission.
2636
2637 We suggest, but do not require, that you use one or more of the
2638 following phrases to refer to this software in your documentation
2639 or advertising materials: `FreeType Project', `FreeType Engine',
2640 `FreeType library', or `FreeType Distribution'.
2641
2642 As you have not signed this license, you are not required to
2643 accept it. However, as the FreeType Project is copyrighted
2644 material, only this license, or another one contracted with the
2645 authors, grants you the right to use, distribute, and modify it.
2646 Therefore, by using, distributing, or modifying the FreeType
2647 Project, you indicate that you understand and accept all the terms
2648 of this license.
2649
26504. Contacts
2651-----------
2652
2653 There are two mailing lists related to FreeType:
2654
2655 o freetype@nongnu.org
2656
2657 Discusses general use and applications of FreeType, as well as
2658 future and wanted additions to the library and distribution.
2659 If you are looking for support, start in this list if you
2660 haven't found anything to help you in the documentation.
2661
2662 o freetype-devel@nongnu.org
2663
2664 Discusses bugs, as well as engine internals, design issues,
2665 specific licenses, porting, etc.
2666
2667 Our home page can be found at
2668
2669 http://www.freetype.org
2670
2671
2672--- end of FTL ---
2673
2674License: PSF License for Python 2.4
2675
2676A. HISTORY OF THE SOFTWARE
2677==========================
2678
2679Python was created in the early 1990s by Guido van Rossum at Stichting
2680Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
2681as a successor of a language called ABC. Guido remains Python's
2682principal author, although it includes many contributions from others.
2683
2684In 1995, Guido continued his work on Python at the Corporation for
2685National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
2686in Reston, Virginia where he released several versions of the
2687software.
2688
2689In May 2000, Guido and the Python core development team moved to
2690BeOpen.com to form the BeOpen PythonLabs team. In October of the same
2691year, the PythonLabs team moved to Digital Creations (now Zope
2692Corporation, see http://www.zope.com). In 2001, the Python Software
2693Foundation (PSF, see http://www.python.org/psf/) was formed, a
2694non-profit organization created specifically to own Python-related
2695Intellectual Property. Zope Corporation is a sponsoring member of
2696the PSF.
2697
2698All Python releases are Open Source (see http://www.opensource.org for
2699the Open Source Definition). Historically, most, but not all, Python
2700releases have also been GPL-compatible; the table below summarizes
2701the various releases.
2702
2703 Release Derived Year Owner GPL-
2704 from compatible? (1)
2705
2706 0.9.0 thru 1.2 1991-1995 CWI yes
2707 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
2708 1.6 1.5.2 2000 CNRI no
2709 2.0 1.6 2000 BeOpen.com no
2710 1.6.1 1.6 2001 CNRI yes (2)
2711 2.1 2.0+1.6.1 2001 PSF no
2712 2.0.1 2.0+1.6.1 2001 PSF yes
2713 2.1.1 2.1+2.0.1 2001 PSF yes
2714 2.2 2.1.1 2001 PSF yes
2715 2.1.2 2.1.1 2002 PSF yes
2716 2.1.3 2.1.2 2002 PSF yes
2717 2.2.1 2.2 2002 PSF yes
2718 2.2.2 2.2.1 2002 PSF yes
2719 2.2.3 2.2.2 2003 PSF yes
2720 2.3 2.2.2 2002-2003 PSF yes
2721 2.3.1 2.3 2002-2003 PSF yes
2722 2.3.2 2.3.1 2002-2003 PSF yes
2723 2.3.3 2.3.2 2002-2003 PSF yes
2724 2.3.4 2.3.3 2004 PSF yes
2725 2.3.5 2.3.4 2005 PSF yes
2726 2.4 2.3 2004 PSF yes
2727 2.4.1 2.4 2005 PSF yes
2728 2.4.2 2.4.1 2005 PSF yes
2729 2.4.3 2.4.2 2006 PSF yes
2730 2.4.4 2.4.3 2006 PSF yes
2731
2732Footnotes:
2733
2734(1) GPL-compatible doesn't mean that we're distributing Python under
2735 the GPL. All Python licenses, unlike the GPL, let you distribute
2736 a modified version without making your changes open source. The
2737 GPL-compatible licenses make it possible to combine Python with
2738 other software that is released under the GPL; the others don't.
2739
2740(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
2741 because its license has a choice of law clause. According to
2742 CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
2743 is "not incompatible" with the GPL.
2744
2745Thanks to the many outside volunteers who have worked under Guido's
2746direction to make these releases possible.
2747
2748
2749B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
2750===============================================================
2751
2752PSF LICENSE AGREEMENT FOR PYTHON 2.4
2753------------------------------------
2754
27551. This LICENSE AGREEMENT is between the Python Software Foundation
2756("PSF"), and the Individual or Organization ("Licensee") accessing and
2757otherwise using Python 2.4 software in source or binary form and its
2758associated documentation.
2759
27602. Subject to the terms and conditions of this License Agreement, PSF
2761hereby grants Licensee a nonexclusive, royalty-free, world-wide
2762license to reproduce, analyze, test, perform and/or display publicly,
2763prepare derivative works, distribute, and otherwise use Python 2.4
2764alone or in any derivative version, provided, however, that PSF's
2765License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
27662001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved"
2767are retained in Python 2.4 alone or in any derivative version prepared
2768by Licensee.
2769
27703. In the event Licensee prepares a derivative work that is based on
2771or incorporates Python 2.4 or any part thereof, and wants to make
2772the derivative work available to others as provided herein, then
2773Licensee hereby agrees to include in any such work a brief summary of
2774the changes made to Python 2.4.
2775
27764. PSF is making Python 2.4 available to Licensee on an "AS IS"
2777basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
2778IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
2779DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
2780FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.4 WILL NOT
2781INFRINGE ANY THIRD PARTY RIGHTS.
2782
27835. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
27842.4 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
2785A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.4,
2786OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
2787
27886. This License Agreement will automatically terminate upon a material
2789breach of its terms and conditions.
2790
27917. Nothing in this License Agreement shall be deemed to create any
2792relationship of agency, partnership, or joint venture between PSF and
2793Licensee. This License Agreement does not grant permission to use PSF
2794trademarks or trade name in a trademark sense to endorse or promote
2795products or services of Licensee, or any third party.
2796
27978. By copying, installing or otherwise using Python 2.4, Licensee
2798agrees to be bound by the terms and conditions of this License
2799Agreement.
2800
2801
2802BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
2803-------------------------------------------
2804
2805BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
2806
28071. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
2808office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
2809Individual or Organization ("Licensee") accessing and otherwise using
2810this software in source or binary form and its associated
2811documentation ("the Software").
2812
28132. Subject to the terms and conditions of this BeOpen Python License
2814Agreement, BeOpen hereby grants Licensee a non-exclusive,
2815royalty-free, world-wide license to reproduce, analyze, test, perform
2816and/or display publicly, prepare derivative works, distribute, and
2817otherwise use the Software alone or in any derivative version,
2818provided, however, that the BeOpen Python License is retained in the
2819Software, alone or in any derivative version prepared by Licensee.
2820
28213. BeOpen is making the Software available to Licensee on an "AS IS"
2822basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
2823IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
2824DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
2825FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
2826INFRINGE ANY THIRD PARTY RIGHTS.
2827
28284. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
2829SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
2830AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
2831DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
2832
28335. This License Agreement will automatically terminate upon a material
2834breach of its terms and conditions.
2835
28366. This License Agreement shall be governed by and interpreted in all
2837respects by the law of the State of California, excluding conflict of
2838law provisions. Nothing in this License Agreement shall be deemed to
2839create any relationship of agency, partnership, or joint venture
2840between BeOpen and Licensee. This License Agreement does not grant
2841permission to use BeOpen trademarks or trade names in a trademark
2842sense to endorse or promote products or services of Licensee, or any
2843third party. As an exception, the "BeOpen Python" logos available at
2844http://www.pythonlabs.com/logos.html may be used according to the
2845permissions granted on that web page.
2846
28477. By copying, installing or otherwise using the software, Licensee
2848agrees to be bound by the terms and conditions of this License
2849Agreement.
2850
2851
2852CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
2853---------------------------------------
2854
28551. This LICENSE AGREEMENT is between the Corporation for National
2856Research Initiatives, having an office at 1895 Preston White Drive,
2857Reston, VA 20191 ("CNRI"), and the Individual or Organization
2858("Licensee") accessing and otherwise using Python 1.6.1 software in
2859source or binary form and its associated documentation.
2860
28612. Subject to the terms and conditions of this License Agreement, CNRI
2862hereby grants Licensee a nonexclusive, royalty-free, world-wide
2863license to reproduce, analyze, test, perform and/or display publicly,
2864prepare derivative works, distribute, and otherwise use Python 1.6.1
2865alone or in any derivative version, provided, however, that CNRI's
2866License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
28671995-2001 Corporation for National Research Initiatives; All Rights
2868Reserved" are retained in Python 1.6.1 alone or in any derivative
2869version prepared by Licensee. Alternately, in lieu of CNRI's License
2870Agreement, Licensee may substitute the following text (omitting the
2871quotes): "Python 1.6.1 is made available subject to the terms and
2872conditions in CNRI's License Agreement. This Agreement together with
2873Python 1.6.1 may be located on the Internet using the following
2874unique, persistent identifier (known as a handle): 1895.22/1013. This
2875Agreement may also be obtained from a proxy server on the Internet
2876using the following URL: http://hdl.handle.net/1895.22/1013".
2877
28783. In the event Licensee prepares a derivative work that is based on
2879or incorporates Python 1.6.1 or any part thereof, and wants to make
2880the derivative work available to others as provided herein, then
2881Licensee hereby agrees to include in any such work a brief summary of
2882the changes made to Python 1.6.1.
2883
28844. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
2885basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
2886IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
2887DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
2888FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
2889INFRINGE ANY THIRD PARTY RIGHTS.
2890
28915. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
28921.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
2893A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
2894OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
2895
28966. This License Agreement will automatically terminate upon a material
2897breach of its terms and conditions.
2898
28997. This License Agreement shall be governed by the federal
2900intellectual property law of the United States, including without
2901limitation the federal copyright law, and, to the extent such
2902U.S. federal law does not apply, by the law of the Commonwealth of
2903Virginia, excluding Virginia's conflict of law provisions.
2904Notwithstanding the foregoing, with regard to derivative works based
2905on Python 1.6.1 that incorporate non-separable material that was
2906previously distributed under the GNU General Public License (GPL), the
2907law of the Commonwealth of Virginia shall govern this License
2908Agreement only as to issues arising under or with respect to
2909Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
2910License Agreement shall be deemed to create any relationship of
2911agency, partnership, or joint venture between CNRI and Licensee. This
2912License Agreement does not grant permission to use CNRI trademarks or
2913trade name in a trademark sense to endorse or promote products or
2914services of Licensee, or any third party.
2915
29168. By clicking on the "ACCEPT" button where indicated, or by copying,
2917installing or otherwise using Python 1.6.1, Licensee agrees to be
2918bound by the terms and conditions of this License Agreement.
2919
2920 ACCEPT
2921
2922
2923CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
2924--------------------------------------------------
2925
2926Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
2927The Netherlands. All rights reserved.
2928
2929Permission to use, copy, modify, and distribute this software and its
2930documentation for any purpose and without fee is hereby granted,
2931provided that the above copyright notice appear in all copies and that
2932both that copyright notice and this permission notice appear in
2933supporting documentation, and that the name of Stichting Mathematisch
2934Centrum or CWI not be used in advertising or publicity pertaining to
2935distribution of the software without specific, written prior
2936permission.
2937
2938STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
2939THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
2940FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
2941FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2942WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
2943ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
2944OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2945
2946-- End of PSF License for Python 2.4 --
2947
2948License: IJG License
2949
2950LEGAL ISSUES
2951============
2952
2953In plain English:
2954
29551. We don't promise that this software works. (But if you find any bugs,
2956 please let us know!)
29572. You can use this software for whatever you want. You don't have to pay us.
29583. You may not pretend that you wrote this software. If you use it in a
2959 program, you must acknowledge somewhere in your documentation that
2960 you've used the IJG code.
2961
2962In legalese:
2963
2964The authors make NO WARRANTY or representation, either express or implied,
2965with respect to this software, its quality, accuracy, merchantability, or
2966fitness for a particular purpose. This software is provided "AS IS", and you,
2967its user, assume the entire risk as to its quality and accuracy.
2968
2969This software is copyright (C) 1991-1998, Thomas G. Lane.
2970All Rights Reserved except as specified below.
2971
2972Permission is hereby granted to use, copy, modify, and distribute this
2973software (or portions thereof) for any purpose, without fee, subject to these
2974conditions:
2975(1) If any part of the source code for this software is distributed, then this
2976README file must be included, with this copyright and no-warranty notice
2977unaltered; and any additions, deletions, or changes to the original files
2978must be clearly indicated in accompanying documentation.
2979(2) If only executable code is distributed, then the accompanying
2980documentation must state that "this software is based in part on the work of
2981the Independent JPEG Group".
2982(3) Permission for use of this software is granted only if the user accepts
2983full responsibility for any undesirable consequences; the authors accept
2984NO LIABILITY for damages of any kind.
2985
2986These conditions apply to any software derived from or based on the IJG code,
2987not just to the unmodified library. If you use our work, you ought to
2988acknowledge us.
2989
2990Permission is NOT granted for the use of any IJG author's name or company name
2991in advertising or publicity relating to this software or products derived from
2992it. This software may be referred to only as "the Independent JPEG Group's
2993software".
2994
2995We specifically permit and encourage the use of this software as the basis of
2996commercial products, provided that all warranty or liability claims are
2997assumed by the product vendor.
2998
2999
3000ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
3001sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
3002ansi2knr.c is NOT covered by the above copyright and conditions, but instead
3003by the usual distribution terms of the Free Software Foundation; principally,
3004that you must include source code if you redistribute it. (See the file
3005ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
3006of any program generated from the IJG code, this does not limit you more than
3007the foregoing paragraphs do.
3008
3009The Unix configuration script "configure" was produced with GNU Autoconf.
3010It is copyright by the Free Software Foundation but is freely distributable.
3011The same holds for its supporting scripts (config.guess, config.sub,
3012ltconfig, ltmain.sh). Another support script, install-sh, is copyright
3013by M.I.T. but is also freely distributable.
3014
3015It appears that the arithmetic coding option of the JPEG spec is covered by
3016patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
3017legally be used without obtaining one or more licenses. For this reason,
3018support for arithmetic coding has been removed from the free JPEG software.
3019(Since arithmetic coding provides only a marginal gain over the unpatented
3020Huffman mode, it is unlikely that very many implementations will support it.)
3021So far as we are aware, there are no patent restrictions on the remaining
3022code.
3023
3024The IJG distribution formerly included code to read and write GIF files.
3025To avoid entanglement with the Unisys LZW patent, GIF reading support has
3026been removed altogether, and the GIF writer has been simplified to produce
3027"uncompressed GIFs". This technique does not use the LZW algorithm; the
3028resulting GIF files are larger than usual, but are readable by all standard
3029GIF decoders.
3030
3031We are required to state that
3032 "The Graphics Interchange Format(c) is the Copyright property of
3033 CompuServe Incorporated. GIF(sm) is a Service Mark property of
3034 CompuServe Incorporated."
3035
3036-- End of IJG License --
3037
3038License: OpenSSH
3039
3040This file is part of the OpenSSH software.
3041
3042The licences which components of this software fall under are as
3043follows. First, we will summarize and say that all components
3044are under a BSD licence, or a licence more free than that.
3045
3046OpenSSH contains no GPL code.
3047
30481)
3049 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
3050 * All rights reserved
3051 *
3052 * As far as I am concerned, the code I have written for this software
3053 * can be used freely for any purpose. Any derived versions of this
3054 * software must be clearly marked as such, and if the derived work is
3055 * incompatible with the protocol description in the RFC file, it must be
3056 * called by a name other than "ssh" or "Secure Shell".
3057
3058 [Tatu continues]
3059 * However, I am not implying to give any licenses to any patents or
3060 * copyrights held by third parties, and the software includes parts that
3061 * are not under my direct control. As far as I know, all included
3062 * source code is used in accordance with the relevant license agreements
3063 * and can be used freely for any purpose (the GNU license being the most
3064 * restrictive); see below for details.
3065
3066 [However, none of that term is relevant at this point in time. All of
3067 these restrictively licenced software components which he talks about
3068 have been removed from OpenSSH, i.e.,
3069
3070 - RSA is no longer included, found in the OpenSSL library
3071 - IDEA is no longer included, its use is deprecated
3072 - DES is now external, in the OpenSSL library
3073 - GMP is no longer used, and instead we call BN code from OpenSSL
3074 - Zlib is now external, in a library
3075 - The make-ssh-known-hosts script is no longer included
3076 - TSS has been removed
3077 - MD5 is now external, in the OpenSSL library
3078 - RC4 support has been replaced with ARC4 support from OpenSSL
3079 - Blowfish is now external, in the OpenSSL library
3080
3081 [The licence continues]
3082
3083 Note that any information and cryptographic algorithms used in this
3084 software are publicly available on the Internet and at any major
3085 bookstore, scientific library, and patent office worldwide. More
3086 information can be found e.g. at "http://www.cs.hut.fi/crypto".
3087
3088 The legal status of this program is some combination of all these
3089 permissions and restrictions. Use only at your own responsibility.
3090 You will be responsible for any legal consequences yourself; I am not
3091 making any claims whether possessing or using this is legal or not in
3092 your country, and I am not taking any responsibility on your behalf.
3093
3094
3095 NO WARRANTY
3096
3097 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3098 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
3099 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3100 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3101 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3102 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
3103 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
3104 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3105 REPAIR OR CORRECTION.
3106
3107 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3108 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3109 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3110 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3111 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3112 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3113 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3114 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3115 POSSIBILITY OF SUCH DAMAGES.
3116
31172)
3118 The 32-bit CRC compensation attack detector in deattack.c was
3119 contributed by CORE SDI S.A. under a BSD-style license.
3120
3121 * Cryptographic attack detector for ssh - source code
3122 *
3123 * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina.
3124 *
3125 * All rights reserved. Redistribution and use in source and binary
3126 * forms, with or without modification, are permitted provided that
3127 * this copyright notice is retained.
3128 *
3129 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
3130 * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE
3131 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR
3132 * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS
3133 * SOFTWARE.
3134 *
3135 * Ariel Futoransky <futo@core-sdi.com>
3136 * <http://www.core-sdi.com>
3137
31383)
3139 ssh-keyscan was contributed by David Mazieres under a BSD-style
3140 license.
3141
3142 * Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
3143 *
3144 * Modification and redistribution in source and binary forms is
3145 * permitted provided that due credit is given to the author and the
3146 * OpenBSD project by leaving this copyright notice intact.
3147
31484)
3149 The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers
3150 and Paulo Barreto is in the public domain and distributed
3151 with the following license:
3152
3153 * @version 3.0 (December 2000)
3154 *
3155 * Optimised ANSI C code for the Rijndael cipher (now AES)
3156 *
3157 * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
3158 * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
3159 * @author Paulo Barreto <paulo.barreto@terra.com.br>
3160 *
3161 * This code is hereby placed in the public domain.
3162 *
3163 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
3164 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
3165 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3166 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
3167 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3168 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3169 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
3170 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3171 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
3172 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
3173 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3174
31755)
3176 One component of the ssh source code is under a 3-clause BSD license,
3177 held by the University of California, since we pulled these parts from
3178 original Berkeley code.
3179
3180 * Copyright (c) 1983, 1990, 1992, 1993, 1995
3181 * The Regents of the University of California. All rights reserved.
3182 *
3183 * Redistribution and use in source and binary forms, with or without
3184 * modification, are permitted provided that the following conditions
3185 * are met:
3186 * 1. Redistributions of source code must retain the above copyright
3187 * notice, this list of conditions and the following disclaimer.
3188 * 2. Redistributions in binary form must reproduce the above copyright
3189 * notice, this list of conditions and the following disclaimer in the
3190 * documentation and/or other materials provided with the distribution.
3191 * 3. Neither the name of the University nor the names of its contributors
3192 * may be used to endorse or promote products derived from this software
3193 * without specific prior written permission.
3194 *
3195 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
3196 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3197 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
3198 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
3199 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3200 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3201 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3202 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3203 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3204 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
3205 * THE POSSIBILITY OF SUCH DAMAGE.
3206
32076)
3208 Remaining components of the software are provided under a standard
3209 2-term BSD licence with the following names as copyright holders:
3210
3211 Markus Friedl
3212 Theo de Raadt
3213 Niels Provos
3214 Dug Song
3215 Aaron Campbell
3216 Damien Miller
3217 Kevin Steves
3218 Daniel Kouril
3219 Wesley Griffin
3220 Per Allansson
3221 Nils Nordman
3222 Simon Wilkinson
3223
3224 * Redistribution and use in source and binary forms, with or without
3225 * modification, are permitted provided that the following conditions
3226 * are met:
3227 * 1. Redistributions of source code must retain the above copyright
3228 * notice, this list of conditions and the following disclaimer.
3229 * 2. Redistributions in binary form must reproduce the above copyright
3230 * notice, this list of conditions and the following disclaimer in the
3231 * documentation and/or other materials provided with the distribution.
3232 *
3233 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
3234 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
3235 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
3236 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3237 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3238 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3239 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3240 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3241 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3242 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3243
3244-- End of OpenSSH License --
diff --git a/project/cmake/cpack/deb/lintian/overrides/kodi b/project/cmake/cpack/deb/lintian/overrides/kodi
new file mode 100644
index 0000000..d9536c4
--- /dev/null
+++ b/project/cmake/cpack/deb/lintian/overrides/kodi
@@ -0,0 +1 @@
kodi: description-starts-with-package-name
diff --git a/project/cmake/cpack/deb/menu/kodi b/project/cmake/cpack/deb/menu/kodi
new file mode 100644
index 0000000..0c221a4
--- /dev/null
+++ b/project/cmake/cpack/deb/menu/kodi
@@ -0,0 +1,2 @@
1?package(kodi):needs="X11" section="Applications/Video" \
2 title="kodi" command="/usr/bin/kodi"
diff --git a/project/cmake/cpack/deb/package-description.txt b/project/cmake/cpack/deb/package-description.txt
new file mode 100644
index 0000000..961e1c8
--- /dev/null
+++ b/project/cmake/cpack/deb/package-description.txt
@@ -0,0 +1,16 @@
1Kodi, formerly known as XBMC Media Center, is an award winning free and open
2source software media-player and entertainment hub for all your digital media.
3Kodi is available for Linux, Mac OS X (Leopard, Tiger and Apple TV) and
4Microsoft Windows, as well as the original Xbox game console. Created in 2003
5by a group of like minded programmers, Kodi is a non-profit project run and
6developed by volunteers located around the world. More than 50 software
7developers have contributed to Kodi, and 100-plus translators have worked to
8expand its reach, making it available in more than 30 languages.
9.
10While Kodi functions very well as a standard media player application for your
11computer, it has been designed to be the perfect companion for your HTPC.
12Supporting an almost endless range of remote controls, and combined with its
13beautiful interface and powerful skinning engine, Kodi feels very natural to
14use from the couch and is the ideal solution for your home theater. Once
15installed, your computer will become a fully functional multimedia jukebox.
16. \ No newline at end of file
diff --git a/project/cmake/cpack/deb/packages/kodi-addon-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-addon-dev.txt.in
new file mode 100644
index 0000000..aebae7e
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-addon-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-addon-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-addon-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS
19PACKAGE_RECOMMENDS @APP_NAME_LC@-audio-dev, @APP_NAME_LC@-inputstream-dev, @APP_NAME_LC@-pvr-dev, @APP_NAME_LC@-screensaver-dev, @APP_NAME_LC@-visualization-dev
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-addon-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (general add-on dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-audio-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-audio-dev.txt.in
new file mode 100644
index 0000000..f03a64d
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-audio-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-audio-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-audio-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-audio-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (audio add-ons dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s audio add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-bin.txt.in b/project/cmake/cpack/deb/packages/kodi-bin.txt.in
new file mode 100644
index 0000000..8ee33d3
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-bin.txt.in
@@ -0,0 +1,25 @@
1# kodi-bin debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-bin
14PACKAGE_ARCHITECTURE
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS libasound2 (>= 1.0.27), libavahi-client3 (>= 0.6.16), libavahi-common3 (>= 0.6.16), libbluetooth3 (>= 4.91), libbz2-1.0, libc6 (>= 2.15), libcdio13 (>= 0.83), libcrossguid1, libdbus-1-3 (>= 1.9.14), libdrm2 (>= 2.4.16), libegl1-mesa (>= 7.8.1) | libegl1-x11, libexpat1 (>= 2.0.1), libfreetype6 (>= 2.2.1), libfribidi0 (>= 0.19.2), libgcc1 (>= 1:3.0), libgl1-mesa-glx | libgl1, libgnutls30 (>= 3.4.2), liblzma5 (>= 5.1.1alpha+20120614), liblzo2-2, libmicrohttpd10 (>= 0.9.20), libmysqlclient20 (>= 5.7.11), libpcre3, libpcrecpp0v5 (>= 7.7), libpulse0 (>= 0.99.4), libpython2.7 (>= 2.7), libsmbclient (>= 2:4.0.3+dfsg1), libsqlite3-0 (>= 3.6.11), libssh-4 (>= 0.6.1), libstdc++6 (>= 5.2), libtag1v5 (>= 1.9.1-2.4ubuntu1), libtinyxml2.6.2v5, libudev1 (>= 183), libva-x11-1 (>= 1.0.3), libva1 (>= 1.4.0), libx11-6, libxext6, libxml2 (>= 2.7.4), libxrandr2 (>= 2:1.2.99.3), libxslt1.1 (>= 1.1.25), libyajl2 (>= 2.0.4), zlib1g (>= 1:1.2.0.2)
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS xbmc-bin (<< 2:14.0~git20141019), xbmc-common
22PACKAGE_REPLACES xbmc-bin (<< 2:14.0~git20141019), xbmc-common
23PACKAGE_PROVIDES @APP_NAME_LC@-bin, @APP_NAME_LC@-common, xbmc-bin, xbmc-common
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (binary data package)
25PACKAGE_DESCRIPTION_FOOTER This package contains @APP_NAME@'s binary data.
diff --git a/project/cmake/cpack/deb/packages/kodi-eventclients-common.txt.in b/project/cmake/cpack/deb/packages/kodi-eventclients-common.txt.in
new file mode 100644
index 0000000..6559842
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-eventclients-common.txt.in
@@ -0,0 +1,25 @@
1# kodi-eventclients-common debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-eventclients-common
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-eventclients-common
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (event client common package)
25PACKAGE_DESCRIPTION_FOOTER This is the common package for @APP_NAME@'s event client.
diff --git a/project/cmake/cpack/deb/packages/kodi-eventclients-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-eventclients-dev.txt.in
new file mode 100644
index 0000000..4b166b5
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-eventclients-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-eventclients-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-eventclients-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@)
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-eventclients-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (event client dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s event client.
diff --git a/project/cmake/cpack/deb/packages/kodi-eventclients-ps3.txt.in b/project/cmake/cpack/deb/packages/kodi-eventclients-ps3.txt.in
new file mode 100644
index 0000000..bd432a2
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-eventclients-ps3.txt.in
@@ -0,0 +1,25 @@
1# kodi-eventclients-ps3 debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-eventclients-ps3
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@), python-bluez | python-lightblue
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-eventclients-ps3
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (PS3 event client package)
25PACKAGE_DESCRIPTION_FOOTER This is the PS3 package for @APP_NAME@'s event client.
diff --git a/project/cmake/cpack/deb/packages/kodi-eventclients-wiiremote.txt.in b/project/cmake/cpack/deb/packages/kodi-eventclients-wiiremote.txt.in
new file mode 100644
index 0000000..5973784
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-eventclients-wiiremote.txt.in
@@ -0,0 +1,25 @@
1# kodi-eventclients-wiiremote debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-eventclients-wiiremote
14PACKAGE_ARCHITECTURE
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@), libbluetooth3 (>= 4.91), libc6 (>= 2.14), libcwiid1 (>= 0.6.00+svn184), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2)
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-eventclients-wiiremote
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (Wii Remote event client package)
25PACKAGE_DESCRIPTION_FOOTER This is the Wii Remote package for @APP_NAME@'s event client.
diff --git a/project/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in b/project/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in
new file mode 100644
index 0000000..0062479
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in
@@ -0,0 +1,25 @@
1# kodi-eventclients-xbmc-send debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-eventclients-xbmc-send
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@)
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-eventclients-xbmc-send
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (@APP_NAME@-send event client package)
25PACKAGE_DESCRIPTION_FOOTER This is the Kodi-SEND package for @APP_NAME@'s event client.
diff --git a/project/cmake/cpack/deb/packages/kodi-inputstream-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-inputstream-dev.txt.in
new file mode 100644
index 0000000..3b4c381
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-inputstream-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-inputstream-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-inputstream-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-inputstream-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (inputstream add-ons dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s inputstream add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-peripheral-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-peripheral-dev.txt.in
new file mode 100644
index 0000000..1c41c5f
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-peripheral-dev.txt.in
@@ -0,0 +1,24 @@
1# kodi-peripheral-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-peripheral-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (peripheral add-ons dev package)
24PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s peripheral add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-pvr-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-pvr-dev.txt.in
new file mode 100644
index 0000000..90e4a14
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-pvr-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-pvr-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-pvr-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-pvr-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (PVR add-ons dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s PVR add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-screensaver-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-screensaver-dev.txt.in
new file mode 100644
index 0000000..877c3ab
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-screensaver-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-screensaver-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-screensaver-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-screensaver-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (screensaver add-ons dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s screensaver add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi-tools-texturepacker.txt.in b/project/cmake/cpack/deb/packages/kodi-tools-texturepacker.txt.in
new file mode 100644
index 0000000..c5c5f8d
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-tools-texturepacker.txt.in
@@ -0,0 +1,25 @@
1# kodi-tools-texturepacker debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-tools-texturepacker
14PACKAGE_ARCHITECTURE
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (skin development - TexturePacker tool)
25PACKAGE_DESCRIPTION_FOOTER This is @APP_NAME@'s TexturePacker tool for skin development.
diff --git a/project/cmake/cpack/deb/packages/kodi-visualization-dev.txt.in b/project/cmake/cpack/deb/packages/kodi-visualization-dev.txt.in
new file mode 100644
index 0000000..ecc5436
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi-visualization-dev.txt.in
@@ -0,0 +1,25 @@
1# kodi-visualization-dev debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@-visualization-dev
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION libdevel
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev
19PACKAGE_RECOMMENDS
20PACKAGE_SUGGESTS
21PACKAGE_BREAKS
22PACKAGE_REPLACES
23PACKAGE_PROVIDES xbmc-visualization-dev
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (visualization add-ons dev package)
25PACKAGE_DESCRIPTION_FOOTER This is the development package for @APP_NAME@'s visualization add-ons.
diff --git a/project/cmake/cpack/deb/packages/kodi.txt.in b/project/cmake/cpack/deb/packages/kodi.txt.in
new file mode 100644
index 0000000..3a5cde1
--- /dev/null
+++ b/project/cmake/cpack/deb/packages/kodi.txt.in
@@ -0,0 +1,25 @@
1# kodi debian package metadata
2#
3# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS
4# content and use dpkg-shlibdeps to automatically generate the package dependency
5# list. Only useful for packages that contain binaries.
6#
7# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains
8# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc)
9# based on build options.
10#
11# Remaining settings are (hopefully) self-explanatory.
12
13PACKAGE_NAME @APP_NAME_LC@
14PACKAGE_ARCHITECTURE all
15PACKAGE_SECTION video
16PACKAGE_PRIORITY optional
17PACKAGE_SHLIBDEPS
18PACKAGE_DEPENDS @APP_NAME_LC@-bin (>= @CPACK_DEBIAN_PACKAGE_VERSION@), @APP_NAME_LC@-bin (<< @CPACK_DEBIAN_PACKAGE_VERSION@.1~), curl, libcurl3, mesa-utils, x11-utils, fonts-liberation | ttf-liberation, fonts-dejavu-core | ttf-dejavu-core, python-bluez | python-lightblue, python-imaging, python-simplejson, libmad0, libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1, libshairplay0, libvorbisfile3, libaacs0, libcec3, librtmp1 | librtmp0, libgnutls30 | libgnutls-deb0-28 | libgnutls28 | libgnutls26, libxslt1.1, libyajl2
19PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1
20PACKAGE_SUGGESTS @APP_NAME_LC@-pvr-mythtv, @APP_NAME_LC@-pvr-vuplus, @APP_NAME_LC@-pvr-vdr-vnsi, @APP_NAME_LC@-pvr-njoy, @APP_NAME_LC@-pvr-nextpvr, @APP_NAME_LC@-pvr-mediaportal-tvserver, @APP_NAME_LC@-pvr-tvheadend-hts, @APP_NAME_LC@-pvr-dvbviewer, @APP_NAME_LC@-pvr-argustv, @APP_NAME_LC@-pvr-iptvsimple, @APP_NAME_LC@-audioencoder-vorbis, @APP_NAME_LC@-audioencoder-flac, @APP_NAME_LC@-audioencoder-lame
21PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone
22PACKAGE_REPLACES xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone
23PACKAGE_PROVIDES @APP_NAME_LC@-data, @APP_NAME_LC@-skin-estuary, @APP_NAME_LC@-standalone, xbmc, xbmc-data, xbmc-standalone
24PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (arch-independent data package)
25PACKAGE_DESCRIPTION_FOOTER This package contains @APP_NAME@'s architecture independent data.
diff --git a/project/cmake/cpack/deb/postinst b/project/cmake/cpack/deb/postinst
new file mode 100755
index 0000000..318d280
--- /dev/null
+++ b/project/cmake/cpack/deb/postinst
@@ -0,0 +1,5 @@
1#!/bin/sh
2set -e
3if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
4 update-menus
5fi
diff --git a/project/cmake/cpack/deb/postrm b/project/cmake/cpack/deb/postrm
new file mode 100755
index 0000000..adc11fd
--- /dev/null
+++ b/project/cmake/cpack/deb/postrm
@@ -0,0 +1,3 @@
1#!/bin/sh
2set -e
3if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
diff --git a/project/cmake/installdata/addon-bindings.txt b/project/cmake/installdata/addon-bindings.txt
deleted file mode 100644
index 5655da5..0000000
--- a/project/cmake/installdata/addon-bindings.txt
+++ /dev/null
@@ -1,37 +0,0 @@
1xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h
2xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h
3xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h
4xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h
5xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h
6xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h
7xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h
8xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h
9xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h
10xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h
11xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
12xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
13xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
14xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
15xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
16xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp
17xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h
18xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h
19xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
20xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp
21xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
22xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
23xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h
24xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h
25xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h
26xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h
27xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
28xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h
29xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h
30xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
31xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
32xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
33xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
34xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
35xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
36xbmc/cores/AudioEngine/Utils/AEChannelData.h
37xbmc/filesystem/IFileTypes.h
diff --git a/project/cmake/installdata/cmake-files.txt b/project/cmake/installdata/cmake-files.txt
deleted file mode 100644
index 8dda8cd..0000000
--- a/project/cmake/installdata/cmake-files.txt
+++ /dev/null
@@ -1,13 +0,0 @@
1project/cmake/scripts/common/addon-helpers.cmake
2project/cmake/scripts/common/addoptions.cmake
3project/cmake/scripts/common/archsetup.cmake
4project/cmake/scripts/common/checkcommits.cmake
5project/cmake/scripts/common/check_target_platform.cmake
6project/cmake/scripts/common/generateversionedfiles.cmake
7project/cmake/scripts/common/generatorsetup.cmake
8project/cmake/scripts/common/handle-depends.cmake
9project/cmake/scripts/common/macros.cmake
10project/cmake/scripts/common/managestring.cmake
11project/cmake/scripts/common/pathsetup.cmake
12project/cmake/scripts/common/prepare-env.cmake
13project/cmake/scripts/common/projectmacros.cmake
diff --git a/project/cmake/installdata/common/addons.txt b/project/cmake/installdata/common/addons.txt
index 3f86c78..1cbe4d6 100644
--- a/project/cmake/installdata/common/addons.txt
+++ b/project/cmake/installdata/common/addons.txt
@@ -1,4 +1,5 @@
1addons/audioencoder.xbmc.builtin.aac/* 1addons/audioencoder.xbmc.builtin.aac/*
2addons/audioencoder.xbmc.builtin.wav/*
2addons/audioencoder.xbmc.builtin.wma/* 3addons/audioencoder.xbmc.builtin.wma/*
3addons/game.controller.default/* 4addons/game.controller.default/*
4addons/kodi.adsp/* 5addons/kodi.adsp/*
@@ -31,15 +32,10 @@ addons/screensaver.xbmc.builtin.dim/*
31addons/screensaver.xbmc.builtin.black/* 32addons/screensaver.xbmc.builtin.black/*
32addons/script.module.pil/* 33addons/script.module.pil/*
33addons/script.module.pysqlite/* 34addons/script.module.pysqlite/*
34addons/audioencoder.xbmc.builtin.aac/*
35addons/audioencoder.xbmc.builtin.wav/*
36addons/audioencoder.xbmc.builtin.wma/*
37addons/resource.language.en_gb/* 35addons/resource.language.en_gb/*
38addons/resource.uisounds.confluence/* 36addons/resource.uisounds.kodi/*
39addons/resource.images.weathericons.default/* 37addons/resource.images.weathericons.default/*
40addons/service.xbmc.versioncheck/* 38addons/service.xbmc.versioncheck/*
41addons/skin.estuary/*
42addons/skin.estouchy/*
43addons/metadata.local/* 39addons/metadata.local/*
44addons/metadata.album.universal/* 40addons/metadata.album.universal/*
45addons/metadata.artists.universal/* 41addons/metadata.artists.universal/*
diff --git a/project/cmake/installdata/darwin/runtime.txt b/project/cmake/installdata/darwin/runtime.txt
deleted file mode 100644
index e1bb711..0000000
--- a/project/cmake/installdata/darwin/runtime.txt
+++ /dev/null
@@ -1 +0,0 @@
1tools/darwin/runtime/preflight
diff --git a/project/cmake/installdata/ios/certificates.txt b/project/cmake/installdata/ios/certificates.txt
new file mode 100644
index 0000000..14e74a7
--- /dev/null
+++ b/project/cmake/installdata/ios/certificates.txt
@@ -0,0 +1 @@
tools/depends/target/openssl/cacert.pem system/certs \ No newline at end of file
diff --git a/project/cmake/installdata/ios/packaging.txt b/project/cmake/installdata/ios/packaging.txt
new file mode 100644
index 0000000..ce990b5
--- /dev/null
+++ b/project/cmake/installdata/ios/packaging.txt
@@ -0,0 +1,3 @@
1LICENSE.gpl
2privacy-policy.txt
3xbmc/platform/darwin/Credits.html
diff --git a/project/cmake/installdata/ios/runtime.txt b/project/cmake/installdata/ios/runtime.txt
new file mode 100644
index 0000000..3bb5467
--- /dev/null
+++ b/project/cmake/installdata/ios/runtime.txt
@@ -0,0 +1,2 @@
1tools/darwin/runtime/preflight
2tools/darwin/runtime/org.xbmc.helper.plist
diff --git a/project/cmake/installdata/osx/certificates.txt b/project/cmake/installdata/osx/certificates.txt
new file mode 100644
index 0000000..14e74a7
--- /dev/null
+++ b/project/cmake/installdata/osx/certificates.txt
@@ -0,0 +1 @@
tools/depends/target/openssl/cacert.pem system/certs \ No newline at end of file
diff --git a/project/cmake/installdata/osx/packaging.txt b/project/cmake/installdata/osx/packaging.txt
new file mode 100644
index 0000000..f869e4c
--- /dev/null
+++ b/project/cmake/installdata/osx/packaging.txt
@@ -0,0 +1,4 @@
1LICENSE.gpl
2privacy-policy.txt
3xbmc/platform/darwin/Credits.html
4tools/darwin/packaging/media/osx/icon.iconset/*
diff --git a/project/cmake/installdata/osx/runtime.txt b/project/cmake/installdata/osx/runtime.txt
new file mode 100644
index 0000000..3bb5467
--- /dev/null
+++ b/project/cmake/installdata/osx/runtime.txt
@@ -0,0 +1,2 @@
1tools/darwin/runtime/preflight
2tools/darwin/runtime/org.xbmc.helper.plist
diff --git a/project/cmake/installdata/rbpi/lirc.txt b/project/cmake/installdata/rbpi/lirc.txt
new file mode 120000
index 0000000..e89ae50
--- /dev/null
+++ b/project/cmake/installdata/rbpi/lirc.txt
@@ -0,0 +1 @@
../linux/lirc.txt \ No newline at end of file
diff --git a/project/cmake/installdata/windows/dlls.txt b/project/cmake/installdata/windows/dlls.txt
index 72cca7d..64d9756 100644
--- a/project/cmake/installdata/windows/dlls.txt
+++ b/project/cmake/installdata/windows/dlls.txt
@@ -1,6 +1,2 @@
1system/*.dll 1system/*.dll .
2system/airplay/*.dll 2project/Win32BuildSetup/dependencies/python27.dll . \ No newline at end of file
3system/cdrip/*.dll
4system/players/dvdplayer/*.dll
5system/players/paplayer/*.dll
6system/players/VideoPlayer/*.dll
diff --git a/project/cmake/installdata/windows/python.txt b/project/cmake/installdata/windows/python.txt
new file mode 100644
index 0000000..b805318
--- /dev/null
+++ b/project/cmake/installdata/windows/python.txt
@@ -0,0 +1 @@
system/python/* \ No newline at end of file
diff --git a/project/cmake/kodi-config.cmake.in b/project/cmake/kodi-config.cmake.in
deleted file mode 100644
index 84b2563..0000000
--- a/project/cmake/kodi-config.cmake.in
+++ /dev/null
@@ -1,29 +0,0 @@
1SET(APP_NAME @APP_NAME@)
2SET(APP_NAME_LC @APP_NAME_LC@)
3SET(APP_NAME_UC @APP_NAME_UC@)
4SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
5SET(APP_VERSION_MINOR @APP_VERSION_MINOR@)
6IF(NOT @APP_NAME_UC@_PREFIX)
7 SET(@APP_NAME_UC@_PREFIX @APP_PREFIX@)
8ENDIF()
9IF(NOT @APP_NAME_UC@_INCLUDE_DIR)
10 SET(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@)
11ENDIF()
12IF(NOT @APP_NAME_UC@_LIB_DIR)
13 SET(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@)
14ENDIF()
15IF(NOT WIN32)
16 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
17ENDIF()
18LIST(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@)
19ADD_DEFINITIONS(@ARCH_DEFINES@ -DBUILD_KODI_ADDON)
20
21if(NOT CORE_SYSTEM_NAME)
22 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
23 set(CORE_SYSTEM_NAME "osx")
24 else()
25 string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME)
26 endif()
27endif()
28
29include(addon-helpers)
diff --git a/project/cmake/modules/FindASS.cmake b/project/cmake/modules/FindASS.cmake
index 5f4b0c7..2d592fa 100644
--- a/project/cmake/modules/FindASS.cmake
+++ b/project/cmake/modules/FindASS.cmake
@@ -1,18 +1,44 @@
1# - Try to find ASS 1#.rst:
2# Once done this will define 2# FindASS
3# -------
4# Finds the ASS library
3# 5#
4# ASS_FOUND - system has libass 6# This will will define the following variables::
5# ASS_INCLUDE_DIRS - the libass include directory 7#
6# ASS_LIBRARIES - The libass libraries 8# ASS_FOUND - system has ASS
9# ASS_INCLUDE_DIRS - the ASS include directory
10# ASS_LIBRARIES - the ASS libraries
11#
12# and the following imported targets::
13#
14# ASS::ASS - The ASS library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (ASS libass) 17 pkg_check_modules(PC_ASS libass QUIET)
10else()
11 find_path(ASS_INCLUDE_DIRS ass/ass.h)
12 find_library(ASS_LIBRARIES NAMES ass libass)
13endif() 18endif()
14 19
20find_path(ASS_INCLUDE_DIR NAMES ass/ass.h
21 PATHS ${PC_ASS_INCLUDEDIR})
22find_library(ASS_LIBRARY NAMES ass libass
23 PATHS ${PC_ASS_LIBDIR})
24
25set(ASS_VERSION ${PC_ASS_VERSION})
26
15include(FindPackageHandleStandardArgs) 27include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(ASS DEFAULT_MSG ASS_INCLUDE_DIRS ASS_LIBRARIES) 28find_package_handle_standard_args(ASS
29 REQUIRED_VARS ASS_LIBRARY ASS_INCLUDE_DIR
30 VERSION_VAR ASS_VERSION)
31
32if(ASS_FOUND)
33 set(ASS_LIBRARIES ${ASS_LIBRARY})
34 set(ASS_INCLUDE_DIRS ${ASS_INCLUDE_DIR})
35
36 if(NOT TARGET ASS::ASS)
37 add_library(ASS::ASS UNKNOWN IMPORTED)
38 set_target_properties(ASS::ASS PROPERTIES
39 IMPORTED_LOCATION "${ASS_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${ASS_INCLUDE_DIR}")
41 endif()
42endif()
17 43
18mark_as_advanced(ASS_INCLUDE_DIRS ASS_LIBRARIES) 44mark_as_advanced(ASS_INCLUDE_DIR ASS_LIBRARY)
diff --git a/project/cmake/modules/FindAlsa.cmake b/project/cmake/modules/FindAlsa.cmake
index b15a0cf..a282243 100644
--- a/project/cmake/modules/FindAlsa.cmake
+++ b/project/cmake/modules/FindAlsa.cmake
@@ -1,20 +1,46 @@
1# - Try to find ALSA 1#.rst:
2# Once done this will define 2# FindAlsa
3# --------
4# Finds the Alsa library
3# 5#
4# ALSA_FOUND - system has libALSA 6# This will will define the following variables::
5# ALSA_INCLUDE_DIRS - the libALSA include directory 7#
6# ALSA_LIBRARIES - The libALSA libraries 8# ALSA_FOUND - system has Alsa
9# ALSA_INCLUDE_DIRS - the Alsa include directory
10# ALSA_LIBRARIES - the Alsa libraries
11# ALSA_DEFINITIONS - the Alsa compile definitions
12#
13# and the following imported targets::
14#
15# ALSA::ALSA - The Alsa library
7 16
8if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
9 pkg_check_modules (ALSA alsa) 18 pkg_check_modules(PC_ALSA alsa QUIET)
10else()
11 find_path(ALSA_INCLUDE_DIRS asoundlib.h PATH_SUFFIXES alsa)
12 find_library(ALSA_LIBRARIES asound)
13endif() 19endif()
14 20
21find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
22 PATHS ${PC_ALSA_INCLUDEDIR})
23find_library(ALSA_LIBRARY NAMES asound
24 PATHS ${PC_ALSA_LIBDIR})
25
26set(ALSA_VERSION ${PC_ALSA_VERSION})
27
15include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(Alsa DEFAULT_MSG ALSA_INCLUDE_DIRS ALSA_LIBRARIES) 29find_package_handle_standard_args(ALSA
30 REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
31 VERSION_VAR ALSA_VERSION)
32
33if(ALSA_FOUND)
34 set(ALSA_INCLUDE_DIRS "") # Don't want these added as 'timer.h' is a dangerous file
35 set(ALSA_LIBRARIES ${ALSA_LIBRARY})
36 set(ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1)
37
38 if(NOT TARGET ALSA::ALSA)
39 add_library(ALSA::ALSA UNKNOWN IMPORTED)
40 set_target_properties(ALSA::ALSA PROPERTIES
41 IMPORTED_LOCATION "${ALSA_LIBRARY}"
42 INTERFACE_COMPILE_DEFINITIONS "${ALSA_DEFINITIONS}")
43 endif()
44endif()
17 45
18set(ALSA_INCLUDE_DIRS "") # Dont want these added as 'timer.h' is a dangerous file 46mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)
19mark_as_advanced(ALSA_INCLUDE_DIRS ALSA_LIBRARIES)
20list(APPEND ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1)
diff --git a/project/cmake/modules/FindAvahi.cmake b/project/cmake/modules/FindAvahi.cmake
index 24bf15c..77c3e4d 100644
--- a/project/cmake/modules/FindAvahi.cmake
+++ b/project/cmake/modules/FindAvahi.cmake
@@ -1,26 +1,63 @@
1# - Try to find avahi 1#.rst:
2# Once done this will define 2# FindAvahi
3# ---------
4# Finds the avahi library
5#
6# This will will define the following variables::
3# 7#
4# AVAHI_FOUND - system has avahi 8# AVAHI_FOUND - system has avahi
5# AVAHI_INCLUDE_DIRS - the avahi include directory 9# AVAHI_INCLUDE_DIRS - the avahi include directory
6# AVAHI_LIBRARIES - The avahi libraries 10# AVAHI_LIBRARIES - the avahi libraries
11# AVAHI_DEFINITIONS - the avahi definitions
12#
13# and the following imported targets::
14#
15# Avahi::Avahi - The avahi library
7 16
8if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
9 pkg_check_modules (AVAHI avahi-client) 18 pkg_check_modules(PC_AVAHI avahi-client QUIET)
10 list(APPEND AVAHI_INCLUDE_DIRS ${AVAHI_INCLUDEDIR})
11else()
12 find_path(AVAHI_CLIENT_INCLUDE_DIRS avahi-client/client.h)
13 find_path(AVAHI_COMMON_INCLUDE_DIRS avahi-common/defs.h)
14 find_library(AVAHI_COMMON_LIBRARIES avahi-common)
15 find_library(AVAHI_CLIENT_LIBRARIES avahi-common)
16 set(AVAHI_INCLUDE_DIRS ${AVAHI_CLIENT_INCLUDE_DIRS}
17 ${AVAHI_COMMON_INCLUDE_DIRS})
18 set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARIES}
19 ${AVAHI_COMMON_LIBRARIES})
20endif() 19endif()
21 20
21find_path(AVAHI_CLIENT_INCLUDE_DIR NAMES avahi-client/client.h
22 PATHS ${PC_AVAHI_INCLUDEDIR})
23find_path(AVAHI_COMMON_INCLUDE_DIR NAMES avahi-common/defs.h
24 PATHS ${PC_AVAHI_INCLUDEDIR})
25find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client
26 PATHS ${PC_AVAHI_LIBDIR})
27find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common
28 PATHS ${PC_AVAHI_LIBDIR})
29
30set(AVAHI_VERSION ${PC_AVAHI_VERSION})
31
22include(FindPackageHandleStandardArgs) 32include(FindPackageHandleStandardArgs)
23find_package_handle_standard_args(Avahi DEFAULT_MSG AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES) 33find_package_handle_standard_args(Avahi
34 REQUIRED_VARS AVAHI_CLIENT_LIBRARY AVAHI_COMMON_LIBRARY
35 AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR
36 VERSION_VAR AVAHI_VERSION)
37
38if(AVAHI_FOUND)
39 set(AVAHI_INCLUDE_DIRS ${AVAHI_CLIENT_INCLUDE_DIR}
40 ${AVAHI_COMMON_INCLUDE_DIR})
41 set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARY}
42 ${AVAHI_COMMON_LIBRARY})
43 set(AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_CLIENT=1 -DHAVE_LIBAVAHI_COMMON=1)
44
45 if(NOT TARGET Avahi::Avahi)
46 add_library(Avahi::Avahi UNKNOWN IMPORTED)
47 set_target_properties(Avahi::Avahi PROPERTIES
48 IMPORTED_LOCATION "${AVAHI_CLIENT_LIBRARY}"
49 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_CLIENT_INCLUDE_DIR}"
50 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_CLIENT=1)
51 endif()
52 if(NOT TARGET Avahi::AvahiCommon)
53 add_library(Avahi::AvahiCommon UNKNOWN IMPORTED)
54 set_target_properties(Avahi::AvahiCommon PROPERTIES
55 IMPORTED_LOCATION "${AVAHI_COMMON_LIBRARY}"
56 INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_COMMON_INCLUDE_DIR}"
57 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_COMMON=1
58 INTERFACE_LINK_LIBRARIES Avahi::Avahi)
59 endif()
60endif()
24 61
25mark_as_advanced(AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES) 62mark_as_advanced(AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR
26list(APPEND AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_COMMON=1 -DHAVE_LIBAVAHI_CLIENT=1) 63 AVAHI_CLIENT_LIBRARY AVAHI_COMMON_LIBRARY)
diff --git a/project/cmake/modules/FindBluetooth.cmake b/project/cmake/modules/FindBluetooth.cmake
new file mode 100644
index 0000000..538e89c
--- /dev/null
+++ b/project/cmake/modules/FindBluetooth.cmake
@@ -0,0 +1,44 @@
1#.rst:
2# FindBluetooth
3# ---------
4# Finds the Bluetooth library
5#
6# This will will define the following variables::
7#
8# BLUETOOTH_FOUND - system has Bluetooth
9# BLUETOOTH_INCLUDE_DIRS - the Bluetooth include directory
10# BLUETOOTH_LIBRARIES - the Bluetooth libraries
11#
12# and the following imported targets::
13#
14# Bluetooth::Bluetooth - The Bluetooth library
15
16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_BLUETOOTH bluetooth QUIET)
18endif()
19
20find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h
21 PATHS ${PC_BLUETOOTH_INCLUDEDIR})
22find_library(BLUETOOTH_LIBRARY NAMES bluetooth
23 PATHS ${PC_BLUETOOTH_LIBDIR})
24
25set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION})
26
27include(FindPackageHandleStandardArgs)
28find_package_handle_standard_args(Bluetooth
29 REQUIRED_VARS BLUETOOTH_LIBRARY BLUETOOTH_INCLUDE_DIR
30 VERSION_VAR ${BLUETOOTH_VERSION})
31
32if(BLUETOOTH_FOUND)
33 set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR})
34 set(BLUETOOTH_LIBRARIES ${BLUETOOTH_LIBRARY})
35
36 if(NOT TARGET Bluetooth::Bluetooth)
37 add_library(Bluetooth::Bluetooth UNKNOWN IMPORTED)
38 set_target_properties(Bluetooth::Bluetooth PROPERTIES
39 IMPORTED_LOCATION "${BLUETOOTH_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${BLUETOOTH_INCLUDE_DIR}")
41 endif()
42endif()
43
44mark_as_advanced(BLUETOOTH_INCLUDE_DIR BLUETOOTH_LIBRARY)
diff --git a/project/cmake/modules/FindBluray.cmake b/project/cmake/modules/FindBluray.cmake
index 2b0a449..b8422ed 100644
--- a/project/cmake/modules/FindBluray.cmake
+++ b/project/cmake/modules/FindBluray.cmake
@@ -15,26 +15,27 @@
15# Bluray::Bluray - The libblueray library 15# Bluray::Bluray - The libblueray library
16 16
17if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(BLURAY libbluray>=0.7.0) 18 pkg_check_modules(PC_BLURAY libbluray>=0.7.0 QUIET)
19 set(BLURAY_VERSION ${PC_BLURAY_VERSION}) 19endif()
20
21find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h
22 PATHS ${PC_BLURAY_INCLUDEDIR})
23
24set(BLURAY_VERSION ${PC_BLURAY_VERSION})
25
26include(FindPackageHandleStandardArgs)
27if(NOT WIN32)
28 find_library(BLURAY_LIBRARY NAMES bluray
29 PATHS ${PC_BLURAY_LIBDIR})
30
31 find_package_handle_standard_args(Bluray
32 REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR
33 VERSION_VAR BLURAY_VERSION)
20else() 34else()
21 find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h 35 # Dynamically loaded DLL
22 PATHS ${PC_BLURAY_INCLUDEDIR}) 36 find_package_handle_standard_args(Bluray
23 37 REQUIRED_VARS BLURAY_INCLUDE_DIR
24 include(FindPackageHandleStandardArgs) 38 VERSION_VAR BLURAY_VERSION)
25 if(NOT WIN32)
26 find_library(BLURAY_LIBRARY NAMES bluray
27 PATHS ${PC_BLURAY_LIBDIR})
28
29 find_package_handle_standard_args(BLURAY
30 REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR
31 VERSION_VAR BLURAY_VERSION)
32 else()
33 # Dynamically loaded DLL
34 find_package_handle_standard_args(BLURAY
35 REQUIRED_VARS BLURAY_INCLUDE_DIR
36 VERSION_VAR BLURAY_VERSION)
37 endif()
38endif() 39endif()
39 40
40if(BLURAY_FOUND) 41if(BLURAY_FOUND)
diff --git a/project/cmake/modules/FindCCache.cmake b/project/cmake/modules/FindCCache.cmake
index 4ad7d07..a7fd29f 100644
--- a/project/cmake/modules/FindCCache.cmake
+++ b/project/cmake/modules/FindCCache.cmake
@@ -1,6 +1,18 @@
1find_program(CCACHE_FOUND ccache) 1#.rst:
2if(CCACHE_FOUND) 2# FindCCache
3 set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) 3# ----------
4 set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) 4# Finds ccache and sets it up as compiler wrapper.
5endif(CCACHE_FOUND) 5# This should ideally be called before the call to project().
6#
7# See: https://crascit.com/2016/04/09/using-ccache-with-cmake/
8
9find_program(CCACHE_PROGRAM ccache)
6 10
11include(FindPackageHandleStandardArgs)
12find_package_handle_standard_args(CCACHE REQUIRED_VARS CCACHE_PROGRAM)
13
14if(CCACHE_FOUND)
15 # Supports Unix Makefiles and Ninja
16 set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
17 set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}")
18endif()
diff --git a/project/cmake/modules/FindCEC.cmake b/project/cmake/modules/FindCEC.cmake
index 98e900d..bd6fd1d 100644
--- a/project/cmake/modules/FindCEC.cmake
+++ b/project/cmake/modules/FindCEC.cmake
@@ -15,13 +15,23 @@
15# CEC::CEC - The libCEC library 15# CEC::CEC - The libCEC library
16 16
17if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_CEC libCEC>=3.0.0 QUIET) 18 pkg_check_modules(PC_CEC libcec QUIET)
19endif() 19endif()
20 20
21find_path(CEC_INCLUDE_DIR libCEC/CEC.h 21find_path(CEC_INCLUDE_DIR NAMES libcec/cec.h libCEC/CEC.h
22 PATHS ${PC_CEC_INCLUDEDIR}) 22 PATHS ${PC_CEC_INCLUDEDIR})
23 23
24set(CEC_VERSION ${PC_CEC_VERSION}) 24if(PC_CEC_VERSION)
25 set(CEC_VERSION ${PC_CEC_VERSION})
26elseif(CEC_INCLUDE_DIR AND EXISTS "${CEC_INCLUDE_DIR}/libcec/version.h")
27 file(STRINGS "${CEC_INCLUDE_DIR}/libcec/version.h" cec_version_str REGEX "^[\t ]+LIBCEC_VERSION_TO_UINT\\(.*\\)")
28 string(REGEX REPLACE "^[\t ]+LIBCEC_VERSION_TO_UINT\\(([0-9]+), ([0-9]+), ([0-9]+)\\)" "\\1.\\2.\\3" CEC_VERSION "${cec_version_str}")
29 unset(cec_version_str)
30endif()
31
32if(NOT CEC_FIND_VERSION)
33 set(CEC_FIND_VERSION 4.0.0)
34endif()
25 35
26include(FindPackageHandleStandardArgs) 36include(FindPackageHandleStandardArgs)
27if(NOT WIN32) 37if(NOT WIN32)
diff --git a/project/cmake/modules/FindCWiid.cmake b/project/cmake/modules/FindCWiid.cmake
new file mode 100644
index 0000000..88cfbef
--- /dev/null
+++ b/project/cmake/modules/FindCWiid.cmake
@@ -0,0 +1,44 @@
1#.rst:
2# FindCWiid
3# ---------
4# Finds the CWiid library
5#
6# This will will define the following variables::
7#
8# CWIID_FOUND - system has CWiid
9# CWIID_INCLUDE_DIRS - the CWiid include directory
10# CWIID_LIBRARIES - the CWiid libraries
11#
12# and the following imported targets::
13#
14# CWiid::CWiid - The CWiid library
15
16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_CWIID cwiid QUIET)
18endif()
19
20find_path(CWIID_INCLUDE_DIR NAMES cwiid.h
21 PATHS ${PC_CWIID_INCLUDEDIR})
22find_library(CWIID_LIBRARY NAMES cwiid
23 PATHS ${PC_CWIID_LIBDIR})
24
25set(CWIID_VERSION ${PC_CWIID_VERSION})
26
27include(FindPackageHandleStandardArgs)
28find_package_handle_standard_args(CWIID
29 REQUIRED_VARS CWIID_LIBRARY CWIID_INCLUDE_DIR
30 VERSION_VAR CWIID_VERSION)
31
32if(CWIID_FOUND)
33 set(CWIID_INCLUDE_DIRS ${CWIID_INCLUDE_DIR})
34 set(CWIID_LIBRARIES ${CWIID_LIBRARY})
35
36 if(NOT TARGET CWiid::CWiid)
37 add_library(CWiid::CWiid UNKNOWN IMPORTED)
38 set_target_properties(CWiid::CWiid PROPERTIES
39 IMPORTED_LOCATION "${CWIID_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${CWIID_INCLUDE_DIR}")
41 endif()
42endif()
43
44mark_as_advanced(CWIID_INCLUDE_DIR CWIID_LIBRARY)
diff --git a/project/cmake/modules/FindCXX11.cmake b/project/cmake/modules/FindCXX11.cmake
index f1b7346..c0b9a52 100644
--- a/project/cmake/modules/FindCXX11.cmake
+++ b/project/cmake/modules/FindCXX11.cmake
@@ -11,8 +11,8 @@ else()
11 if(CXX_FLAG_CXX0X) 11 if(CXX_FLAG_CXX0X)
12 add_options (CXX ALL_BUILDS "-std=c++0x") 12 add_options (CXX ALL_BUILDS "-std=c++0x")
13 set(CXX_STD11_FLAGS "-std=c++0x") 13 set(CXX_STD11_FLAGS "-std=c++0x")
14 endif(CXX_FLAG_CXX0X) 14 endif()
15endif(CXX_FLAG_CXX11) 15endif()
16 16
17include(FindPackageHandleStandardArgs) 17include(FindPackageHandleStandardArgs)
18find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) 18find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS)
diff --git a/project/cmake/modules/FindCdio.cmake b/project/cmake/modules/FindCdio.cmake
index 1b6b8cd..aa089c2 100644
--- a/project/cmake/modules/FindCdio.cmake
+++ b/project/cmake/modules/FindCdio.cmake
@@ -1,20 +1,45 @@
1# - Try to find cdio 1#.rst:
2# Once done this will define 2# FindCdio
3# --------
4# Finds the cdio library
3# 5#
4# CDIO_FOUND - system has libcdio 6# This will will define the following variables::
5# CDIO_INCLUDE_DIRS - the libcdio include directory 7#
6# CDIO_LIBRARIES - The libcdio libraries 8# CDIO_FOUND - system has cdio
9# CDIO_INCLUDE_DIRS - the cdio include directory
10# CDIO_LIBRARIES - the cdio libraries
11#
12# and the following imported targets::
13#
14# CDIO::CDIO - The cdio library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (CDIO libcdio libiso9660) 17 pkg_check_modules(PC_CDIO libcdio libiso9660 QUIET)
10 list(APPEND CDIO_INCLUDE_DIRS ${CDIO_libcdio_INCLUDEDIR} ${CDIO_libiso9660_INCLUDEDIR})
11endif()
12if(NOT CDIO_FOUND)
13 find_path(CDIO_INCLUDE_DIRS cdio/cdio.h)
14 find_library(MODPLUG_LIBRARIES NAMES cdio)
15endif() 18endif()
16 19
20find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h
21 PATHS ${PC_CDIO_libcdio_INCLUDEDIR}
22 ${PC_CDIO_libiso9660_INCLUDEDIR})
23find_library(CDIO_LIBRARY NAMES cdio
24 PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR})
25
26set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION})
27
17include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
18find_package_handle_standard_args(Cdio DEFAULT_MSG CDIO_INCLUDE_DIRS CDIO_LIBRARIES) 29find_package_handle_standard_args(CDIO
30 REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR
31 VERSION_VAR CDIO_VERSION)
32
33if(CDIO_FOUND)
34 set(CDIO_LIBRARIES ${CDIO_LIBRARY})
35 set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR})
36
37 if(NOT TARGET CDIO::CDIO)
38 add_library(CDIO::CDIO UNKNOWN IMPORTED)
39 set_target_properties(CDIO::CDIO PROPERTIES
40 IMPORTED_LOCATION "${CDIO_LIBRARY}"
41 INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}")
42 endif()
43endif()
19 44
20mark_as_advanced(CDIO_INCLUDE_DIRS CDIO_LIBRARIES) 45mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY)
diff --git a/project/cmake/modules/FindCpluff.cmake b/project/cmake/modules/FindCpluff.cmake
index c6693fa..fb2bb25 100644
--- a/project/cmake/modules/FindCpluff.cmake
+++ b/project/cmake/modules/FindCpluff.cmake
@@ -8,38 +8,46 @@
8 8
9if(NOT WIN32) 9if(NOT WIN32)
10 string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") 10 string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}")
11 get_filename_component(expat_dir ${EXPAT_LIBRARY} PATH) 11 get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY)
12 set(ldflags "-L${expat_dir}") 12 set(ldflags "-L${expat_dir}")
13 ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff 13 ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff
14 BUILD_IN_SOURCE 1 14 BUILD_IN_SOURCE 1
15 PREFIX ${CORE_BUILD_DIR}/cpluff 15 PREFIX ${CORE_BUILD_DIR}/cpluff
16 PATCH_COMMAND rm -f config.status
17 UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
18 CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CORE_SOURCE_DIR}/lib/cpluff/configure 16 CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CORE_SOURCE_DIR}/lib/cpluff/configure
19 --disable-nls 17 --disable-nls
20 --enable-static 18 --enable-static
21 --disable-shared 19 --disable-shared
22 --with-pic 20 --with-pic
23 --prefix=<INSTALL_DIR> 21 --prefix=<INSTALL_DIR>
22 --libdir=<INSTALL_DIR>/lib
24 --host=${ARCH} 23 --host=${ARCH}
25 CFLAGS=${defines} 24 CFLAGS=${defines}
26 LDFLAGS=${ldflags} 25 LDFLAGS=${ldflags})
27 BUILD_COMMAND make V=1) 26 ExternalProject_Add_Step(libcpluff autoreconf
27 DEPENDEES download update patch
28 DEPENDERS configure
29 COMMAND rm -f config.status
30 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
31 WORKING_DIRECTORY <SOURCE_DIR>)
32
28 set(ldflags "${ldflags};-lexpat") 33 set(ldflags "${ldflags};-lexpat")
29 core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a 34 core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a
30 system/libcpluff libcpluff extras "${ldflags}") 35 system/libcpluff libcpluff extras "${ldflags}")
31 set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) 36 set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include)
37 set(CPLUFF_FOUND 1)
38 mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND)
32else() 39else()
33 ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff 40 find_path(CPLUFF_INCLUDE_DIR cpluff.h)
34 PREFIX ${CORE_BUILD_DIR}/cpluff
35 CONFIGURE_COMMAND ""
36 # TODO: Building the project directly from lib/cpluff/libcpluff/win32/cpluff.vcxproj
37 # fails becaue it imports XBMC.defaults.props
38 BUILD_COMMAND msbuild ${CORE_SOURCE_DIR}/project/VS2010Express/XBMC\ for\ Windows.sln
39 /t:cpluff /p:Configuration=${CORE_BUILD_CONFIG}
40 INSTALL_COMMAND "")
41endif()
42 41
43set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) 42 include(FindPackageHandleStandardArgs)
44set(CPLUFF_FOUND 1) 43 find_package_handle_standard_args(CPLUFF
45mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) 44 REQUIRED_VARS CPLUFF_INCLUDE_DIR)
45
46 if(CPLUFF_FOUND)
47 set(CPLUFF_INCLUDE_DIRS ${CPLUFF_INCLUDE_DIR})
48 endif()
49 mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND)
50
51 add_custom_target(libcpluff)
52endif()
53set_target_properties(libcpluff PROPERTIES FOLDER "External Projects")
diff --git a/project/cmake/modules/FindCrossGUID.cmake b/project/cmake/modules/FindCrossGUID.cmake
index df40c9e..bcae3d3 100644
--- a/project/cmake/modules/FindCrossGUID.cmake
+++ b/project/cmake/modules/FindCrossGUID.cmake
@@ -5,8 +5,22 @@ if(ENABLE_INTERNAL_CROSSGUID)
5 list(GET CGUID_VER 0 CGUID_VER) 5 list(GET CGUID_VER 0 CGUID_VER)
6 string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER) 6 string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER)
7 7
8 # allow user to override the download URL with a local tarball
9 # needed for offline build envs
10 if(CROSSGUID_URL)
11 get_filename_component(CROSSGUID_URL "${CROSSGUID_URL}" ABSOLUTE)
12 else()
13 set(CROSSGUID_URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz)
14 endif()
15 if(VERBOSE)
16 message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}")
17 endif()
18
19 set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a)
20 set(CROSSGUID_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
8 externalproject_add(crossguid 21 externalproject_add(crossguid
9 URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz 22 URL ${CROSSGUID_URL}
23 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
10 PREFIX ${CORE_BUILD_DIR}/crossguid 24 PREFIX ${CORE_BUILD_DIR}/crossguid
11 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 25 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
12 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} 26 -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
@@ -18,17 +32,19 @@ if(ENABLE_INTERNAL_CROSSGUID)
18 <SOURCE_DIR> && 32 <SOURCE_DIR> &&
19 ${CMAKE_COMMAND} -E copy 33 ${CMAKE_COMMAND} -E copy
20 ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake 34 ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake
21 <SOURCE_DIR>) 35 <SOURCE_DIR>
22 36 BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY})
23 set(CROSSGUID_FOUND 1) 37 set_target_properties(crossguid PROPERTIES FOLDER "External Projects")
24 set(CROSSGUID_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a)
25 set(CROSSGUID_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
26 38
27 include(FindPackageHandleStandardArgs) 39 include(FindPackageHandleStandardArgs)
28 find_package_handle_standard_args(CROSSGUID DEFAULT_MSG CROSSGUID_INCLUDE_DIRS CROSSGUID_LIBRARIES) 40 find_package_handle_standard_args(CrossGuid
29 mark_as_advanced(CROSSGUID_INCLUDE_DIRS CROSSGUID_LIBRARIES CROSSGUID_DEFINITIONS CROSSGUID_FOUND) 41 REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR
42 VERSION_VAR CGUID_VER)
43
44 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY})
45 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR})
30else() 46else()
31 find_path(CROSSGUID_INCLUDE_DIR guid.h) 47 find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h)
32 48
33 find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) 49 find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid)
34 find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) 50 find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd)
@@ -37,12 +53,15 @@ else()
37 select_library_configurations(CROSSGUID) 53 select_library_configurations(CROSSGUID)
38 54
39 include(FindPackageHandleStandardArgs) 55 include(FindPackageHandleStandardArgs)
40 find_package_handle_standard_args(CROSSGUID 56 find_package_handle_standard_args(CrossGuid
41 REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR) 57 REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR)
42 58
43 if(CROSSGUID_FOUND) 59 if(CROSSGUID_FOUND)
44 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) 60 set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY})
45 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) 61 set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR})
62
63 add_custom_target(crossguid)
64 set_target_properties(crossguid PROPERTIES FOLDER "External Projects")
46 endif() 65 endif()
47 mark_as_advanced(CROSSGUID_INCLUDE_DIR CROSSGUID_LIBRARY) 66 mark_as_advanced(CROSSGUID_INCLUDE_DIR CROSSGUID_LIBRARY)
48endif() 67endif()
diff --git a/project/cmake/modules/FindCurl.cmake b/project/cmake/modules/FindCurl.cmake
index a2e8862..ed4d81f 100644
--- a/project/cmake/modules/FindCurl.cmake
+++ b/project/cmake/modules/FindCurl.cmake
@@ -1,37 +1,83 @@
1# - Try to find CURL 1#.rst:
2# Once done this will define 2# FindCurl
3# --------
4# Finds the Curl library
3# 5#
4# CURL_FOUND - system has libcurl 6# This will will define the following variables::
5# CURL_INCLUDE_DIRS - the libcurl include directory 7#
6# CURL_LIBRARIES - The libcurl libraries 8# CURL_FOUND - system has Curl
9# CURL_INCLUDE_DIRS - the Curl include directory
10# CURL_LIBRARIES - the Curl libraries
11# CURL_DEFINITIONS - the Curl definitions
12#
13# and the following imported targets::
14#
15# Curl::Curl - The Curl library
7 16
8if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
9 pkg_check_modules (CURL libcurl) 18 pkg_check_modules(PC_CURL libcurl QUIET)
10 list(APPEND CURL_INCLUDE_DIRS ${CURL_INCLUDEDIR})
11else()
12 find_path(CURL_INCLUDE_DIRS curl/curl.h)
13 find_library(CURL_LIBRARIES NAMES curl libcurl)
14endif() 19endif()
15include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(Curl DEFAULT_MSG CURL_INCLUDE_DIRS CURL_LIBRARIES)
17 20
18mark_as_advanced(CURL_INCLUDE_DIRS CURL_LIBRARIES) 21find_path(CURL_INCLUDE_DIR NAMES curl/curl.h
22 PATHS ${PC_CURL_INCLUDEDIR})
23find_library(CURL_LIBRARY NAMES curl libcurl
24 PATHS ${PC_CURL_LIBDIR})
25
26set(CURL_VERSION ${PC_CURL_VERSION})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(Curl
30 REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
31 VERSION_VAR CURL_VERSION)
19 32
20if(CURL_FOUND) 33if(CURL_FOUND)
21 if(NOT CURL_LIBRARY_DIRS AND CURL_LIBDIR) 34 set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
22 set(CURL_LIBRARY_DIRS ${CURL_LIBDIR}) 35 set(CURL_LIBRARIES ${CURL_LIBRARY})
36
37 # Check whether OpenSSL inside libcurl is static.
38 if(UNIX)
39 if(NOT DEFINED HAS_CURL_STATIC)
40 get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} DIRECTORY)
41 find_soname(CURL REQUIRED)
42
43 if(APPLE)
44 set(libchecker nm)
45 set(searchpattern "T [_]?CRYPTO_set_locking_call")
46 else()
47 set(libchecker readelf -s)
48 set(searchpattern "CRYPTO_set_locking_call")
49 endif()
50 execute_process(
51 COMMAND ${libchecker} ${CURL_LIBRARY_DIR}/${CURL_SONAME}
52 COMMAND grep -Eq ${searchpattern}
53 RESULT_VARIABLE HAS_CURL_STATIC)
54 unset(libchecker)
55 unset(searchpattern)
56 if(HAS_CURL_STATIC EQUAL 0)
57 set(HAS_CURL_STATIC TRUE)
58 else()
59 set(HAS_CURL_STATIC FALSE)
60 endif()
61 set(HAS_CURL_STATIC ${HAS_CURL_STATIC} CACHE INTERNAL
62 "OpenSSL is statically linked into Curl")
63 message(STATUS "OpenSSL is statically linked into Curl: ${HAS_CURL_STATIC}")
64 endif()
23 endif() 65 endif()
24 66
25 find_soname(CURL) 67 if(HAS_CURL_STATIC)
68 set(CURL_DEFINITIONS -DHAS_CURL_STATIC=1)
69 endif()
26 70
27 if(EXISTS "${CURL_LIBRARY_DIRS}/${CURL_SONAME}") 71 if(NOT TARGET Curl::Curl)
28 execute_process(COMMAND readelf -s ${CURL_LIBRARY_DIRS}/${CURL_SONAME} COMMAND grep CRYPTO_set_locking_call OUTPUT_VARIABLE HAS_CURL_STATIC) 72 add_library(Curl::Curl UNKNOWN IMPORTED)
29 else() 73 set_target_properties(Curl::Curl PROPERTIES
30 message(FATAL_ERROR "curl library not found") 74 IMPORTED_LOCATION "${CURL_LIBRARY}"
75 INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}")
76 if(HAS_CURL_STATIC)
77 set_target_properties(Curl::Curl PROPERTIES
78 INTERFACE_COMPILE_DEFINITIONS HAS_CURL_STATIC=1)
79 endif()
31 endif() 80 endif()
32endif() 81endif()
33 82
34if(HAS_CURL_STATIC) 83mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY)
35 mark_as_advanced(HAS_CURL_STATIC)
36 list(APPEND CURL_DEFINITIONS -DHAS_CURL_STATIC=1)
37endif()
diff --git a/project/cmake/modules/FindD3DX11Effects.cmake b/project/cmake/modules/FindD3DX11Effects.cmake
index 9de8c2b..d7468e1 100644
--- a/project/cmake/modules/FindD3DX11Effects.cmake
+++ b/project/cmake/modules/FindD3DX11Effects.cmake
@@ -1,28 +1,8 @@
1# - Builds D3DX11Effects as external project 1# - Finds D3DX11 dependencies
2# Once done this will define 2# Once done this will define
3# 3#
4# D3DX11EFFECTS_FOUND - system has D3DX11Effects
5# D3DX11EFFECTS_INCLUDE_DIRS - the D3DX11Effects include directories
6# D3DCOMPILER_DLL - Path to the Direct3D Compiler 4# D3DCOMPILER_DLL - Path to the Direct3D Compiler
7 5# FXC - Path to the DirectX Effects Compiler (FXC)
8include(ExternalProject)
9ExternalProject_Add(d3dx11effects
10 SOURCE_DIR ${CORE_SOURCE_DIR}/lib/win32/Effects11
11 PREFIX ${CORE_BUILD_DIR}/Effects11
12 CONFIGURE_COMMAND ""
13 BUILD_COMMAND msbuild ${CORE_SOURCE_DIR}/lib/win32/Effects11/Effects11_2013.sln
14 /t:Effects11 /p:Configuration=${CORE_BUILD_CONFIG}
15 INSTALL_COMMAND "")
16
17set(D3DX11EFFECTS_FOUND 1)
18set(D3DX11EFFECTS_INCLUDE_DIRS ${CORE_SOURCE_DIR}/lib/win32/Effects11/inc)
19
20set(D3DX11EFFECTS_LIBRARY_RELEASE ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Release/Effects11.lib)
21set(D3DX11EFFECTS_LIBRARY_DEBUG ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Debug/Effects11.lib)
22include(SelectLibraryConfigurations)
23select_library_configurations(D3DX11EFFECTS)
24
25mark_as_advanced(D3DX11EFFECTS_FOUND)
26 6
27find_file(D3DCOMPILER_DLL 7find_file(D3DCOMPILER_DLL
28 NAMES d3dcompiler_47.dll d3dcompiler_46.dll 8 NAMES d3dcompiler_47.dll d3dcompiler_46.dll
@@ -36,6 +16,7 @@ if(NOT D3DCOMPILER_DLL)
36 message(WARNING "Could NOT find Direct3D Compiler") 16 message(WARNING "Could NOT find Direct3D Compiler")
37endif() 17endif()
38mark_as_advanced(D3DCOMPILER_DLL) 18mark_as_advanced(D3DCOMPILER_DLL)
19copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .)
39 20
40find_program(FXC fxc 21find_program(FXC fxc
41 PATHS 22 PATHS
diff --git a/project/cmake/modules/FindDBus.cmake b/project/cmake/modules/FindDBus.cmake
new file mode 100644
index 0000000..2d64af4
--- /dev/null
+++ b/project/cmake/modules/FindDBus.cmake
@@ -0,0 +1,52 @@
1#.rst:
2# FindDBUS
3# -------
4# Finds the DBUS library
5#
6# This will will define the following variables::
7#
8# DBUS_FOUND - system has DBUS
9# DBUS_INCLUDE_DIRS - the DBUS include directory
10# DBUS_LIBRARIES - the DBUS libraries
11# DBUS_DEFINITIONS - the DBUS definitions
12#
13# and the following imported targets::
14#
15# DBus::DBus - The DBUS library
16
17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_DBUS dbus-1 QUIET)
19endif()
20
21find_path(DBUS_INCLUDE_DIR NAMES dbus/dbus.h
22 PATH_SUFFIXES dbus-1.0
23 PATHS ${PC_DBUS_INCLUDE_DIR})
24find_path(DBUS_ARCH_INCLUDE_DIR NAMES dbus/dbus-arch-deps.h
25 PATH_SUFFIXES dbus-1.0/include
26 PATHS ${PC_DBUS_LIBDIR}
27 /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
28find_library(DBUS_LIBRARY NAMES dbus-1
29 PATHS ${PC_DBUS_LIBDIR})
30
31set(DBUS_VERSION ${PC_DBUS_VERSION})
32
33include(FindPackageHandleStandardArgs)
34find_package_handle_standard_args(DBus
35 REQUIRED_VARS DBUS_LIBRARY DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR
36 VERSION_VAR DBUS_VERSION)
37
38if(DBUS_FOUND)
39 set(DBUS_LIBRARIES ${DBUS_LIBRARY})
40 set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
41 set(DBUS_DEFINITIONS -DHAVE_DBUS=1)
42
43 if(NOT TARGET DBus::DBus)
44 add_library(DBus::DBus UNKNOWN IMPORTED)
45 set_target_properties(DBus::DBus PROPERTIES
46 IMPORTED_LOCATION "${DBUS_LIBRARY}"
47 INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIR}"
48 INTERFACE_COMPILE_DEFINITIONS HAVE_DBUS=1)
49 endif()
50endif()
51
52mark_as_advanced(DBUS_INCLUDE_DIR DBUS_LIBRARY)
diff --git a/project/cmake/modules/FindDbus.cmake b/project/cmake/modules/FindDbus.cmake
deleted file mode 100644
index cdc3f52..0000000
--- a/project/cmake/modules/FindDbus.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
1# - Try to find dbus
2# Once done this will define
3#
4# DBUS_FOUND - system has libdbus
5# DBUS_INCLUDE_DIRS - the libdbus include directory
6# DBUS_LIBRARIES - The libdbus libraries
7
8if(PKG_CONFIG_FOUND)
9 pkg_check_modules (DBUS dbus-1)
10endif()
11
12if(DBUS_FOUND)
13 find_path(DBUS_INCLUDE_DIRS dbus/dbus.h PATH_SUFFIXES dbus-1.0)
14 find_library(DBUS_LIBRARIES dbus-1.0)
15endif()
16
17include(FindPackageHandleStandardArgs)
18find_package_handle_standard_args(Dbus DEFAULT_MSG DBUS_INCLUDE_DIRS DBUS_LIBRARIES)
19
20list(APPEND DBUS_DEFINITIONS -DHAVE_DBUS=1)
21mark_as_advanced(DBUS_INCLUDE_DIRS DBUS_LIBRARIES DBUS_DEFINITIONS)
diff --git a/project/cmake/modules/FindEMBEDDED.cmake b/project/cmake/modules/FindEMBEDDED.cmake
index bc1b456..aa938c5 100644
--- a/project/cmake/modules/FindEMBEDDED.cmake
+++ b/project/cmake/modules/FindEMBEDDED.cmake
@@ -11,7 +11,6 @@ endif()
11string(REGEX MATCH "^arm" TARGET_ARCH_ARM "${CMAKE_SYSTEM_PROCESSOR}") 11string(REGEX MATCH "^arm" TARGET_ARCH_ARM "${CMAKE_SYSTEM_PROCESSOR}")
12if(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) 12if(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM)
13 return() 13 return()
14endif(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) 14endif()
15 15
16find_path(EMBEDDED_FOUND NAMES include/linux/imxfb.h include/bcm_host.h PATHS /opt/vc) 16find_path(EMBEDDED_FOUND NAMES include/linux/imxfb.h include/bcm_host.h PATHS /opt/vc)
17
diff --git a/project/cmake/modules/FindFFMPEG.cmake b/project/cmake/modules/FindFFMPEG.cmake
index 7f8e37f..a9f88fb 100644
--- a/project/cmake/modules/FindFFMPEG.cmake
+++ b/project/cmake/modules/FindFFMPEG.cmake
@@ -12,6 +12,18 @@ if(ENABLE_INTERNAL_FFMPEG)
12 if(FFMPEG_PATH) 12 if(FFMPEG_PATH)
13 message(WARNING "Internal FFmpeg enabled, but FFMPEG_PATH given, ignoring") 13 message(WARNING "Internal FFmpeg enabled, but FFMPEG_PATH given, ignoring")
14 endif() 14 endif()
15
16 # allow user to override the download URL with a local tarball
17 # needed for offline build envs
18 if(FFMPEG_URL)
19 get_filename_component(FFMPEG_URL "${FFMPEG_URL}" ABSOLUTE)
20 else()
21 set(FFMPEG_URL ${FFMPEG_BASE_URL}/${FFMPEG_VER}.tar.gz)
22 endif()
23 if(VERBOSE)
24 message(STATUS "FFMPEG_URL: ${FFMPEG_URL}")
25 endif()
26
15 if(CMAKE_CROSSCOMPILING) 27 if(CMAKE_CROSSCOMPILING)
16 set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} 28 set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH}
17 -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE} 29 -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE}
@@ -28,7 +40,9 @@ if(ENABLE_INTERNAL_FFMPEG)
28 endif() 40 endif()
29 41
30 externalproject_add(ffmpeg 42 externalproject_add(ffmpeg
31 URL ${FFMPEG_BASE_URL}/${FFMPEG_VER}.tar.gz 43 URL ${FFMPEG_URL}
44 DOWNLOAD_NAME ffmpeg-${FFMPEG_VER}.tar.gz
45 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
32 PREFIX ${CORE_BUILD_DIR}/ffmpeg 46 PREFIX ${CORE_BUILD_DIR}/ffmpeg
33 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 47 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
34 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 48 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -44,7 +58,7 @@ if(ENABLE_INTERNAL_FFMPEG)
44 58
45 file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper 59 file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper
46"#!/bin/bash 60"#!/bin/bash
47if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}-test* ]] 61if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]]
48then 62then
49 avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` 63 avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec`
50 avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat` 64 avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat`
@@ -53,8 +67,7 @@ then
53 swscale=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswscale` 67 swscale=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswscale`
54 swresample=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswresample` 68 swresample=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswresample`
55 gnutls=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors gnutls` 69 gnutls=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors gnutls`
56 vorbisenc=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors vorbisenc` 70 $@ $avcodec $avformat $avcodec $avfilter $swscale $swresample -lpostproc $gnutls
57 $@ $avcodec $avformat $avcodec $avfilter $swscale $swresample -lpostproc $gnutls $vorbisenc
58else 71else
59 $@ 72 $@
60fi") 73fi")
@@ -62,6 +75,7 @@ fi")
62 DESTINATION ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} 75 DESTINATION ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
63 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) 76 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
64 set(FFMPEG_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper <CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" PARENT_SCOPE) 77 set(FFMPEG_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper <CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" PARENT_SCOPE)
78 set(FFMPEG_CREATE_SHARED_LIBRARY "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper <CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" PARENT_SCOPE)
65 set(FFMPEG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) 79 set(FFMPEG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include)
66 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" 80 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\"
67 -DUSE_STATIC_FFMPEG=1) 81 -DUSE_STATIC_FFMPEG=1)
@@ -72,10 +86,11 @@ else()
72 endif() 86 endif()
73 set(FFMPEG_PKGS libavcodec>=56.26.100 libavfilter>=5.11.100 libavformat>=56.25.101 87 set(FFMPEG_PKGS libavcodec>=56.26.100 libavfilter>=5.11.100 libavformat>=56.25.101
74 libavutil>=54.20.100 libswscale>=3.1.101 libswresample>=1.1.100 libpostproc>=53.3.100) 88 libavutil>=54.20.100 libswscale>=3.1.101 libswresample>=1.1.100 libpostproc>=53.3.100)
75 if(PKG_CONFIG_FOUND) 89 if(PKG_CONFIG_FOUND AND NOT WIN32)
76 pkg_check_modules (FFMPEG ${FFMPEG_PKGS}) 90 pkg_check_modules (FFMPEG ${FFMPEG_PKGS})
77 string(REGEX REPLACE "framework;" "framework " FFMPEG_LDFLAGS "${FFMPEG_LDFLAGS}") 91 string(REGEX REPLACE "framework;" "framework " FFMPEG_LDFLAGS "${FFMPEG_LDFLAGS}")
78 set(FFMPEG_LIBRARIES ${FFMPEG_LDFLAGS}) 92 set(FFMPEG_LIBRARIES ${FFMPEG_LDFLAGS})
93 add_custom_target(ffmpeg)
79 else() 94 else()
80 find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h PATH_SUFFIXES ffmpeg) 95 find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h PATH_SUFFIXES ffmpeg)
81 find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec) 96 find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec)
@@ -94,5 +109,6 @@ else()
94 set(FFMPEG_FOUND 1) 109 set(FFMPEG_FOUND 1)
95 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\") 110 list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\")
96endif() 111endif()
112set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects")
97 113
98mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS FFMPEG_FOUND) 114mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS FFMPEG_FOUND)
diff --git a/project/cmake/modules/FindFreeType.cmake b/project/cmake/modules/FindFreeType.cmake
index a1e69ab..fb4c668 100644
--- a/project/cmake/modules/FindFreeType.cmake
+++ b/project/cmake/modules/FindFreeType.cmake
@@ -1,18 +1,45 @@
1# - Try to find freetype 1#.rst:
2# Once done this will define 2# FindFreetype
3# ------------
4# Finds the FreeType library
3# 5#
4# FREETYPE_FOUND - system has freetype 6# This will will define the following variables::
5# FREETYPE_INCLUDE_DIRS - the freetype include directory 7#
6# FREETYPE_LIBRARIES - The freetype libraries 8# FREETYPE_FOUND - system has FreeType
9# FREETYPE_INCLUDE_DIRS - the FreeType include directory
10# FREETYPE_LIBRARIES - the FreeType libraries
11#
12# and the following imported targets::
13#
14# FreeType::FreeType - The FreeType library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (FREETYPE freetype2) 17 pkg_check_modules(PC_FREETYPE freetype2 QUIET)
10else()
11 find_path(FREETYPE_INCLUDE_DIRS freetype/freetype.h)
12 find_library(FREETYPE_LIBRARIES NAMES freetype freetype246MT)
13endif() 18endif()
14 19
20find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h
21 PATHS ${PC_FREETYPE_INCLUDEDIR}
22 ${PC_FREETYPE_INCLUDE_DIRS})
23find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT
24 PATHS ${PC_FREETYPE_LIBDIR})
25
26set(FREETYPE_VERSION ${PC_FREETYPE_VERSION})
27
15include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(FreeType DEFAULT_MSG FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) 29find_package_handle_standard_args(FreeType
30 REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR
31 VERSION_VAR FREETYPE_VERSION)
32
33if(FREETYPE_FOUND)
34 set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
35 set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
36
37 if(NOT TARGET FreeType::FreeType)
38 add_library(FreeType::FreeType UNKNOWN IMPORTED)
39 set_target_properties(FreeType::FreeType PROPERTIES
40 IMPORTED_LOCATION "${FREETYPE_LIBRARY}"
41 INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIR}")
42 endif()
43endif()
17 44
18mark_as_advanced(FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) 45mark_as_advanced(FREETYPE_INCLUDE_DIR FREETYPE_LIBRARY)
diff --git a/project/cmake/modules/FindFribidi.cmake b/project/cmake/modules/FindFribidi.cmake
index 65a8d8b..03c2f53 100644
--- a/project/cmake/modules/FindFribidi.cmake
+++ b/project/cmake/modules/FindFribidi.cmake
@@ -1,18 +1,44 @@
1# - Try to find Fribidi 1#.rst:
2# Once done this will define 2# FindFribidi
3# -----------
4# Finds the GNU FriBidi library
3# 5#
4# FRIBIDI_FOUND - system has fribidi 6# This will will define the following variables::
5# FRIBIDI_INCLUDE_DIRS - the fribidi include directory 7#
6# FRIBIDI_LIBRARIES - The fribidi libraries 8# FRIBIDI_FOUND - system has FriBidi
9# FRIBIDI_INCLUDE_DIRS - the FriBidi include directory
10# FRIBIDI_LIBRARIES - the FriBidi libraries
11#
12# and the following imported targets::
13#
14# FriBidi::FriBidi - The FriBidi library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (FRIBIDI fribidi) 17 pkg_check_modules(PC_FRIBIDI fribidi QUIET)
10else()
11 find_path(FRIBIDI_INCLUDE_DIRS fribidi/fribidi.h)
12 find_library(FRIBIDI_LIBRARIES NAMES fribidi libfribidi)
13endif() 18endif()
14 19
20find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h
21 PATHS ${PC_FRIBIDI_INCLUDEDIR})
22find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi
23 PATHS ${PC_FRIBIDI_LIBDIR})
24
25set(FRIBIDI_VERSION ${PC_FRIBIDI_VERSION})
26
15include(FindPackageHandleStandardArgs) 27include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIRS FRIBIDI_LIBRARIES) 28find_package_handle_standard_args(FriBidi
29 REQUIRED_VARS FRIBIDI_LIBRARY FRIBIDI_INCLUDE_DIR
30 VERSION_VAR FRIBIDI_VERSION)
31
32if(FRIBIDI_FOUND)
33 set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
34 set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR})
35
36 if(NOT TARGET FriBidi::FriBidi)
37 add_library(FriBidi::FriBidi UNKNOWN IMPORTED)
38 set_target_properties(FriBidi::FriBidi PROPERTIES
39 IMPORTED_LOCATION "${FRIBIDI_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}")
41 endif()
42endif()
17 43
18mark_as_advanced(FRIBIDI_INCLUDE_DIRS FRIBIDI_LIBRARIES) 44mark_as_advanced(FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
diff --git a/project/cmake/modules/FindJsonSchemaBuilder.cmake b/project/cmake/modules/FindJsonSchemaBuilder.cmake
index 78e8d0a..ecff1e4 100644
--- a/project/cmake/modules/FindJsonSchemaBuilder.cmake
+++ b/project/cmake/modules/FindJsonSchemaBuilder.cmake
@@ -12,8 +12,10 @@ if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder)
12 add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) 12 add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL)
13 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES 13 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES
14 IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") 14 IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder")
15 set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES FOLDER Tools)
15 else() 16 else()
16 add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) 17 add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder)
17 add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) 18 add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder)
19 set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools)
18 endif() 20 endif()
19endif() 21endif()
diff --git a/project/cmake/modules/FindLibDRM.cmake b/project/cmake/modules/FindLibDRM.cmake
new file mode 100644
index 0000000..35d632e
--- /dev/null
+++ b/project/cmake/modules/FindLibDRM.cmake
@@ -0,0 +1,45 @@
1#.rst:
2# FindLibDRM
3# ----------
4# Finds the LibDRM library
5#
6# This will will define the following variables::
7#
8# LIBDRM_FOUND - system has LibDRM
9# LIBDRM_INCLUDE_DIRS - the LibDRM include directory
10# LIBDRM_LIBRARIES - the LibDRM libraries
11#
12# and the following imported targets::
13#
14# LibDRM::LibDRM - The LibDRM library
15
16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_LIBDRM libdrm QUIET)
18endif()
19
20find_path(LIBDRM_INCLUDE_DIR NAMES drm.h
21 PATH_SUFFIXES libdrm drm
22 PATHS ${PC_LIBDRM_INCLUDEDIR})
23find_library(LIBDRM_LIBRARY NAMES drm
24 PATHS ${PC_LIBDRM_LIBDIR})
25
26set(LIBDRM_VERSION ${PC_LIBDRM_VERSION})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(LibDRM
30 REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR
31 VERSION_VAR LIBDRM_VERSION)
32
33if(LIBDRM_FOUND)
34 set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY})
35 set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR})
36
37 if(NOT TARGET LIBDRM::LIBDRM)
38 add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED)
39 set_target_properties(LIBDRM::LIBDRM PROPERTIES
40 IMPORTED_LOCATION "${LIBDRM_LIBRARY}"
41 INTERFACE_INCLUDE_DIRECTORIES "${LIBDRM_INCLUDE_DIR}")
42 endif()
43endif()
44
45mark_as_advanced(LIBDRM_INCLUDE_DIR LIBDRM_LIBRARY)
diff --git a/project/cmake/modules/FindLibDvd.cmake b/project/cmake/modules/FindLibDvd.cmake
index f281773..fa644d6 100644
--- a/project/cmake/modules/FindLibDvd.cmake
+++ b/project/cmake/modules/FindLibDvd.cmake
@@ -1,106 +1,206 @@
1set(dvdlibs libdvdread libdvdnav)
2if(ENABLE_DVDCSS)
3 list(APPEND dvdlibs libdvdcss)
4endif()
5
6if(NOT WIN32) 1if(NOT WIN32)
7 foreach(dvdlib ${dvdlibs})
8 file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION)
9 file(STRINGS ${VERSION_FILE} VER)
10 string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}")
11 list(GET ${dvdlib}_VER 0 ${dvdlib}_VER)
12 string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER)
13 string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}")
14 list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL)
15 string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL)
16 endforeach()
17
18 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
19 if(CMAKE_CROSSCOMPILING) 2 if(CMAKE_CROSSCOMPILING)
20 set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}") 3 set(_dvdlibs dvdread dvdnav)
21 endif() 4 set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY)
5 if(ENABLE_DVDCSS)
6 list(APPEND _dvdlibs libdvdcss)
7 list(APPEND _handlevars DVDCSS_LIBRARY)
8 endif()
9
10 if(PKG_CONFIG_FOUND)
11 pkg_check_modules(PC_DVD ${_dvdlibs} QUIET)
12 endif()
13
14 find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS})
15 find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR})
16 find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR})
17 if(ENABLE_DVDCSS)
18 find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR})
19 endif()
20
21 include(FindPackageHandleStandardArgs)
22 find_package_handle_standard_args(LIBDVD REQUIRED_VARS ${_handlevars})
23 if(LIBDVD_FOUND)
24 add_library(dvdnav UNKNOWN IMPORTED)
25 set_target_properties(dvdnav PROPERTIES
26 FOLDER "External Projects"
27 IMPORTED_LOCATION "${DVDNAV_LIBRARY}")
28
29 add_library(dvdread UNKNOWN IMPORTED)
30 set_target_properties(dvdread PROPERTIES
31 FOLDER "External Projects"
32 IMPORTED_LOCATION "${DVDREAD_LIBRARY}")
33 add_library(dvdcss UNKNOWN IMPORTED)
34 set_target_properties(dvdcss PROPERTIES
35 FOLDER "External Projects"
36 IMPORTED_LOCATION "${DVDCSS_LIBRARY}")
22 37
23 if(APPLE) 38 set(_linklibs ${DVDREAD_LIBRARY})
39 if(ENABLE_DVDCSS)
40 list(APPEND _linklibs ${DVDCSS_LIBRARY})
41 endif()
42 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_linklibs}")
43 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY})
44 mark_as_advanced(LIBDVD_INCLUDE_DIRS LIBDVD_LIBRARIES)
45 endif()
46 else()
47 set(dvdlibs libdvdread libdvdnav)
48 if(ENABLE_DVDCSS)
49 list(APPEND dvdlibs libdvdcss)
50 endif()
51 foreach(dvdlib ${dvdlibs})
52 file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION)
53 file(STRINGS ${VERSION_FILE} VER)
54 string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}")
55 list(GET ${dvdlib}_VER 0 ${dvdlib}_VER)
56 string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER)
57 string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}")
58 list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL)
59 string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL)
60 string(TOUPPER ${dvdlib} DVDLIB)
61
62 # allow user to override the download URL with a local tarball
63 # needed for offline build envs
64 # allow upper and lowercase var name
65 if(${dvdlib}_URL)
66 set(${DVDLIB}_URL ${${dvdlib}_URL})
67 endif()
68 if(${DVDLIB}_URL)
69 get_filename_component(${DVDLIB}_URL "${${DVDLIB}_URL}" ABSOLUTE)
70 else()
71 set(${DVDLIB}_URL ${${dvdlib}_BASE_URL}/archive/${${dvdlib}_VER}.tar.gz)
72 endif()
73 if(VERBOSE)
74 message(STATUS "${DVDLIB}_URL: ${${DVDLIB}_URL}")
75 endif()
76 endforeach()
77
78 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
79 if(CMAKE_CROSSCOMPILING)
80 set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}")
81 endif()
82
83 if(APPLE)
24 set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") 84 set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation")
25 endif() 85 endif()
86
87 set(HOST_ARCH ${ARCH})
88 if(CORE_SYSTEM_NAME STREQUAL android)
89 if(ARCH STREQUAL arm)
90 set(HOST_ARCH arm-linux-androideabi)
91 elseif(ARCH STREQUAL aarch64)
92 set(HOST_ARCH aarch64-linux-android)
93 elseif(ARCH STREQUAL i486-linux)
94 set(HOST_ARCH i686-linux-android)
95 endif()
96 endif()
26 97
27 if(ENABLE_DVDCSS) 98 if(ENABLE_DVDCSS)
28 ExternalProject_ADD(dvdcss URL ${libdvdcss_BASE_URL}/archive/${libdvdcss_VER}.tar.gz 99 set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a)
100 ExternalProject_Add(dvdcss URL ${LIBDVDCSS_URL}
101 DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz
102 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
103 PREFIX ${CORE_BUILD_DIR}/libdvd
104 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
105 --target=${HOST_ARCH}
106 --host=${HOST_ARCH}
107 --disable-doc
108 --enable-static
109 --disable-shared
110 --with-pic
111 --prefix=<INSTALL_DIR>
112 --libdir=<INSTALL_DIR>/lib
113 "${EXTRA_FLAGS}"
114 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
115 "LDFLAGS=${CMAKE_LD_FLAGS}"
116 BUILD_BYPRODUCTS ${DVDCSS_LIBRARY})
117 ExternalProject_Add_Step(dvdcss autoreconf
118 DEPENDEES download update patch
119 DEPENDERS configure
120 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
121 WORKING_DIRECTORY <SOURCE_DIR>)
122
123 set_target_properties(dvdcss PROPERTIES FOLDER "External Projects")
124 endif()
125
126 set(DVDREAD_CFLAGS "-D_XBMC")
127 if(ENABLE_DVDCSS)
128 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include")
129 endif()
130
131 set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a)
132 ExternalProject_Add(dvdread URL ${LIBDVDREAD_URL}
133 DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz
134 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
135 PREFIX ${CORE_BUILD_DIR}/libdvd
136 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
137 --target=${HOST_ARCH}
138 --host=${HOST_ARCH}
139 --enable-static
140 --disable-shared
141 --with-pic
142 --prefix=<INSTALL_DIR>
143 --libdir=<INSTALL_DIR>/lib
144 "${EXTRA_FLAGS}"
145 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
146 "LDFLAGS=${CMAKE_LD_FLAGS}"
147 BUILD_BYPRODUCTS ${DVDREAD_LIBRARY})
148 ExternalProject_Add_Step(dvdread autoreconf
149 DEPENDEES download update patch
150 DEPENDERS configure
151 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
152 WORKING_DIRECTORY <SOURCE_DIR>)
153 if(ENABLE_DVDCSS)
154 add_dependencies(dvdread dvdcss)
155 endif()
156
157 set_target_properties(dvdread PROPERTIES FOLDER "External Projects")
158
159 if(ENABLE_DVDCSS)
160 set(DVDNAV_LIBS -ldvdcss)
161 endif()
162
163 set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a)
164 ExternalProject_Add(dvdnav URL ${LIBDVDNAV_URL}
165 DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz
166 DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download
29 PREFIX ${CORE_BUILD_DIR}/libdvd 167 PREFIX ${CORE_BUILD_DIR}/libdvd
30 UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
31 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure 168 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
32 --target=${ARCH} 169 --target=${HOST_ARCH}
33 --host=${ARCH} 170 --host=${HOST_ARCH}
34 --disable-doc 171 --enable-static
35 --enable-static 172 --disable-shared
36 --disable-shared 173 --with-pic
37 --with-pic 174 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
38 --prefix=<INSTALL_DIR> 175 --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib
39 "${EXTRA_FLAGS}" 176 "${EXTRA_FLAGS}"
40 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" 177 "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib"
41 "LDFLAGS=${CMAKE_LD_FLAGS}") 178 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
42 179 "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}"
43 core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a 180 "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la"
44 system/players/VideoPlayer/libdvdcss dvdcss) 181 "LIBS=${DVDNAV_LIBS}"
45 endif() 182 BUILD_BYPRODUCTS ${DVDNAV_LIBRARY})
183 ExternalProject_Add_Step(dvdnav autoreconf
184 DEPENDEES download update patch
185 DEPENDERS configure
186 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
187 WORKING_DIRECTORY <SOURCE_DIR>)
188 add_dependencies(dvdnav dvdread)
189 set_target_properties(dvdnav PROPERTIES FOLDER "External Projects")
46 190
47 set(DVDREAD_CFLAGS "-D_XBMC") 191 set(_dvdlibs ${DVDREAD_LIBRARY} ${DVDCSS_LIBRARY})
48 if(ENABLE_DVDCSS) 192 # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well
49 set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") 193 # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically
50 endif(ENABLE_DVDCSS) 194 core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_dvdlibs}")
51
52 ExternalProject_ADD(dvdread URL ${libdvdread_BASE_URL}/archive/${libdvdread_VER}.tar.gz
53 PREFIX ${CORE_BUILD_DIR}/libdvd
54 UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
55 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
56 --target=${ARCH}
57 --host=${ARCH}
58 --enable-static
59 --disable-shared
60 --with-pic
61 --prefix=<INSTALL_DIR>
62 "${EXTRA_FLAGS}"
63 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
64 "LDFLAGS=${CMAKE_LD_FLAGS}")
65 if(ENABLE_DVDCSS)
66 add_dependencies(dvdread dvdcss)
67 endif()
68 195
69 core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a 196 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include)
70 system/players/VideoPlayer/libdvdread dvdread) 197 set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY})
71 198 if(ENABLE_DVDCSS)
72 if(ENABLE_DVDCSS) 199 list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY})
73 set(DVDNAV_LIBS -ldvdcss) 200 endif()
74 endif(ENABLE_DVDCSS) 201 set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE)
75 202 set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE)
76 ExternalProject_ADD(dvdnav URL ${libdvdnav_BASE_URL}/archive/${libdvdnav_VER}.tar.gz 203 endif()
77 PREFIX ${CORE_BUILD_DIR}/libdvd
78 UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif
79 CONFIGURE_COMMAND ac_cv_path_GIT= <SOURCE_DIR>/configure
80 --target=${ARCH}
81 --host=${ARCH}
82 --enable-static
83 --disable-shared
84 --with-pic
85 --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd
86 "${EXTRA_FLAGS}"
87 "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib"
88 "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}"
89 "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}"
90 "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la"
91 "LIBS=${DVDNAV_LIBS}")
92 add_dependencies(dvdnav dvdread)
93 core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a
94 system/players/VideoPlayer/libdvdnav dvdnav)
95
96 set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include)
97 set(LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a
98 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a)
99 if(ENABLE_DVDCSS)
100 list(APPEND LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a)
101 endif()
102 set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE)
103 set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE)
104else() 204else()
105 # Dynamically loaded on Windows 205 # Dynamically loaded on Windows
106 find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CORE_SOURCE_DIR}/lib/libdvd/include) 206 find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CORE_SOURCE_DIR}/lib/libdvd/include)
@@ -110,6 +210,9 @@ else()
110 210
111 if(LIBDVD_FOUND) 211 if(LIBDVD_FOUND)
112 set(LIBDVD_INCLUDE_DIRS ${LIBDVD_INCLUDE_DIR}) 212 set(LIBDVD_INCLUDE_DIRS ${LIBDVD_INCLUDE_DIR})
213
214 add_custom_target(dvdnav)
215 set_target_properties(dvdnav PROPERTIES FOLDER "External Projects")
113 endif() 216 endif()
114 217
115 mark_as_advanced(LIBDVD_INCLUDE_DIR) 218 mark_as_advanced(LIBDVD_INCLUDE_DIR)
diff --git a/project/cmake/modules/FindLibSmbClient.cmake b/project/cmake/modules/FindLibSmbClient.cmake
deleted file mode 100644
index 897fa7b..0000000
--- a/project/cmake/modules/FindLibSmbClient.cmake
+++ /dev/null
@@ -1,65 +0,0 @@
1# - Try to find Libsmbclient
2
3if(PKGCONFIG_FOUND)
4 pkg_check_modules(LIBSMBCLIENT smbclient)
5 set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1)
6endif()
7
8if (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS)
9 # in cache already
10 set(LIBSMBCLIENT_FOUND TRUE)
11else (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS)
12 find_path(LIBSMBCLIENT_INCLUDE_DIR
13 NAMES
14 libsmbclient.h
15 PATHS
16 /usr/include
17 /usr/local/include
18 /opt/local/include
19 /sw/include
20 )
21
22 find_library(SMBCLIENT_LIBRARY
23 NAMES
24 smbclient
25 PATHS
26 /usr/lib
27 /usr/local/lib
28 /opt/local/lib
29 /sw/lib
30 )
31
32 if (SMBCLIENT_LIBRARY)
33 set(SMBCLIENT_FOUND TRUE)
34 endif (SMBCLIENT_LIBRARY)
35
36 set(LIBSMBCLIENT_INCLUDE_DIRS
37 ${LIBSMBCLIENT_INCLUDE_DIR}
38 )
39
40 if (SMBCLIENT_FOUND)
41 set(LIBSMBCLIENT_LIBRARIES
42 ${LIBSMBCLIENT_LIBRARIES}
43 ${SMBCLIENT_LIBRARY}
44 )
45 endif (SMBCLIENT_FOUND)
46
47 if (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES)
48 set(LIBSMBCLIENT_FOUND TRUE)
49 endif (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES)
50
51 if (LIBSMBCLIENT_FOUND)
52 if (NOT Libsmbclient_FIND_QUIETLY)
53 message(STATUS "Found Libsmbclient: ${LIBSMBCLIENT_LIBRARIES}")
54 endif (NOT Libsmbclient_FIND_QUIETLY)
55 else (LIBSMBCLIENT_FOUND)
56 if (Libsmbclient_FIND_REQUIRED)
57 message(FATAL_ERROR "Could not find Libsmbclient")
58 endif (Libsmbclient_FIND_REQUIRED)
59 endif (LIBSMBCLIENT_FOUND)
60 set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1)
61
62 # show the LIBSMBCLIENT_INCLUDE_DIRS and LIBSMBCLIENT_LIBRARIES variables only in the advanced view
63 mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIRS LIBSMBCLIENT_LIBRARIES LIBSMBCLIENT_DEFINITIONS)
64
65endif (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS)
diff --git a/project/cmake/modules/FindLibXml2.cmake b/project/cmake/modules/FindLibXml2.cmake
new file mode 100644
index 0000000..caeb945
--- /dev/null
+++ b/project/cmake/modules/FindLibXml2.cmake
@@ -0,0 +1,84 @@
1#.rst:
2# FindLibXml2
3# -----------
4#
5# Try to find the LibXml2 xml processing library
6#
7# Once done this will define
8#
9# ::
10#
11# LIBXML2_FOUND - System has LibXml2
12# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
13# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
14# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
15# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
16# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
17
18#=============================================================================
19# Copyright 2006-2009 Kitware, Inc.
20# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
21# Copyright 2016 Team Kodi
22#
23# Distributed under the OSI-approved BSD License (the "License");
24# see accompanying file Copyright.txt for details.
25#
26# This software is distributed WITHOUT ANY WARRANTY; without even the
27# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28# See the License for more information.
29#=============================================================================
30# (To distribute this file outside of CMake, substitute the full
31# License text for the above reference.)
32
33# use pkg-config to get the directories and then use these values
34# in the find_path() and find_library() calls
35find_package(PkgConfig QUIET)
36PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
37set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
38
39find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
40 HINTS
41 ${PC_LIBXML_INCLUDEDIR}
42 ${PC_LIBXML_INCLUDE_DIRS}
43 PATH_SUFFIXES libxml2
44 )
45
46find_library(LIBXML2_LIBRARY NAMES xml2 libxml2
47 HINTS
48 ${PC_LIBXML_LIBDIR}
49 ${PC_LIBXML_LIBRARY_DIRS}
50 )
51
52find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint)
53# for backwards compat. with KDE 4.0.x:
54set(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
55
56# Make sure to use static flags if apropriate
57if(PC_LIBXML_FOUND)
58 if(${LIBXML2_LIBRARY} MATCHES ".+\.a$" AND PC_LIBXML_STATIC_LDFLAGS)
59 set(LIBXML2_LIBRARY ${LIBXML2_LIBRARY} ${PC_LIBXML_STATIC_LDFLAGS})
60 endif()
61endif()
62
63if(PC_LIBXML_VERSION)
64 set(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION})
65elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h")
66 file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str
67 REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"")
68 string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
69 LIBXML2_VERSION_STRING "${libxml2_version_str}")
70 unset(libxml2_version_str)
71endif()
72
73
74include(FindPackageHandleStandardArgs)
75FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
76 REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR
77 VERSION_VAR LIBXML2_VERSION_STRING)
78
79if(LibXml2_FOUND)
80 set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
81 set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
82endif()
83
84mark_as_advanced(LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
diff --git a/project/cmake/modules/FindLzo2.cmake b/project/cmake/modules/FindLzo2.cmake
index 33eee10..4f7313f 100644
--- a/project/cmake/modules/FindLzo2.cmake
+++ b/project/cmake/modules/FindLzo2.cmake
@@ -1,22 +1,37 @@
1# - Try to find Lzo2 1#.rst:
2# Once done this will define 2# FindLzo2
3# --------
4# Finds the Lzo2 library
3# 5#
4# Lzo2_FOUND - system has Lzo2 6# This will will define the following variables::
5# Lzo2_INCLUDE_DIR - the Lzo2 include directory
6# Lzo2_LIBRARIES - Link these to use Lzo2
7# Lzo2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
8
9# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
10# 7#
11# Redistribution and use is allowed according to the terms of the BSD license. 8# LZO2_FOUND - system has Lzo2
12# For details see the accompanying COPYING-CMAKE-SCRIPTS file. 9# LZO2_INCLUDE_DIRS - the Lzo2 include directory
13 10# LZO2_LIBRARIES - the Lzo2 libraries
11#
12# and the following imported targets::
13#
14# Lzo2::Lzo2 - The Lzo2 library
14 15
15FIND_PATH(LZO2_INCLUDE_DIRS lzo1x.h PATH_SUFFIXES lzo) 16find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h
17 PATH_SUFFIXES lzo)
16 18
17FIND_LIBRARY(LZO2_LIBRARIES NAMES lzo2 liblzo2) 19find_library(LZO2_LIBRARY NAMES lzo2 liblzo2)
18 20
19include(FindPackageHandleStandardArgs) 21include(FindPackageHandleStandardArgs)
20find_package_handle_standard_args(Lzo2 DEFAULT_MSG LZO2_INCLUDE_DIRS LZO2_LIBRARIES) 22find_package_handle_standard_args(Lzo2
23 REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR)
24
25if(LZO2_FOUND)
26 set(LZO2_LIBRARIES ${LZO2_LIBRARY})
27 set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR})
28
29 if(NOT TARGET Lzo2::Lzo2)
30 add_library(Lzo2::Lzo2 UNKNOWN IMPORTED)
31 set_target_properties(Lzo2::Lzo2 PROPERTIES
32 IMPORTED_LOCATION "${LZO2_LIBRARY}"
33 INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}")
34 endif()
35endif()
21 36
22MARK_AS_ADVANCED(LZO2_INCLUDE_DIRS LZO2_LIBRARIES) 37mark_as_advanced(LZO2_INCLUDE_DIR LZO2_LIBRARY)
diff --git a/project/cmake/modules/FindMicroHttpd.cmake b/project/cmake/modules/FindMicroHttpd.cmake
index f73dc77..7d011fa 100644
--- a/project/cmake/modules/FindMicroHttpd.cmake
+++ b/project/cmake/modules/FindMicroHttpd.cmake
@@ -1,106 +1,49 @@
1IF (NOT WIN32) 1#.rst:
2 include(FindPkgConfig) 2# FindMicroHttpd
3 if ( PKG_CONFIG_FOUND ) 3# --------------
4 4# Finds the MicroHttpd library
5 pkg_check_modules (MICROHTTPD libmicrohttpd>=0.4)
6
7 set(MICROHTTPD_DEFINITIONS ${MICROHTTPD_CFLAGS_OTHER})
8 endif(PKG_CONFIG_FOUND)
9endif (NOT WIN32)
10
11# 5#
12# set defaults 6# This will will define the following variables::
13if(NOT MICROHTTPD_FOUND) 7#
14 SET(_microhttpd_HOME "/usr/local") 8# MICROHTTPD_FOUND - system has MicroHttpd
15 SET(_microhttpd_INCLUDE_SEARCH_DIRS 9# MICROHTTPD_INCLUDE_DIRS - the MicroHttpd include directory
16 ${CMAKE_INCLUDE_PATH} 10# MICROHTTPD_LIBRARIES - the MicroHttpd libraries
17 /usr/local/include 11# MICROHTTPD_DEFINITIONS - the MicroHttpd definitions
18 /usr/include 12#
19 ) 13# and the following imported targets::
20 14#
21 SET(_microhttpd_LIBRARIES_SEARCH_DIRS 15# MicroHttpd::MicroHttpd - The MicroHttpd library
22 ${CMAKE_LIBRARY_PATH}
23 /usr/local/lib
24 /usr/lib
25 )
26
27 ##
28 if( "${MICROHTTPD_HOME}" STREQUAL "")
29 if("" MATCHES "$ENV{MICROHTTPD_HOME}")
30 message(STATUS "MICROHTTPD_HOME env is not set, setting it to /usr/local")
31 set (MICROHTTPD_HOME ${_microhttpd_HOME})
32 else("" MATCHES "$ENV{MICROHTTPD_HOME}")
33 set (MICROHTTPD_HOME "$ENV{MICROHTTPD_HOME}")
34 endif("" MATCHES "$ENV{MICROHTTPD_HOME}")
35 else( "${MICROHTTPD_HOME}" STREQUAL "")
36 message(STATUS "MICROHTTPD_HOME is not empty: \"${MICROHTTPD_HOME}\"")
37 endif( "${MICROHTTPD_HOME}" STREQUAL "")
38 ##
39
40 message(STATUS "Looking for microhttpd in ${MICROHTTPD_HOME}")
41
42 IF( NOT ${MICROHTTPD_HOME} STREQUAL "" )
43 SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS})
44 SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS})
45 SET(_microhttpd_HOME ${MICROHTTPD_HOME})
46 ENDIF( NOT ${MICROHTTPD_HOME} STREQUAL "" )
47
48 IF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" )
49 SET(_microhttpd_INCLUDE_SEARCH_DIRS $ENV{MICROHTTPD_INCLUDEDIR} ${_microhttpd_INCLUDE_SEARCH_DIRS})
50 ENDIF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" )
51 16
52 IF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) 17if(PKG_CONFIG_FOUND)
53 SET(_microhttpd_LIBRARIES_SEARCH_DIRS $ENV{MICROHTTPD_LIBRARYDIR} ${_microhttpd_LIBRARIES_SEARCH_DIRS}) 18 pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.4 QUIET)
54 ENDIF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) 19endif()
55 20
56 IF( MICROHTTPD_HOME ) 21find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h
57 SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) 22 PATHS ${PC_MICROHTTPD_INCLUDEDIR})
58 SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) 23find_library(MICROHTTPD_LIBRARY NAMES microhttpd libmicrohttpd
59 SET(_microhttpd_HOME ${MICROHTTPD_HOME}) 24 PATHS ${PC_MICROHTTPD_LIBDIR})
60 ENDIF( MICROHTTPD_HOME )
61 25
62 # find the include files 26set(MICROHTTPD_VERSION ${PC_MICROHTTPD_VERSION})
63 FIND_PATH(MICROHTTPD_INCLUDE_DIRS microhttpd.h
64 HINTS
65 ${_microhttpd_INCLUDE_SEARCH_DIRS}
66 ${PC_MICROHTTPD_INCLUDEDIR}
67 ${PC_MICROHTTPD_INCLUDE_DIRS}
68 ${CMAKE_INCLUDE_PATH}
69 )
70 27
71 # locate the library 28include(FindPackageHandleStandardArgs)
72 IF(WIN32) 29find_package_handle_standard_args(MicroHttpd
73 SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.lib) 30 REQUIRED_VARS MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR
74 ELSE(WIN32) 31 VERSION_VAR MICROHTTPD_VERSION)
75 SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.a)
76 ENDIF(WIN32)
77 FIND_LIBRARY(MICROHTTPD_LIBRARIES NAMES ${MICROHTTPD_LIBRARY_NAMES}
78 HINTS
79 ${_microhttpd_LIBRARIES_SEARCH_DIRS}
80 ${PC_MICROHTTPD_LIBDIR}
81 ${PC_MICROHTTPD_LIBRARY_DIRS}
82 )
83 32
84 # if the include and the program are found then we have it 33if(MICROHTTPD_FOUND)
85 IF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) 34 set(MICROHTTPD_LIBRARIES ${MICROHTTPD_LIBRARY})
86 SET(MICROHTTPD_FOUND "YES") 35 set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR})
87 ENDIF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) 36 set(MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1)
88 37
89 if( NOT WIN32) 38 if(NOT WIN32)
90 find_library(GCRYPT_LIBRARY gcrypt) 39 find_library(GCRYPT_LIBRARY gcrypt)
91 find_library(GPGERROR_LIBRARY gpg-error) 40 find_library(GPGERROR_LIBRARY gpg-error)
92 list(APPEND MICROHTTPD_LIBRARIES ${GCRYPT_LIBRARY} ${GPGERROR_LIBRARY}) 41 list(APPEND MICROHTTPD_LIBRARIES ${GCRYPT_LIBRARY} ${GPGERROR_LIBRARY})
42 mark_as_advanced(GCRYPT_LIBRARY GPGERROR_LIBRARY)
93 if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android) 43 if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android)
94 list(APPEND MICROHTTPD_LIBRARIES "-lrt") 44 list(APPEND MICROHTTPD_LIBRARIES "-lrt")
95 endif() 45 endif()
96 endif( NOT WIN32) 46 endif()
97endif() 47endif()
98 48
99list(APPEND MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) 49mark_as_advanced(MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR)
100
101MARK_AS_ADVANCED(
102 MICROHTTPD_FOUND
103 MICROHTTPD_LIBRARIES
104 MICROHTTPD_DEFINITIONS
105 MICROHTTPD_INCLUDE_DIRS
106)
diff --git a/project/cmake/modules/FindMySqlClient.cmake b/project/cmake/modules/FindMySqlClient.cmake
index 2295c81..ceccea3 100644
--- a/project/cmake/modules/FindMySqlClient.cmake
+++ b/project/cmake/modules/FindMySqlClient.cmake
@@ -14,18 +14,34 @@
14# 14#
15# MySqlClient::MySqlClient - The MySqlClient library 15# MySqlClient::MySqlClient - The MySqlClient library
16 16
17# Don't find system wide installed version on Windows
18if(WIN32)
19 set(EXTRA_FIND_ARGS NO_SYSTEM_ENVIRONMENT_PATH)
20else()
21 set(EXTRA_FIND_ARGS)
22endif()
23
17find_path(MYSQLCLIENT_INCLUDE_DIR mysql/mysql_time.h) 24find_path(MYSQLCLIENT_INCLUDE_DIR mysql/mysql_time.h)
18find_library(MYSQLCLIENT_LIBRARY_RELEASE NAMES mysqlclient libmysql 25find_library(MYSQLCLIENT_LIBRARY_RELEASE NAMES mysqlclient libmysql
19 PATH_SUFFIXES mysql) 26 PATH_SUFFIXES mysql
27 ${EXTRA_FIND_ARGS})
20find_library(MYSQLCLIENT_LIBRARY_DEBUG NAMES mysqlclient libmysql 28find_library(MYSQLCLIENT_LIBRARY_DEBUG NAMES mysqlclient libmysql
21 PATH_SUFFIXES mysql) 29 PATH_SUFFIXES mysql
30 ${EXTRA_FIND_ARGS})
31
32if(MYSQLCLIENT_INCLUDE_DIR AND EXISTS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h")
33 file(STRINGS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h" mysql_version_str REGEX "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\".*\".*")
34 string(REGEX REPLACE "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\"([^\"]+)\".*" "\\1" MYSQLCLIENT_VERSION_STRING "${mysql_version_str}")
35 unset(mysql_version_str)
36endif()
22 37
23include(SelectLibraryConfigurations) 38include(SelectLibraryConfigurations)
24select_library_configurations(MYSQLCLIENT) 39select_library_configurations(MYSQLCLIENT)
25 40
26include(FindPackageHandleStandardArgs) 41include(FindPackageHandleStandardArgs)
27find_package_handle_standard_args(MYSQLCLIENT 42find_package_handle_standard_args(MySqlClient
28 REQUIRED_VARS MYSQLCLIENT_LIBRARY MYSQLCLIENT_INCLUDE_DIR) 43 REQUIRED_VARS MYSQLCLIENT_LIBRARY MYSQLCLIENT_INCLUDE_DIR
44 VERSION_VAR MYSQLCLIENT_VERSION_STRING)
29 45
30if(MYSQLCLIENT_FOUND) 46if(MYSQLCLIENT_FOUND)
31 set(MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARY}) 47 set(MYSQLCLIENT_LIBRARIES ${MYSQLCLIENT_LIBRARY})
diff --git a/project/cmake/modules/FindNFS.cmake b/project/cmake/modules/FindNFS.cmake
index 3fd9d61..646ee33 100644
--- a/project/cmake/modules/FindNFS.cmake
+++ b/project/cmake/modules/FindNFS.cmake
@@ -15,7 +15,7 @@
15# NFS::NFS - The libnfs library 15# NFS::NFS - The libnfs library
16 16
17if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(NFS libnfs QUIET) 18 pkg_check_modules(PC_NFS libnfs QUIET)
19endif() 19endif()
20 20
21find_path(NFS_INCLUDE_DIR nfsc/libnfs.h 21find_path(NFS_INCLUDE_DIR nfsc/libnfs.h
diff --git a/project/cmake/modules/FindOpenGLES.cmake b/project/cmake/modules/FindOpenGLES.cmake
index 5d71dd4..ab06f96 100644
--- a/project/cmake/modules/FindOpenGLES.cmake
+++ b/project/cmake/modules/FindOpenGLES.cmake
@@ -13,7 +13,7 @@
13find_package(EMBEDDED) 13find_package(EMBEDDED)
14 14
15if(PKG_CONFIG_FOUND AND NOT PLATFORM STREQUAL "raspberry-pi") 15if(PKG_CONFIG_FOUND AND NOT PLATFORM STREQUAL "raspberry-pi")
16 pkg_check_modules(PC_OPENGLES glesv2) 16 pkg_check_modules(PC_OPENGLES glesv2 QUIET)
17 if(NOT OPENGLES_FOUND AND EMBEDDED_FOUND) 17 if(NOT OPENGLES_FOUND AND EMBEDDED_FOUND)
18 set(CMAKE_PREFIX_PATH ${EMBEDDED_FOUND} ${CMAKE_PREFIX_PATH}) 18 set(CMAKE_PREFIX_PATH ${EMBEDDED_FOUND} ${CMAKE_PREFIX_PATH})
19 endif() 19 endif()
diff --git a/project/cmake/modules/FindOpenGl.cmake b/project/cmake/modules/FindOpenGl.cmake
index 9d6ec01..b8cff79 100644
--- a/project/cmake/modules/FindOpenGl.cmake
+++ b/project/cmake/modules/FindOpenGl.cmake
@@ -11,10 +11,10 @@
11# OPENGL_DEFINITIONS - the OpenGl definitions 11# OPENGL_DEFINITIONS - the OpenGl definitions
12 12
13if(PKG_CONFIG_FOUND) 13if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_OPENGL gl glu) 14 pkg_check_modules(PC_OPENGL gl glu QUIET)
15endif() 15endif()
16 16
17if(NOT CORE_SYSTEM_NAME STREQUAL darwin) 17if(NOT CORE_SYSTEM_NAME STREQUAL osx)
18 find_path(OPENGL_INCLUDE_DIR GL/gl.h 18 find_path(OPENGL_INCLUDE_DIR GL/gl.h
19 PATHS ${PC_OPENGL_gl_INCLUDEDIR}) 19 PATHS ${PC_OPENGL_gl_INCLUDEDIR})
20 find_library(OPENGL_gl_LIBRARY NAMES GL 20 find_library(OPENGL_gl_LIBRARY NAMES GL
diff --git a/project/cmake/modules/FindPulseAudio.cmake b/project/cmake/modules/FindPulseAudio.cmake
index 5b57364..5761005 100644
--- a/project/cmake/modules/FindPulseAudio.cmake
+++ b/project/cmake/modules/FindPulseAudio.cmake
@@ -1,72 +1,68 @@
1# Try to find the PulseAudio library 1#.rst:
2# FindPulseAudio
3# --------------
4# Finds the PulseAudio library
2# 5#
3# Once done this will define: 6# This will define the following variables::
4# 7#
5# PULSEAUDIO_FOUND - system has the PulseAudio library 8# PULSEAUDIO_FOUND - system has the PulseAudio library
6# PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory 9# PULSEAUDIO_INCLUDE_DIRS - the PulseAudio include directory
7# PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio 10# PULSEAUDIO_LIBRARIES - the libraries needed to use PulseAudio
8# PULSEAUDIO_MAINLOOP_LIBRARY - the libraries needed to use PulsAudio Mailoop 11# PULSEAUDIO_DEFINITIONS - the definitions needed to use PulseAudio
9# 12#
10# Copyright (c) 2008, Matthias Kretz, <kretz@kde.org> 13# and the following imported targets::
11# Copyright (c) 2009, Marcus Hufgard, <Marcus.Hufgard@hufgard.de>
12# 14#
13# Redistribution and use is allowed according to the terms of the BSD license. 15# PulseAudio::PulseAudio - The PulseAudio library
14# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
15 16
16if (NOT PULSEAUDIO_MINIMUM_VERSION) 17if(NOT PulseAudio_FIND_VERSION)
17 set(PULSEAUDIO_MINIMUM_VERSION "1.0.0") 18 set(PulseAudio_FIND_VERSION 2.0.0)
18endif (NOT PULSEAUDIO_MINIMUM_VERSION) 19endif()
19
20if (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY)
21 # Already in cache, be silent
22 set(PULSEAUDIO_FIND_QUIETLY TRUE)
23endif (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY)
24 20
25if (NOT WIN32) 21if(PKG_CONFIG_FOUND)
26 include(FindPkgConfig) 22 pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET)
27 pkg_check_modules(PC_PULSEAUDIO libpulse>=${PULSEAUDIO_MINIMUM_VERSION}) 23 pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET)
28 pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib) 24endif()
29endif (NOT WIN32)
30 25
31FIND_PATH(PULSEAUDIO_INCLUDE_DIRS pulse/pulseaudio.h 26find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h
32 HINTS 27 PATHS ${PC_PULSEAUDIO_INCLUDEDIR} ${PC_PULSEAUDIO_INCLUDE_DIRS})
33 ${PC_PULSEAUDIO_INCLUDEDIR}
34 ${PC_PULSEAUDIO_INCLUDE_DIRS}
35 )
36 28
37FIND_LIBRARY(PULSEAUDIO_LIBRARY NAMES pulse libpulse 29find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse
38 HINTS 30 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS})
39 ${PC_PULSEAUDIO_LIBDIR}
40 ${PC_PULSEAUDIO_LIBRARY_DIRS}
41 )
42 31
43FIND_LIBRARY(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib 32find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib
44 HINTS 33 PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS})
45 ${PC_PULSEAUDIO_LIBDIR}
46 ${PC_PULSEAUDIO_LIBRARY_DIRS}
47 )
48 34
49if (NOT PULSEAUDIO_INCLUDE_DIRS OR NOT PULSEAUDIO_LIBRARY) 35if(PC_PULSEAUDIO_VERSION)
50 set(PULSEAUDIO_FOUND FALSE) 36 set(PULSEAUDIO_VERSION_STRING ${PC_PULSEAUDIO_VERSION})
51else() 37elseif(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h")
52 set(PULSEAUDIO_FOUND TRUE) 38 file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulseaudio_version_str REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\).*")
39 string(REGEX REPLACE "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]+)\"\\).*" "\\1" PULSEAUDIO_VERSION_STRING "${pulseaudio_version_str}")
40 unset(pulseaudio_version_str)
53endif() 41endif()
54 42
55if (PULSEAUDIO_FOUND) 43include(FindPackageHandleStandardArgs)
56 if (NOT PULSEAUDIO_FIND_QUIETLY) 44find_package_handle_standard_args(PulseAudio
57 message(STATUS "Found PulseAudio: ${PULSEAUDIO_LIBRARY}") 45 REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_INCLUDE_DIR
58 if (PULSEAUDIO_MAINLOOP_LIBRARY) 46 VERSION_VAR PULSEAUDIO_VERSION_STRING)
59 message(STATUS "Found PulseAudio Mainloop: ${PULSEAUDIO_MAINLOOP_LIBRARY}")
60 else (PULSAUDIO_MAINLOOP_LIBRARY)
61 message(STATUS "Could NOT find PulseAudio Mainloop Library")
62 endif (PULSEAUDIO_MAINLOOP_LIBRARY)
63 endif (NOT PULSEAUDIO_FIND_QUIETLY)
64else (PULSEAUDIO_FOUND)
65 message(STATUS "Could NOT find PulseAudio")
66endif (PULSEAUDIO_FOUND)
67 47
68set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY}) 48if(PULSEAUDIO_FOUND)
49 set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR})
50 set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY})
51 set(PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1)
69 52
70list(APPEND PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1) 53 if(NOT TARGET PulseAudio::PulseAudioMainloop)
54 add_library(PulseAudio::PulseAudioMainloop UNKNOWN IMPORTED)
55 set_target_properties(PulseAudio::PulseAudioMainloop PROPERTIES
56 IMPORTED_LOCATION "${PULSEAUDIO_MAINLOOP_LIBRARY}")
57 endif()
58 if(NOT TARGET PulseAudio::PulseAudio)
59 add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED)
60 set_target_properties(PulseAudio::PulseAudio PROPERTIES
61 IMPORTED_LOCATION "${PULSEAUDIO_LIBRARY}"
62 INTERFACE_INCLUDE_DIRECTORIES "${PULSEAUDIO_INCLUDE_DIR}"
63 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPULSE=1
64 INTERFACE_LINK_LIBRARIES PulseAudio::PulseAudioMainloop)
65 endif()
66endif()
71 67
72mark_as_advanced(PULSEAUDIO_INCLUDE_DIRS PULSEAUDIO_LIBRARIES PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY) 68mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY)
diff --git a/project/cmake/modules/FindPython.cmake b/project/cmake/modules/FindPython.cmake
index 6f9f236..68b7359 100644
--- a/project/cmake/modules/FindPython.cmake
+++ b/project/cmake/modules/FindPython.cmake
@@ -5,39 +5,34 @@
5# PYTHON_INCLUDE_DIRS - the python include directory 5# PYTHON_INCLUDE_DIRS - the python include directory
6# PYTHON_LIBRARIES - The python libraries 6# PYTHON_LIBRARIES - The python libraries
7 7
8if(PKG_CONFIG_FOUND AND NOT CMAKE_CROSSCOMPILING) 8if(PKG_CONFIG_FOUND)
9 pkg_check_modules (PYTHON python) 9 pkg_check_modules(PC_PYTHON python >= 2.7 QUIET)
10endif() 10endif()
11 11
12if(NOT PYTHON_FOUND) 12find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH)
13 if(CMAKE_CROSSCOMPILING) 13find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR})
14 find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) 14find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7)
15 find_library(PYTHON_LIBRARY NAMES python2.6 python2.7) 15
16 find_path(PYTHON_INCLUDE_DIRS NAMES Python.h PATHS ${DEPENDS_PATH}/include/python2.6 ${DEPENDS_PATH}/include/python2.7) 16if(CMAKE_CROSSCOMPILING)
17 set(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIRS} CACHE PATH "python include dir" FORCE) 17 find_library(FFI_LIBRARY ffi REQUIRED)
18 18 find_library(EXPAT_LIBRARY expat REQUIRED)
19 find_library(FFI_LIBRARY ffi) 19 find_library(INTL_LIBRARY intl REQUIRED)
20 find_library(EXPAT_LIBRARY expat) 20 find_library(GMP_LIBRARY gmp REQUIRED)
21 find_library(INTL_LIBRARY intl) 21
22 22 if(NOT CORE_SYSTEM_NAME STREQUAL android)
23 if(NOT CORE_SYSTEM_NAME STREQUAL android) 23 set(PYTHON_DEP_LIBRARIES -lpthread -ldl -lutil)
24 set(PYTHON_DEP_LIBRARIES -lpthread -ldl -lutil)
25 endif()
26
27 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${PYTHON_DEP_LIBRARIES}
28 CACHE INTERNAL "python libraries" FORCE)
29 else()
30 find_package(PythonLibs)
31 endif() 24 endif()
25
26 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES})
27else()
28 find_package(PythonLibs 2.7 REQUIRED)
32endif() 29endif()
33 30
34include(FindPackageHandleStandardArgs)
35find_package_handle_standard_args(Python DEFAULT_MSG PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES)
36 31
37if(CMAKE_SYSTEM_NAME STREQUAL Darwin) 32include(FindPackageHandleStandardArgs)
38 find_library(FFI_LIBRARY ffi REQUIRED) 33find_package_handle_standard_args(PYTHON REQUIRED_VARS PYTHON_INCLUDE_DIR PYTHON_LIBRARY PYTHON_LIBRARIES)
39 find_library(INTL_LIBRARY intl) 34if(PYTHON_FOUND)
40 list(APPEND PYTHON_LIBRARIES ${FFI_LIBRARY} ${INTL_LIBRARY}) 35 set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
41endif() 36endif()
42 37
43mark_as_advanced(PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES PYTHON_LDFLAGS) 38mark_as_advanced(PYTHON_EXECUTABLE PYTHON_INCLUDE_DIRS PYTHON_INCLUDE_DIR PYTHON_LIBRARY PYTHON_LIBRARIES PYTHON_LDFLAGS FFI_LIBRARY EXPAT_LIBRARY INTL_LIBRARY GMP_LIBRARY)
diff --git a/project/cmake/modules/FindRTMP.cmake b/project/cmake/modules/FindRTMP.cmake
deleted file mode 100644
index 432b77d..0000000
--- a/project/cmake/modules/FindRTMP.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
1# - Try to find rtmp
2# Once done this will define
3#
4# RTMP_FOUND - system has librtmp
5# RTMP_INCLUDE_DIRS - the librtmp include directory
6# RTMP_LIBRARIES - The librtmp libraries
7
8if(PKG_CONFIG_FOUND)
9 pkg_check_modules (RTMP librtmp)
10 list(APPEND RTMP_INCLUDE_DIRS ${RTMP_INCLUDEDIR})
11else()
12 find_path(RTMP_INCLUDE_DIRS librtmp/rtmp.h)
13 find_library(RTMP_LIBRARIES rtmp)
14endif()
15
16include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(RTMP DEFAULT_MSG RTMP_INCLUDE_DIRS RTMP_LIBRARIES)
18
19list(APPEND RTMP_DEFINITIONS -DHAS_LIBRTMP=1)
20
21mark_as_advanced(RTMP_INCLUDE_DIRS RTMP_LIBRARIES RTMP_DEFINITIONS)
diff --git a/project/cmake/modules/FindSSE.cmake b/project/cmake/modules/FindSSE.cmake
index c76b811..0554663 100644
--- a/project/cmake/modules/FindSSE.cmake
+++ b/project/cmake/modules/FindSSE.cmake
@@ -1,105 +1,143 @@
1# Check if SSE instructions are available on the machine where 1# Check if SSE instructions are available on the machine where
2# the project is compiled. 2# the project is compiled.
3include(TestCXXAcceptsFlag)
3 4
4IF(CMAKE_SYSTEM_NAME MATCHES "Linux") 5if(CMAKE_SYSTEM_NAME MATCHES "Linux")
5 EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) 6 if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86")
6 7 exec_program(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)
7 STRING(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO}) 8
8 STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) 9 string(REGEX REPLACE "^.*(sse).*$" "\\1" _SSE_THERE ${CPUINFO})
9 IF (SSE2_TRUE) 10 string(COMPARE EQUAL "sse" "${_SSE_THERE}" _SSE_TRUE)
10 set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") 11 CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK)
11 ELSE (SSE2_TRUE) 12
12 set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") 13 string(REGEX REPLACE "^.*(sse2).*$" "\\1" _SSE_THERE ${CPUINFO})
13 ENDIF (SSE2_TRUE) 14 string(COMPARE EQUAL "sse2" "${_SSE_THERE}" _SSE2_TRUE)
14 15 CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK)
15 # /proc/cpuinfo apparently omits sse3 :( 16
16 STRING(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO}) 17 # /proc/cpuinfo apparently omits sse3 :(
17 STRING(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE) 18 string(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" _SSE_THERE ${CPUINFO})
18 IF (NOT SSE3_TRUE) 19 string(COMPARE EQUAL "sse3" "${_SSE_THERE}" _SSE3_TRUE)
19 STRING(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO}) 20 if(NOT _SSE3_TRUE)
20 STRING(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE) 21 string(REGEX REPLACE "^.*(T2300).*$" "\\1" _SSE_THERE ${CPUINFO})
21 ENDIF (NOT SSE3_TRUE) 22 string(COMPARE EQUAL "T2300" "${_SSE_THERE}" _SSE3_TRUE)
22 23 endif()
23 STRING(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO}) 24 CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK)
24 STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE) 25
25 IF (SSE3_TRUE OR SSSE3_TRUE) 26 string(REGEX REPLACE "^.*(ssse3).*$" "\\1" _SSE_THERE ${CPUINFO})
26 set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") 27 string(COMPARE EQUAL "ssse3" "${_SSE_THERE}" _SSSE3_TRUE)
27 ELSE (SSE3_TRUE OR SSSE3_TRUE) 28 CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK)
28 set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") 29
29 ENDIF (SSE3_TRUE OR SSSE3_TRUE) 30 string(REGEX REPLACE "^.*(sse4_1).*$" "\\1" _SSE_THERE ${CPUINFO})
30 IF (SSSE3_TRUE) 31 string(COMPARE EQUAL "sse4_1" "${_SSE_THERE}" _SSE41_TRUE)
31 set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") 32 CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK)
32 ELSE (SSSE3_TRUE) 33
33 set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") 34 string(REGEX REPLACE "^.*(sse4_2).*$" "\\1" _SSE_THERE ${CPUINFO})
34 ENDIF (SSSE3_TRUE) 35 string(COMPARE EQUAL "sse4_2" "${_SSE_THERE}" _SSE42_TRUE)
35 36 CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK)
36 STRING(REGEX REPLACE "^.*(sse4_1).*$" "\\1" SSE_THERE ${CPUINFO}) 37
37 STRING(COMPARE EQUAL "sse4_1" "${SSE_THERE}" SSE41_TRUE) 38 string(REGEX REPLACE "^.*(avx).*$" "\\1" _SSE_THERE ${CPUINFO})
38 IF (SSE41_TRUE) 39 string(COMPARE EQUAL "avx" "${_SSE_THERE}" _AVX_TRUE)
39 set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") 40 CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK)
40 ELSE (SSE41_TRUE) 41
41 set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") 42 string(REGEX REPLACE "^.*(avx2).*$" "\\1" _SSE_THERE ${CPUINFO})
42 ENDIF (SSE41_TRUE) 43 string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE)
43ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") 44 CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK)
44 EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE 45 endif()
45 CPUINFO) 46elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
46 47 if(NOT CPU MATCHES "arm")
47 STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) 48 exec_program("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO)
48 STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) 49
49 IF (SSE2_TRUE) 50 string(REGEX REPLACE "^.*[^S](SSE).*$" "\\1" _SSE_THERE ${CPUINFO})
50 set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") 51 string(COMPARE EQUAL "SSE" "${_SSE_THERE}" _SSE_TRUE)
51 ELSE (SSE2_TRUE) 52 CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK)
52 set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") 53
53 ENDIF (SSE2_TRUE) 54 string(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" _SSE_THERE ${CPUINFO})
54 55 string(COMPARE EQUAL "SSE2" "${_SSE_THERE}" _SSE2_TRUE)
55 STRING(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" SSE_THERE ${CPUINFO}) 56 CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK)
56 STRING(COMPARE EQUAL "SSE3" "${SSE_THERE}" SSE3_TRUE) 57
57 IF (SSE3_TRUE) 58 string(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" _SSE_THERE ${CPUINFO})
58 set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") 59 string(COMPARE EQUAL "SSE3" "${_SSE_THERE}" _SSE3_TRUE)
59 ELSE (SSE3_TRUE) 60 CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK)
60 set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") 61
61 ENDIF (SSE3_TRUE) 62 string(REGEX REPLACE "^.*(SSSE3).*$" "\\1" _SSE_THERE ${CPUINFO})
62 63 string(COMPARE EQUAL "SSSE3" "${_SSE_THERE}" _SSSE3_TRUE)
63 STRING(REGEX REPLACE "^.*(SSSE3).*$" "\\1" SSE_THERE ${CPUINFO}) 64 CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK)
64 STRING(COMPARE EQUAL "SSSE3" "${SSE_THERE}" SSSE3_TRUE) 65
65 IF (SSSE3_TRUE) 66 string(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" _SSE_THERE ${CPUINFO})
66 set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") 67 string(COMPARE EQUAL "SSE4.1" "${_SSE_THERE}" _SSE41_TRUE)
67 ELSE (SSSE3_TRUE) 68 CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK)
68 set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") 69
69 ENDIF (SSSE3_TRUE) 70 string(REGEX REPLACE "^.*(SSE4.2).*$" "\\1" _SSE_THERE ${CPUINFO})
70 71 string(COMPARE EQUAL "SSE4.2" "${_SSE_THERE}" _SSE42_TRUE)
71 STRING(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" SSE_THERE ${CPUINFO}) 72 CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK)
72 STRING(COMPARE EQUAL "SSE4.1" "${SSE_THERE}" SSE41_TRUE) 73
73 IF (SSE41_TRUE) 74 string(REGEX REPLACE "^.*(AVX).*$" "\\1" _SSE_THERE ${CPUINFO})
74 set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") 75 string(COMPARE EQUAL "AVX" "${_SSE_THERE}" _AVX_TRUE)
75 ELSE (SSE41_TRUE) 76 CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK)
76 set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") 77
77 ENDIF (SSE41_TRUE) 78 string(REGEX REPLACE "^.*(AVX2).*$" "\\1" _SSE_THERE ${CPUINFO})
78ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows") 79 string(COMPARE EQUAL "AVX2" "${_SSE_THERE}" _AVX2_TRUE)
80 CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK)
81 endif()
82elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
79 # TODO 83 # TODO
80 set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") 84 set(_SSE_TRUE true)
81 set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") 85 set(_SSE_OK true)
82 set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") 86 set(_SSE2_TRUE true)
83 set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") 87 set(_SSE2_OK true)
84ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") 88endif()
85 set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") 89
86 set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") 90include(FindPackageHandleStandardArgs)
87 set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") 91find_package_handle_standard_args(SSE
88 set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") 92 REQUIRED_VARS _SSE_TRUE _SSE_OK
89ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") 93 FAIL_MESSAGE "Could not find hardware support for SSE")
90 94find_package_handle_standard_args(SSE2
91if(NOT SSE2_FOUND) 95 REQUIRED_VARS _SSE2_TRUE _SSE2_OK
92 MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.") 96 FAIL_MESSAGE "Could not find hardware support for SSE2")
93endif(NOT SSE2_FOUND) 97find_package_handle_standard_args(SSE3
94if(NOT SSE3_FOUND) 98 REQUIRED_VARS _SSE3_TRUE _SSE3_OK
95 MESSAGE(STATUS "Could not find hardware support for SSE3 on this machine.") 99 FAIL_MESSAGE "Could not find hardware support for SSE3")
96endif(NOT SSE3_FOUND) 100find_package_handle_standard_args(SSSE3
97if(NOT SSSE3_FOUND) 101 REQUIRED_VARS _SSSE3_TRUE _SSSE3_OK
98 MESSAGE(STATUS "Could not find hardware support for SSSE3 on this machine.") 102 FAIL_MESSAGE "Could not find hardware support for SSSE3")
99endif(NOT SSSE3_FOUND) 103find_package_handle_standard_args(SSE4_1
100if(NOT SSE4_1_FOUND) 104 REQUIRED_VARS _SSE41_TRUE _SSE41_OK
101 MESSAGE(STATUS "Could not find hardware support for SSE4.1 on this machine.") 105 FAIL_MESSAGE "Could not find hardware support for SSE4.1")
102endif(NOT SSE4_1_FOUND) 106find_package_handle_standard_args(SSE4_2
103 107 REQUIRED_VARS _SSE42_TRUE _SSE42_OK
104mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND) 108 FAIL_MESSAGE "Could not find hardware support for SSE4.2")
109find_package_handle_standard_args(AVX
110 REQUIRED_VARS _AVX_TRUE _AVX_OK
111 FAIL_MESSAGE "Could not find hardware support for AVX")
112find_package_handle_standard_args(AVX2
113 REQUIRED_VARS _AVX2_TRUE _AVX2_OK
114 FAIL_MESSAGE "Could not find hardware support for AVX2")
115
116mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND)
117
118unset(_SSE_THERE)
119unset(_SSE_TRUE)
120unset(_SSE_OK)
121unset(_SSE_OK CACHE)
122unset(_SSE2_TRUE)
123unset(_SSE2_OK)
124unset(_SSE2_OK CACHE)
125unset(_SSE3_TRUE)
126unset(_SSE3_OK)
127unset(_SSE3_OK CACHE)
128unset(_SSSE3_TRUE)
129unset(_SSSE3_OK)
130unset(_SSSE3_OK CACHE)
131unset(_SSE4_1_TRUE)
132unset(_SSE41_OK)
133unset(_SSE41_OK CACHE)
134unset(_SSE4_2_TRUE)
135unset(_SSE42_OK)
136unset(_SSE42_OK CACHE)
137unset(_AVX_TRUE)
138unset(_AVX_OK)
139unset(_AVX_OK CACHE)
140unset(_AVX2_TRUE)
141unset(_AVX2_OK)
142unset(_AVX2_OK CACHE)
105 143
diff --git a/project/cmake/modules/FindSSH.cmake b/project/cmake/modules/FindSSH.cmake
index 60c3537..538c699 100644
--- a/project/cmake/modules/FindSSH.cmake
+++ b/project/cmake/modules/FindSSH.cmake
@@ -1,21 +1,47 @@
1# - Try to find libssh 1#.rst:
2# Once done this will define 2# FindSSH
3# -------
4# Finds the SSH library
3# 5#
4# SSH_FOUND - system has libssh 6# This will will define the following variables::
5# SSH_INCLUDE_DIRS - the libssh include directory 7#
6# SSH_LIBRARIES - The libssh libraries 8# SSH_FOUND - system has SSH
9# SSH_INCLUDE_DIRS - the SSH include directory
10# SSH_LIBRARIES - the SSH libraries
11# SSH_DEFINITIONS - the SSH definitions
12#
13# and the following imported targets::
14#
15# SSH::SSH - The SSH library
7 16
8if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
9 pkg_check_modules (SSH libssh) 18 pkg_check_modules(PC_SSH libssh QUIET)
10 list(APPEND SSH_INCLUDE_DIRS /usr/include)
11else()
12 find_path(SSH_INCLUDE_DIRS libssh/libssh.h)
13 find_library(SSH_LIBRARIES ssh)
14endif() 19endif()
15 20
21find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h
22 PATHS ${PC_SSH_INCLUDEDIR})
23find_library(SSH_LIBRARY NAMES ssh
24 PATHS ${PC_SSH_LIBDIR})
25
26set(SSH_VERSION ${PC_SSH_VERSION})
27
16include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(SSH DEFAULT_MSG SSH_INCLUDE_DIRS SSH_LIBRARIES) 29find_package_handle_standard_args(SSH
30 REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR
31 VERSION_VAR SSH_VERSION)
32
33if(SSH_FOUND)
34 set(SSH_LIBRARIES ${SSH_LIBRARY})
35 set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR})
36 set(SSH_DEFINITIONS -DHAVE_LIBSSH=1)
18 37
19list(APPEND SSH_DEFINITIONS -DHAVE_LIBSSH=1) 38 if(NOT TARGET SSH::SSH)
39 add_library(SSH::SSH UNKNOWN IMPORTED)
40 set_target_properties(SSH::SSH PROPERTIES
41 IMPORTED_LOCATION "${SSH_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSSH=1)
44 endif()
45endif()
20 46
21mark_as_advanced(SSH_INCLUDE_DIRS SSH_LIBRARIES SSH_DEFINITIONS) 47mark_as_advanced(SSH_INCLUDE_DIR SSH_LIBRARY)
diff --git a/project/cmake/modules/FindSWIG.cmake b/project/cmake/modules/FindSWIG.cmake
index 84c7a51..523b49b 100644
--- a/project/cmake/modules/FindSWIG.cmake
+++ b/project/cmake/modules/FindSWIG.cmake
@@ -1,14 +1,29 @@
1if(NOT SWIG_EXECUTABLE) 1#.rst:
2 find_program(SWIG_EXECUTABLE NAMES swig2.0 swig PATH_SUFFIXES swig) 2# FindSWIG
3endif() 3# --------
4# Finds the SWIG executable
5#
6# This will will define the following variables::
7#
8# SWIG_FOUND - system has SWIG
9# SWIG_EXECUTABLE - the SWIG executable
10
11find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig
12 PATH_SUFFIXES swig)
4if(SWIG_EXECUTABLE) 13if(SWIG_EXECUTABLE)
5 execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib 14 execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
6 OUTPUT_VARIABLE SWIG_DIR 15 OUTPUT_VARIABLE SWIG_DIR
7 ERROR_VARIABLE SWIG_swiglib_error 16 ERROR_VARIABLE SWIG_swiglib_error
8 RESULT_VARIABLE SWIG_swiglib_result) 17 RESULT_VARIABLE SWIG_swiglib_result)
18 execute_process(COMMAND ${SWIG_EXECUTABLE} -version
19 OUTPUT_VARIABLE SWIG_version_output
20 ERROR_VARIABLE SWIG_version_output
21 RESULT_VARIABLE SWIG_version_result)
22 string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
23 SWIG_VERSION "${SWIG_version_output}")
9endif() 24endif()
10 25
11
12include(FindPackageHandleStandardArgs) 26include(FindPackageHandleStandardArgs)
13FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR 27find_package_handle_standard_args(SWIG
14 VERSION_VAR SWIG_VERSION ) 28 REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
29 VERSION_VAR SWIG_VERSION)
diff --git a/project/cmake/modules/FindShairplay.cmake b/project/cmake/modules/FindShairplay.cmake
index 4804686..87d3107 100644
--- a/project/cmake/modules/FindShairplay.cmake
+++ b/project/cmake/modules/FindShairplay.cmake
@@ -35,11 +35,11 @@ if(NOT WIN32)
35 " HAVE_SHAIRPLAY_CALLBACK_CLS) 35 " HAVE_SHAIRPLAY_CALLBACK_CLS)
36 endif() 36 endif()
37 37
38 find_package_handle_standard_args(SHAIRPLAY 38 find_package_handle_standard_args(Shairplay
39 REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) 39 REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS)
40else() 40else()
41 # Dynamically loaded DLL 41 # Dynamically loaded DLL
42 find_package_handle_standard_args(SHAIRPLAY 42 find_package_handle_standard_args(Shairplay
43 REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR) 43 REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR)
44endif() 44endif()
45 45
diff --git a/project/cmake/modules/FindSmbClient.cmake b/project/cmake/modules/FindSmbClient.cmake
new file mode 100644
index 0000000..6455cce
--- /dev/null
+++ b/project/cmake/modules/FindSmbClient.cmake
@@ -0,0 +1,47 @@
1#.rst:
2# FindSmbClient
3# -------------
4# Finds the SMB Client library
5#
6# This will will define the following variables::
7#
8# SMBCLIENT_FOUND - system has SmbClient
9# SMBCLIENT_INCLUDE_DIRS - the SmbClient include directory
10# SMBCLIENT_LIBRARIES - the SmbClient libraries
11# SMBCLIENT_DEFINITIONS - the SmbClient definitions
12#
13# and the following imported targets::
14#
15# SmbClient::SmbClient - The SmbClient library
16
17if(PKGCONFIG_FOUND)
18 pkg_check_modules(PC_SMBCLIENT smbclient QUIET)
19endif()
20
21find_path(SMBCLIENT_INCLUDE_DIR NAMES libsmbclient.h
22 PATHS ${PC_SMBCLIENT_INCLUDEDIR})
23find_library(SMBCLIENT_LIBRARY NAMES smbclient
24 PATHS ${PC_SMBCLIENT_LIBDIR})
25
26set(SMBCLIENT_VERSION ${PC_SMBCLIENT_VERSION})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(SmbClient
30 REQUIRED_VARS SMBCLIENT_LIBRARY SMBCLIENT_INCLUDE_DIR
31 VERSION_VAR SMBCLIENT_VERSION)
32
33if(SMBCLIENT_FOUND)
34 set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY})
35 set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR})
36 set(SMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1)
37
38 if(NOT TARGET SmbClient::SmbClient)
39 add_library(SmbClient::SmbClient UNKNOWN IMPORTED)
40 set_target_properties(SmbClient::SmbClient PROPERTIES
41 IMPORTED_LOCATION "${SMBCLIENT_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${SMBCLIENT_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSMBCLIENT=1)
44 endif()
45endif()
46
47mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIR LIBSMBCLIENT_LIBRARY)
diff --git a/project/cmake/modules/FindSqlite3.cmake b/project/cmake/modules/FindSqlite3.cmake
index a47944e..abde0cf 100644
--- a/project/cmake/modules/FindSqlite3.cmake
+++ b/project/cmake/modules/FindSqlite3.cmake
@@ -1,19 +1,44 @@
1# - Try to find SQLITE3 1#.rst:
2# Once done this will define 2# FindSqlite3
3# -----------
4# Finds the SQLite3 library
3# 5#
4# SQLITE3_FOUND - system has sqlite3 6# This will will define the following variables::
5# SQLITE3_INCLUDE_DIRS - the sqlite3 include directory 7#
6# SQLITE3_LIBRARIES - The sqlite3 libraries 8# SQLITE3_FOUND - system has SQLite3
9# SQLITE3_INCLUDE_DIRS - the SQLite3 include directory
10# SQLITE3_LIBRARIES - the SQLite3 libraries
11#
12# and the following imported targets::
13#
14# SQLite3::SQLite3 - The SQLite3 library
7 15
8if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
9 pkg_check_modules (SQLITE3 sqlite3) 17 pkg_check_modules(PC_SQLITE3 sqlite3 QUIET)
10 list(APPEND SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDEDIR})
11else()
12 find_path(SQLITE3_INCLUDE_DIRS sqlite3.h)
13 find_library(SQLITE3_LIBRARIES sqlite3)
14endif() 18endif()
15 19
20find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h
21 PATHS ${PC_SQLITE3_INCLUDEDIR})
22find_library(SQLITE3_LIBRARY NAMES sqlite3
23 PATHS ${PC_SQLITE3_LIBDIR})
24
25set(SQLITE3_VERSION ${PC_SQLITE3_VERSION})
26
16include(FindPackageHandleStandardArgs) 27include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(Sqlite3 DEFAULT_MSG SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) 28find_package_handle_standard_args(Sqlite3
29 REQUIRED_VARS SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR
30 VERSION_VAR SQLITE3_VERSION)
31
32if(SQLITE3_FOUND)
33 set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
34 set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
35
36 if(NOT TARGET SQLite3::SQLite3)
37 add_library(SQLite3::SQLite3 UNKNOWN IMPORTED)
38 set_target_properties(SQLite3::SQLite3 PROPERTIES
39 IMPORTED_LOCATION "${SQLITE3_LIBRARY}"
40 INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}")
41 endif()
42endif()
18 43
19mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) 44mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY)
diff --git a/project/cmake/modules/FindTagLib.cmake b/project/cmake/modules/FindTagLib.cmake
index 06b615d..8c8c2f3 100644
--- a/project/cmake/modules/FindTagLib.cmake
+++ b/project/cmake/modules/FindTagLib.cmake
@@ -14,7 +14,7 @@
14# TagLib::TagLib - The TagLib library 14# TagLib::TagLib - The TagLib library
15 15
16if(PKG_CONFIG_FOUND) 16if(PKG_CONFIG_FOUND)
17 pkg_check_modules(PC_TAGLIB taglib>=1.8.0 QUIET) 17 pkg_check_modules(PC_TAGLIB taglib>=1.9.0 QUIET)
18endif() 18endif()
19 19
20find_path(TAGLIB_INCLUDE_DIR taglib/tag.h 20find_path(TAGLIB_INCLUDE_DIR taglib/tag.h
@@ -29,7 +29,7 @@ include(SelectLibraryConfigurations)
29select_library_configurations(TAGLIB) 29select_library_configurations(TAGLIB)
30 30
31include(FindPackageHandleStandardArgs) 31include(FindPackageHandleStandardArgs)
32find_package_handle_standard_args(TAGLIB 32find_package_handle_standard_args(TagLib
33 REQUIRED_VARS TAGLIB_LIBRARY TAGLIB_INCLUDE_DIR 33 REQUIRED_VARS TAGLIB_LIBRARY TAGLIB_INCLUDE_DIR
34 VERSION_VAR TAGLIB_VERSION) 34 VERSION_VAR TAGLIB_VERSION)
35 35
diff --git a/project/cmake/modules/FindTinyXML.cmake b/project/cmake/modules/FindTinyXML.cmake
index 54ec946..1220a94 100644
--- a/project/cmake/modules/FindTinyXML.cmake
+++ b/project/cmake/modules/FindTinyXML.cmake
@@ -33,7 +33,7 @@ include(SelectLibraryConfigurations)
33select_library_configurations(TINYXML) 33select_library_configurations(TINYXML)
34 34
35include(FindPackageHandleStandardArgs) 35include(FindPackageHandleStandardArgs)
36find_package_handle_standard_args(TINYXML 36find_package_handle_standard_args(TinyXML
37 REQUIRED_VARS TINYXML_LIBRARY TINYXML_INCLUDE_DIR 37 REQUIRED_VARS TINYXML_LIBRARY TINYXML_INCLUDE_DIR
38 VERSION_VAR TINYXML_VERSION) 38 VERSION_VAR TINYXML_VERSION)
39 39
diff --git a/project/cmake/modules/FindUDEV.cmake b/project/cmake/modules/FindUDEV.cmake
new file mode 100644
index 0000000..422c437
--- /dev/null
+++ b/project/cmake/modules/FindUDEV.cmake
@@ -0,0 +1,47 @@
1#.rst:
2# FindUDEV
3# -------
4# Finds the UDEV library
5#
6# This will will define the following variables::
7#
8# UDEV_FOUND - system has UDEV
9# UDEV_INCLUDE_DIRS - the UDEV include directory
10# UDEV_LIBRARIES - the UDEV libraries
11# UDEV_DEFINITIONS - the UDEV definitions
12#
13# and the following imported targets::
14#
15# UDEV::UDEV - The UDEV library
16
17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_UDEV libudev QUIET)
19endif()
20
21find_path(UDEV_INCLUDE_DIR NAMES libudev.h
22 PATHS ${PC_UDEV_INCLUDEDIR})
23find_library(UDEV_LIBRARY NAMES udev
24 PATHS ${PC_UDEV_LIBDIR})
25
26set(UDEV_VERSION ${PC_UDEV_VERSION})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(UDEV
30 REQUIRED_VARS UDEV_LIBRARY UDEV_INCLUDE_DIR
31 VERSION_VAR UDEV_VERSION)
32
33if(UDEV_FOUND)
34 set(UDEV_LIBRARIES ${UDEV_LIBRARY})
35 set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
36 set(UDEV_DEFINITIONS -DHAVE_LIBUDEV=1)
37
38 if(NOT TARGET UDEV::UDEV)
39 add_library(UDEV::UDEV UNKNOWN IMPORTED)
40 set_target_properties(UDEV::UDEV PROPERTIES
41 IMPORTED_LOCATION "${UDEV_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${UDEV_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBUDEV=1)
44 endif()
45endif()
46
47mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBRARY)
diff --git a/project/cmake/modules/FindUDev.cmake b/project/cmake/modules/FindUDev.cmake
deleted file mode 100644
index 97fa956..0000000
--- a/project/cmake/modules/FindUDev.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
1# - Try to find udev
2# Once done this will define
3#
4# UDEV_FOUND - system has libudev
5# UDEV_INCLUDE_DIRS - the libudev include directory
6# UDEV_LIBRARIES - The libudev libraries
7
8if(PKG_CONFIG_FOUND)
9 pkg_check_modules (UDEV libudev)
10 list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDEDIR})
11endif()
12
13if(NOT UDEV_FOUND)
14 find_path(UDEV_INCLUDE_DIRS libudev.h)
15 find_library(UDEV_LIBRARIES udev)
16endif()
17
18include(FindPackageHandleStandardArgs)
19find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIRS UDEV_LIBRARIES)
20
21mark_as_advanced(UDEV_INCLUDE_DIRS UDEV_LIBRARIES)
22list(APPEND UDEV_DEFINITIONS -DHAVE_LIBUDEV=1)
diff --git a/project/cmake/modules/FindVAAPI.cmake b/project/cmake/modules/FindVAAPI.cmake
index 08e821f..ce3fe1a 100644
--- a/project/cmake/modules/FindVAAPI.cmake
+++ b/project/cmake/modules/FindVAAPI.cmake
@@ -9,6 +9,10 @@
9# VAAPI_INCLUDE_DIRS - the VAAPI include directory 9# VAAPI_INCLUDE_DIRS - the VAAPI include directory
10# VAAPI_LIBRARIES - the VAAPI libraries 10# VAAPI_LIBRARIES - the VAAPI libraries
11# VAAPI_DEFINITIONS - the VAAPI definitions 11# VAAPI_DEFINITIONS - the VAAPI definitions
12#
13# and the following imported targets::
14#
15# VAAPI::VAAPI - The VAAPI library
12 16
13if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_VAAPI libva libva-x11 QUIET) 18 pkg_check_modules(PC_VAAPI libva libva-x11 QUIET)
@@ -42,6 +46,20 @@ if(VAAPI_FOUND)
42 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) 46 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR})
43 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY}) 47 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY})
44 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) 48 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1)
49
50 if(NOT TARGET VAAPI::VAAPI_X11)
51 add_library(VAAPI::VAAPI_X11 UNKNOWN IMPORTED)
52 set_target_properties(VAAPI::VAAPI_X11 PROPERTIES
53 IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}")
54 endif()
55 if(NOT TARGET VAAPI::VAAPI)
56 add_library(VAAPI::VAAPI UNKNOWN IMPORTED)
57 set_target_properties(VAAPI::VAAPI PROPERTIES
58 IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}"
59 INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}"
60 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1
61 INTERFACE_LINK_LIBRARIES VAAPI::VAAPI_X11)
62 endif()
45endif() 63endif()
46 64
47mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY) 65mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY)
diff --git a/project/cmake/modules/FindVDPAU.cmake b/project/cmake/modules/FindVDPAU.cmake
index 680b45f..b99e03f 100644
--- a/project/cmake/modules/FindVDPAU.cmake
+++ b/project/cmake/modules/FindVDPAU.cmake
@@ -9,6 +9,10 @@
9# VDPAU_INCLUDE_DIRS - the VDPAU include directory 9# VDPAU_INCLUDE_DIRS - the VDPAU include directory
10# VDPAU_LIBRARIES - the VDPAU libraries 10# VDPAU_LIBRARIES - the VDPAU libraries
11# VDPAU_DEFINITIONS - the VDPAU definitions 11# VDPAU_DEFINITIONS - the VDPAU definitions
12#
13# and the following imported targets::
14#
15# VDPAU::VDPAU - The VDPAU library
12 16
13if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_VDPAU vdpau QUIET) 18 pkg_check_modules(PC_VDPAU vdpau QUIET)
@@ -19,14 +23,25 @@ find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h
19find_library(VDPAU_LIBRARY NAMES vdpau 23find_library(VDPAU_LIBRARY NAMES vdpau
20 PATHS ${PC_VDPAU_LIBDIR}) 24 PATHS ${PC_VDPAU_LIBDIR})
21 25
26set(VDPAU_VERSION ${PC_VDPAU_VERSION})
27
22include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
23find_package_handle_standard_args(VDPAU 29find_package_handle_standard_args(VDPAU
24 REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR) 30 REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR
31 VERSION_VAR VDPAU_VERSION)
25 32
26if(VDPAU_FOUND) 33if(VDPAU_FOUND)
27 set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR}) 34 set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR})
28 set(VDPAU_LIBRARIES ${VDPAU_LIBRARY}) 35 set(VDPAU_LIBRARIES ${VDPAU_LIBRARY})
29 set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1) 36 set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1)
37
38 if(NOT TARGET VDPAU::VDPAU)
39 add_library(VDPAU::VDPAU UNKNOWN IMPORTED)
40 set_target_properties(VDPAU::VDPAU PROPERTIES
41 IMPORTED_LOCATION "${VDPAU_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU=1)
44 endif()
30endif() 45endif()
31 46
32mark_as_advanced(VDPAU_INCLUDE_DIR VDPAU_LIBRARY) 47mark_as_advanced(VDPAU_INCLUDE_DIR VDPAU_LIBRARY)
diff --git a/project/cmake/modules/FindX.cmake b/project/cmake/modules/FindX.cmake
index d9ab5bc..19bb770 100644
--- a/project/cmake/modules/FindX.cmake
+++ b/project/cmake/modules/FindX.cmake
@@ -1,21 +1,57 @@
1# - Try to find X11 1#.rst:
2# Once done this will define 2# FindX
3# -----
4# Finds the X11 library
3# 5#
4# X11_FOUND - system has X11 6# This will will define the following variables::
5# X11_INCLUDE_DIRS - the X11 include directory 7#
6# X11_LIBRARIES - The X11 libraries 8# X_FOUND - system has X11
9# X_INCLUDE_DIRS - the X11 include directory
10# X_LIBRARIES - the X11 libraries
11# X_DEFINITIONS - the X11 definitions
12#
13# and the following imported targets::
14#
15# X::X - The X11 library
16# X::Xext - The X11 extension library
7 17
8if(PKG_CONFIG_FOUND) 18if(PKG_CONFIG_FOUND)
9 pkg_check_modules (X x11 xext libdrm egl) 19 pkg_check_modules(PC_X x11 xext QUIET)
10 list(APPEND X_INCLUDE_DIRS /usr/include)
11else()
12 find_path(X_INCLUDE_DIRS X11/Xlib.h)
13 find_library(X_LIBRARIES X11)
14endif() 20endif()
15 21
22find_path(X_INCLUDE_DIR NAMES X11/Xlib.h
23 PATHS ${PC_X_x11_INCLUDEDIR})
24find_library(X_LIBRARY NAMES X11
25 PATHS ${PC_X_x11_LIBDIR})
26find_library(X_EXT_LIBRARY NAMES Xext
27 PATHS ${PC_X_xext_LIBDIR})
28
29set(X_VERSION ${PC_X_x11_VERSION})
30
16include(FindPackageHandleStandardArgs) 31include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(X DEFAULT_MSG X_INCLUDE_DIRS X_LIBRARIES) 32find_package_handle_standard_args(X
33 REQUIRED_VARS X_LIBRARY X_EXT_LIBRARY X_INCLUDE_DIR
34 VERSION_VAR X_VERSION)
35
36if(X_FOUND)
37 set(X_LIBRARIES ${X_LIBRARY} ${X_EXT_LIBRARY})
38 set(X_INCLUDE_DIRS ${X_INCLUDE_DIR})
39 set(X_DEFINITIONS -DHAVE_X11=1)
18 40
19list(APPEND X_DEFINITIONS -DHAVE_X11=1) 41 if(NOT TARGET X::X)
42 add_library(X::X UNKNOWN IMPORTED)
43 set_target_properties(X::X PROPERTIES
44 IMPORTED_LOCATION "${X_LIBRARY}"
45 INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}"
46 INTERFACE_COMPILE_DEFINITIONS HAVE_X11=1)
47 endif()
48 if(NOT TARGET X::Xext)
49 add_library(X::Xext UNKNOWN IMPORTED)
50 set_target_properties(X::Xext PROPERTIES
51 IMPORTED_LOCATION "${X_EXT_LIBRARY}"
52 INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}"
53 INTERFACE_LINK_LIBRARIES X::X)
54 endif()
55endif()
20 56
21mark_as_advanced(X_INCLUDE_DIRS X_LIBRARIES X_DEFINITIONS) 57mark_as_advanced(X_INCLUDE_DIR X_LIBRARY X_EXT_LIBRARY)
diff --git a/project/cmake/modules/FindXRandR.cmake b/project/cmake/modules/FindXRandR.cmake
index 57ff750..9feaedc 100644
--- a/project/cmake/modules/FindXRandR.cmake
+++ b/project/cmake/modules/FindXRandR.cmake
@@ -1,22 +1,47 @@
1# - Try to find xrandr 1#.rst:
2# Once done this will define 2# FindXRandR
3# ----------
4# Finds the XRandR library
3# 5#
4# XRANDR_FOUND - system has lixrandr 6# This will will define the following variables::
5# XRANDR_INCLUDE_DIRS - the libxrandr include directory 7#
6# XRANDR_LIBRARIES - The libxrandr libraries 8# XRANDR_FOUND - system has XRANDR
9# XRANDR_INCLUDE_DIRS - the XRANDR include directory
10# XRANDR_LIBRARIES - the XRANDR libraries
11# XRANDR_DEFINITIONS - the XRANDR definitions
12#
13# and the following imported targets::
14#
15# XRandR::XRandR - The XRANDR library
7 16
8if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
9 pkg_check_modules (XRANDR xrandr) 18 pkg_check_modules(PC_XRANDR xrandr QUIET)
10 list(APPEND XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDEDIR})
11else()
12 find_library(XRANDR_LIBRARIES Xrandr)
13endif() 19endif()
14 20
15if(XRANDR_FOUND) 21find_path(XRANDR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h
22 PATHS ${PC_XRANDR_INCLUDEDIR})
23find_library(XRANDR_LIBRARY NAMES Xrandr
24 PATHS ${PC_XRANDR_LIBDIR})
25
26set(XRANDR_VERSION ${PC_XRANDR_VERSION})
27
16include(FindPackageHandleStandardArgs) 28include(FindPackageHandleStandardArgs)
17 find_package_handle_standard_args(XRandR DEFAULT_MSG XRANDR_INCLUDE_DIRS XRANDR_LIBRARIES) 29find_package_handle_standard_args(XRandR
30 REQUIRED_VARS XRANDR_LIBRARY XRANDR_INCLUDE_DIR
31 VERSION_VAR XRANDR_VERSION)
18 32
19 list(APPEND XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1) 33if(XRANDR_FOUND)
34 set(XRANDR_LIBRARIES ${XRANDR_LIBRARY})
35 set(XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDE_DIR})
36 set(XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1)
20 37
21 mark_as_advanced(XRANDR_INCLUDE_DIRS XRANDR_LIBRARIES XRANDR_DEFINITIONS) 38 if(NOT TARGET XRandR::XRandR)
39 add_library(XRandR::XRandR UNKNOWN IMPORTED)
40 set_target_properties(XRandR::XRandR PROPERTIES
41 IMPORTED_LOCATION "${XRANDR_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${XRANDR_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXRANDR=1)
44 endif()
22endif() 45endif()
46
47mark_as_advanced(XRANDR_INCLUDE_DIR XRANDR_LIBRARY)
diff --git a/project/cmake/modules/FindXSLT.cmake b/project/cmake/modules/FindXSLT.cmake
new file mode 100644
index 0000000..9be51d3
--- /dev/null
+++ b/project/cmake/modules/FindXSLT.cmake
@@ -0,0 +1,50 @@
1#.rst:
2# FindXSLT
3# --------
4# Finds the XSLT library
5#
6# This will will define the following variables::
7#
8# XSLT_FOUND - system has XSLT
9# XSLT_INCLUDE_DIRS - the XSLT include directory
10# XSLT_LIBRARIES - the XSLT libraries
11# XSLT_DEFINITIONS - the XSLT definitions
12#
13# and the following imported targets::
14#
15# XSLT::XSLT - The XSLT library
16
17find_package(LibXml2 REQUIRED)
18
19if(PKG_CONFIG_FOUND)
20 pkg_check_modules(PC_XSLT libxslt QUIET)
21endif()
22
23find_path(XSLT_INCLUDE_DIR NAMES libxslt/xslt.h
24 PATHS ${PC_XSLT_INCLUDEDIR})
25find_library(XSLT_LIBRARY NAMES xslt libxslt
26 PATHS ${PC_XSLT_LIBDIR})
27
28set(XSLT_VERSION ${PC_XSLT_VERSION})
29
30include(FindPackageHandleStandardArgs)
31find_package_handle_standard_args(XSLT
32 REQUIRED_VARS XSLT_LIBRARY XSLT_INCLUDE_DIR
33 VERSION_VAR XSLT_VERSION)
34
35if(XSLT_FOUND)
36 set(XSLT_LIBRARIES ${XSLT_LIBRARY} ${LIBXML2_LIBRARIES})
37 set(XSLT_INCLUDE_DIRS ${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
38 set(XSLT_DEFINITIONS -DHAVE_LIBXSLT=1)
39
40 if(NOT TARGET XSLT::XSLT)
41 add_library(XSLT::XSLT UNKNOWN IMPORTED)
42 set_target_properties(XSLT::XSLT PROPERTIES
43 IMPORTED_LOCATION "${XSLT_LIBRARY}"
44 INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}"
45 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1
46 ITERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}")
47 endif()
48endif()
49
50mark_as_advanced(XSLT_INCLUDE_DIR XSLT_LIBRARY)
diff --git a/project/cmake/modules/FindXslt.cmake b/project/cmake/modules/FindXslt.cmake
deleted file mode 100644
index 442ba43..0000000
--- a/project/cmake/modules/FindXslt.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
1# - Try to find XSLT
2# Once done this will define
3#
4# XSLT_FOUND - system has libxslt
5# XSLT_INCLUDE_DIRS - the libxslt include directory
6# XSLT_LIBRARIES - The libxslt libraries
7
8if(PKG_CONFIG_FOUND)
9 pkg_check_modules (XSLT libxslt)
10else()
11 find_path(XSLT_INCLUDE_DIRS libxslt/xslt.h)
12 find_library(XSLT_LIBRARIES NAMES xslt libxslt)
13endif()
14
15include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(Xslt DEFAULT_MSG XSLT_INCLUDE_DIRS XSLT_LIBRARIES)
17
18mark_as_advanced(XSLT_INCLUDE_DIRS XSLT_LIBRARIES)
diff --git a/project/cmake/modules/FindYajl.cmake b/project/cmake/modules/FindYajl.cmake
index c27b03a..c73a67b 100644
--- a/project/cmake/modules/FindYajl.cmake
+++ b/project/cmake/modules/FindYajl.cmake
@@ -1,27 +1,62 @@
1# Base Io build system 1#.rst:
2# Written by Jeremy Tregunna <jeremy.tregunna@me.com> 2# FindYajl
3# --------
4# Finds the Yajl library
3# 5#
4# Find libyajl 6# This will will define the following variables::
5pkg_check_modules(YAJL yajl>=2.0) 7#
6if(YAJL_FOUND) 8# YAJL_FOUND - system has Yajl
7 list(APPEND YAJL_DEFINITIONS -DYAJL_MAJOR=2) 9# YAJL_INCLUDE_DIRS - Yajl include directory
10# YAJL_LIBRARIES - the Yajl libraries
11#
12# and the following imported targets::
13#
14# Yajl::Yajl - The Yajl library
15
16if(NOT Yajl_FIND_VERSION)
17 set(Yajl_FIND_VERSION 2.0.0)
18endif()
19
20if(PKG_CONFIG_FOUND)
21 pkg_check_modules(PC_YAJL yajl>=${Yajl_FIND_VERSION} QUIET)
8endif() 22endif()
9 23
10if(NOT YAJL_FOUND) 24find_path(YAJL_INCLUDE_DIR NAMES yajl/yajl_common.h
11 find_path(YAJL_INCLUDE_DIRS yajl/yajl_common.h) 25 PATHS ${PC_YAJL_INCLUDEDIR})
12 find_library(YAJL_LIBRARIES NAMES yajl) 26find_library(YAJL_LIBRARY NAMES yajl
27 PATHS ${PC_YAJL_LIBDIR})
13 28
14 file(STRINGS ${YAJL_INCLUDE_DIRS}/yajl/yajl_version.h version_header) 29if(PC_YAJL_VERSION)
15 string(REGEX MATCH "YAJL_MAJOR ([0-9]+)" YAJL_VERSION_MAJOR ${version_header}) 30 set(YAJL_VERSION_STRING ${PC_YAJL_VERSION})
31elseif(YAJL_INCLUDE_DIR AND EXISTS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h")
32 file(STRINGS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h" yajl_version_str REGEX "^[ \t]*#define[ \t]+YAJL_(MAJOR|MINOR|MICRO)")
16 string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}") 33 string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}")
17 if (YAJL_VERSION_MINOR LESS 2) 34
18 set(YAJL_INCLUDE_DIRS) 35 string(REGEX REPLACE ".*YAJL_MAJOR ([0-9]+).*" "\\1" yajl_major "${yajl_version_str}")
19 set(YALJ_LIBRARIES) 36 string(REGEX REPLACE ".*YAJL_MINOR ([0-9]+).*" "\\1" yajl_minor "${yajl_version_str}")
20 endif() 37 string(REGEX REPLACE ".*YAJL_MICRO ([0-9]+).*" "\\1" yajl_micro "${yajl_version_str}")
21 list(APPEND YAJL_DEFINITIONS -DYAJL_MAJOR=${YAJL_VERSION_MAJOR}) 38 set(YAJL_VERSION_STRING "${yajl_major}.${yajl_minor}.${yajl_micro}")
39 unset(yajl_version_str)
40 unset(yajl_major)
41 unset(yajl_minor)
42 unset(yajl_micro)
22endif() 43endif()
23 44
24include(FindPackageHandleStandardArgs) 45include(FindPackageHandleStandardArgs)
25find_package_handle_standard_args(Yajl DEFAULT_MSG YAJL_INCLUDE_DIRS YAJL_LIBRARIES) 46find_package_handle_standard_args(Yajl
47 REQUIRED_VARS YAJL_LIBRARY YAJL_INCLUDE_DIR
48 VERSION_VAR YAJL_VERSION_STRING)
49
50if(YAJL_FOUND)
51 set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR})
52 set(YAJL_LIBRARIES ${YAJL_LIBRARY})
53
54 if(NOT TARGET Yajl::Yajl)
55 add_library(Yajl::Yajl UNKNOWN IMPORTED)
56 set_target_properties(Yajl::Yajl PROPERTIES
57 IMPORTED_LOCATION "${YAJL_LIBRARY}"
58 INTERFACE_INCLUDE_DIRECTORIES "${YAJL_INCLUDE_DIR}")
59 endif()
60endif()
26 61
27mark_as_advanced(YAJL_INCLUDE_DIRS YAJL_LIBRARIES YAJL_DEFINITIONS) 62mark_as_advanced(YAJL_INCLUDE_DIR YAJL_LIBRARY)
diff --git a/project/cmake/modules/LDGOLD.cmake b/project/cmake/modules/LDGOLD.cmake
new file mode 100644
index 0000000..ad19c6b
--- /dev/null
+++ b/project/cmake/modules/LDGOLD.cmake
@@ -0,0 +1,45 @@
1option(ENABLE_LDGOLD "Use GNU gold linker" ON)
2
3set(LDGOLD_FOUND FALSE)
4if(ENABLE_LDGOLD)
5 execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
6 if(LD_VERSION MATCHES "GNU gold")
7 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
8 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
9 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
10 set(LDGOLD_FOUND TRUE)
11 message(STATUS "Linker: GNU gold")
12 else()
13 message(WARNING "GNU gold linker is not available, falling back to default system linker")
14 endif()
15else()
16 message(STATUS "Linker: Default system linker")
17endif()
18
19set(DEFAULT_ENABLE_DEBUGFISSION FALSE)
20if(CMAKE_BUILD_TYPE STREQUAL Debug OR
21 CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND
22 LDGOLD_FOUND)
23 set(DEFAULT_ENABLE_DEBUGFISSION TRUE)
24endif()
25
26include(CMakeDependentOption)
27cmake_dependent_option(ENABLE_DEBUGFISSION "Enable Debug Fission support" ON
28 "DEFAULT_ENABLE_DEBUGFISSION" OFF)
29
30set(DEBUGFISSION_FOUND FALSE)
31if(ENABLE_DEBUGFISSION)
32 include(TestCXXAcceptsFlag)
33 check_cxx_accepts_flag(-gsplit-dwarf CXX_ACCEPTS_GSPLIT_DWARF)
34 if(CXX_ACCEPTS_GSPLIT_DWARF)
35 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gsplit-dwarf")
36 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gsplit-dwarf")
37 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
38 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
39 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
40 set(DEBUGFISSION_FOUND TRUE)
41 message(STATUS "Debug Fission enabled")
42 else()
43 message(WARNING "Debug Fission is not available")
44 endif()
45endif()
diff --git a/project/cmake/modules/extra/ECMEnableSanitizers.cmake b/project/cmake/modules/extra/ECMEnableSanitizers.cmake
new file mode 100644
index 0000000..aa7092d
--- /dev/null
+++ b/project/cmake/modules/extra/ECMEnableSanitizers.cmake
@@ -0,0 +1,149 @@
1#.rst:
2# ECMEnableSanitizers
3# -------------------
4#
5# Enable compiler sanitizer flags.
6#
7# The following sanitizers are supported:
8#
9# - Address Sanitizer
10# - Memory Sanitizer
11# - Thread Sanitizer
12# - Leak Sanitizer
13# - Undefined Behaviour Sanitizer
14#
15# All of them are implemented in Clang, depending on your version, and
16# there is an work in progress in GCC, where some of them are currently
17# implemented.
18#
19# This module will check your current compiler version to see if it
20# supports the sanitizers that you want to enable
21#
22# Usage
23# =====
24#
25# Simply add::
26#
27# include(ECMEnableSanitizers)
28#
29# to your ``CMakeLists.txt``. Note that this module is included in
30# KDECompilerSettings, so projects using that module do not need to also
31# include this one.
32#
33# The sanitizers are not enabled by default. Instead, you must set
34# ``ECM_ENABLE_SANITIZERS`` (either in your ``CMakeLists.txt`` or on the
35# command line) to a semicolon-separated list of sanitizers you wish to enable.
36# The options are:
37#
38# - address
39# - memory
40# - thread
41# - leak
42# - undefined
43#
44# The sanitizers "address", "memory" and "thread" are mutually exclusive. You
45# cannot enable two of them in the same build.
46#
47# "leak" requires the "address" sanitizer.
48#
49# .. note::
50#
51# To reduce the overhead induced by the instrumentation of the sanitizers, it
52# is advised to enable compiler optimizations (``-O1`` or higher).
53#
54# Example
55# =======
56#
57# This is an example of usage::
58#
59# mkdir build
60# cd build
61# cmake -DECM_ENABLE_SANITIZERS='address;leak;undefined' ..
62#
63# .. note::
64#
65# Most of the sanitizers will require Clang. To enable it, use::
66#
67# -DCMAKE_CXX_COMPILER=clang++
68#
69# Since 1.3.0.
70
71#=============================================================================
72# Copyright 2014 Mathieu Tarral <mathieu.tarral@gmail.com>
73#
74# Distributed under the OSI-approved BSD License (the "License");
75# see accompanying file COPYING-CMAKE-SCRIPTS for details.
76#
77# This software is distributed WITHOUT ANY WARRANTY; without even the
78# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
79# See the License for more information.
80#=============================================================================
81# (To distribute this file outside of extra-cmake-modules, substitute the full
82# License text for the above reference.)
83
84# MACRO check_compiler_version
85#-----------------------------
86macro (check_compiler_version gcc_required_version clang_required_version)
87 if (
88 (
89 CMAKE_CXX_COMPILER_ID MATCHES "GNU"
90 AND
91 CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_required_version}
92 )
93 OR
94 (
95 CMAKE_CXX_COMPILER_ID MATCHES "Clang"
96 AND
97 CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${clang_required_version}
98 )
99 )
100 # error !
101 message(FATAL_ERROR "You ask to enable the sanitizer ${CUR_SANITIZER},
102 but your compiler ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION}
103 does not support it !
104 You should use at least GCC ${gcc_required_version} or Clang ${clang_required_version}
105 (99.99 means not implemented yet)")
106 endif ()
107endmacro ()
108
109# MACRO check_compiler_support
110#------------------------------
111macro (enable_sanitizer_flags sanitize_option)
112 if (${sanitize_option} MATCHES "address")
113 check_compiler_version("4.8" "3.1")
114 set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
115 set(XSAN_LINKER_FLAGS "asan")
116 elseif (${sanitize_option} MATCHES "thread")
117 check_compiler_version("4.8" "3.1")
118 set(XSAN_COMPILE_FLAGS "-fsanitize=thread")
119 set(XSAN_LINKER_FLAGS "tsan")
120 elseif (${sanitize_option} MATCHES "memory")
121 check_compiler_version("99.99" "3.1")
122 set(XSAN_COMPILE_FLAGS "-fsanitize=memory")
123 elseif (${sanitize_option} MATCHES "leak")
124 check_compiler_version("4.9" "3.4")
125 set(XSAN_COMPILE_FLAGS "-fsanitize=leak")
126 set(XSAN_LINKER_FLAGS "lsan")
127 elseif (${sanitize_option} MATCHES "undefined")
128 check_compiler_version("4.9" "3.1")
129 set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
130 else ()
131 message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.")
132 endif ()
133endmacro ()
134
135# for each element of the ECM_ENABLE_SANITIZERS list
136foreach ( CUR_SANITIZER ${ECM_ENABLE_SANITIZERS} )
137 # lowercase filter
138 string(TOLOWER ${CUR_SANITIZER} CUR_SANITIZER)
139 # check option and enable appropriate flags
140 enable_sanitizer_flags ( ${CUR_SANITIZER} )
141 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" )
142 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
143 link_libraries(${XSAN_LINKER_FLAGS})
144 endif()
145 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
146 string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
147 string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
148 endif ()
149endforeach ()
diff --git a/project/cmake/scripts/android/archsetup.cmake b/project/cmake/scripts/android/ArchSetup.cmake
index 86c0f6a..281f94f 100644
--- a/project/cmake/scripts/android/archsetup.cmake
+++ b/project/cmake/scripts/android/ArchSetup.cmake
@@ -1,5 +1,7 @@
1if(NOT CMAKE_TOOLCHAIN_FILE) 1if(NOT CMAKE_TOOLCHAIN_FILE)
2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md") 2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md")
3elseif(NOT SDK_PLATFORM)
4 message(FATAL_ERROR "Toolchain did not define SDK_PLATFORM. Possibly outdated depends.")
3endif() 5endif()
4 6
5set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) 7set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID)
@@ -10,9 +12,13 @@ if(WITH_ARCH)
10 set(ARCH ${WITH_ARCH}) 12 set(ARCH ${WITH_ARCH})
11else() 13else()
12 if(CPU STREQUAL armeabi-v7a) 14 if(CPU STREQUAL armeabi-v7a)
13 set(ARCH arm-linux-androideabi) 15 set(ARCH arm)
16 set(NEON True)
17 elseif(CPU STREQUAL arm64-v8a)
18 set(ARCH aarch64)
14 elseif(CPU STREQUAL i686) 19 elseif(CPU STREQUAL i686)
15 set(ARCH i686-linux-android) 20 set(ARCH i486-linux)
21 set(NEON False)
16 else() 22 else()
17 message(SEND_ERROR "Unknown CPU: ${CPU}") 23 message(SEND_ERROR "Unknown CPU: ${CPU}")
18 endif() 24 endif()
@@ -21,10 +27,9 @@ endif()
21set(FFMPEG_OPTS --enable-cross-compile --cpu=cortex-a9 --arch=arm --target-os=linux --enable-neon 27set(FFMPEG_OPTS --enable-cross-compile --cpu=cortex-a9 --arch=arm --target-os=linux --enable-neon
22 --disable-vdpau --cc=${CMAKE_C_COMPILER} --host-cc=${CMAKE_C_COMPILER} 28 --disable-vdpau --cc=${CMAKE_C_COMPILER} --host-cc=${CMAKE_C_COMPILER}
23 --strip=${CMAKE_STRIP}) 29 --strip=${CMAKE_STRIP})
24set(ENABLE_SDL OFF) 30set(ENABLE_SDL OFF CACHE BOOL "" FORCE)
25set(ENABLE_X11 OFF) 31set(ENABLE_X11 OFF CACHE BOOL "" FORCE)
26set(ENABLE_EGL ON) 32set(ENABLE_AML OFF CACHE BOOL "" FORCE)
27set(ENABLE_AML ON) 33set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
28set(ENABLE_OPTICAL OFF)
29 34
30list(APPEND DEPLIBS android log jnigraphics) 35list(APPEND DEPLIBS android log jnigraphics)
diff --git a/project/cmake/scripts/android/Install.cmake b/project/cmake/scripts/android/Install.cmake
new file mode 100644
index 0000000..5c66f41
--- /dev/null
+++ b/project/cmake/scripts/android/Install.cmake
@@ -0,0 +1,123 @@
1# Android packaging
2
3find_program(AAPT_EXECUTABLE aapt PATHS ${SDK_BUILDTOOLS_PATH})
4if(NOT AAPT_EXECUTABLE)
5 message(FATAL_ERROR "Could NOT find aapt executable")
6endif()
7find_program(DX_EXECUTABLE dx PATHS ${SDK_BUILDTOOLS_PATH})
8if(NOT DX_EXECUTABLE)
9 message(FATAL_ERROR "Could NOT find dx executable")
10endif()
11find_program(ZIPALIGN_EXECUTABLE zipalign PATHS ${SDK_BUILDTOOLS_PATH})
12if(NOT ZIPALIGN_EXECUTABLE)
13 message(FATAL_ERROR "Could NOT find zipalign executable")
14endif()
15
16# Configure files into packaging environment.
17configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/Makefile.in
18 ${CMAKE_BINARY_DIR}/tools/android/packaging/Makefile @ONLY)
19configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/apksign
20 ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY)
21configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh
22 ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY)
23file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include
24 "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n")
25
26set(package_files strings.xml
27 activity_main.xml
28 AndroidManifest.xml
29 src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java
30 src/org/xbmc/kodi/XBMCInputDeviceListener.java
31 src/org/xbmc/kodi/Main.java
32 src/org/xbmc/kodi/XBMCSettingsContentObserver.java
33 src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java
34 src/org/xbmc/kodi/XBMCVideoView.java
35 src/org/xbmc/kodi/Splash.java
36 src/org/xbmc/kodi/XBMCBroadcastReceiver.java)
37foreach(file IN LISTS package_files)
38 configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in
39 ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/${file} @ONLY)
40endforeach()
41
42# Copy files to the location expected by the Android packaging scripts.
43add_custom_target(bundle
44 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/media
45 ${CMAKE_BINARY_DIR}/tools/android/packaging/media
46 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/res
47 ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res
48 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7
49 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC}
50 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
51 ${libdir}/${APP_NAME_LC}/$<TARGET_FILE_NAME:${APP_NAME_LC}>)
52add_dependencies(bundle ${APP_NAME_LC})
53
54# This function is used to prepare a prefix expected by the Android packaging
55# scripts. It creates a bundle_files command that is added to the bundle target.
56function(add_bundle_file file destination relative)
57 if(NOT TARGET bundle_files)
58 file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake)
59 add_custom_target(bundle_files COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake)
60 add_dependencies(bundle bundle_files)
61 endif()
62
63 string(REPLACE "${relative}/" "" outfile ${file})
64 get_filename_component(file ${file} REALPATH)
65 get_filename_component(outdir ${outfile} DIRECTORY)
66 file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake
67 "file(COPY \"${file}\" DESTINATION \"${destination}/${outdir}\")\n")
68 if(file MATCHES "\\.so\\..+$")
69 get_filename_component(srcfile "${file}" NAME)
70 string(REGEX REPLACE "\\.so\\..+$" "\.so" destfile ${srcfile})
71 file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake
72 "file(RENAME \"${destination}/${outdir}/${srcfile}\" \"${destination}/${outdir}/${destfile}\")\n")
73 endif()
74endfunction()
75
76# Copy files into prefix
77foreach(file IN LISTS XBT_FILES install_data)
78 string(REPLACE "${CMAKE_BINARY_DIR}/" "" file ${file})
79 add_bundle_file(${CMAKE_BINARY_DIR}/${file} ${datarootdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR})
80endforeach()
81
82foreach(library IN LISTS LIBRARY_FILES)
83 add_bundle_file(${library} ${libdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR})
84endforeach()
85
86foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay)
87 string(TOUPPER ${lib} lib_up)
88 set(lib_so ${${lib_up}_SONAME})
89 if(lib_so AND EXISTS ${DEPENDS_PATH}/lib/${lib_so})
90 add_bundle_file(${DEPENDS_PATH}/lib/${lib_so} ${libdir} "")
91 endif()
92endforeach()
93add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "")
94add_bundle_file(${DEPENDS_PATH}/lib/librtmp.so ${libdir} "")
95
96# Main targets from Makefile.in
97if(CPU MATCHES i686)
98 set(CPU x86)
99 set(ARCH x86)
100endif()
101foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign)
102 add_custom_target(${target}
103 COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} ${CMAKE_MAKE_PROGRAM}
104 -C ${CMAKE_BINARY_DIR}/tools/android/packaging
105 CORE_SOURCE_DIR=${CORE_SOURCE_DIR}
106 CC=${CMAKE_C_COMPILER}
107 CPU=${CPU}
108 ARCH=${ARCH}
109 PREFIX=${prefix}
110 NDKROOT=${NDKROOT}
111 SDKROOT=${SDKROOT}
112 SDK_PLATFORM=${SDK_PLATFORM}
113 STRIP=${CMAKE_STRIP}
114 AAPT=${AAPT_EXECUTABLE}
115 DX=${DX_EXECUTABLE}
116 ZIPALIGN=${ZIPALIGN_EXECUTABLE}
117 ${target}
118 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/android/packaging
119 )
120 if(NOT target STREQUAL apk-clean)
121 add_dependencies(${target} bundle)
122 endif()
123endforeach()
diff --git a/project/cmake/scripts/android/Macros.cmake b/project/cmake/scripts/android/Macros.cmake
new file mode 120000
index 0000000..2fdbb25
--- /dev/null
+++ b/project/cmake/scripts/android/Macros.cmake
@@ -0,0 +1 @@
../linux/Macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/windows/pathsetup.cmake b/project/cmake/scripts/android/PathSetup.cmake
index 8550616..69de883 100644
--- a/project/cmake/scripts/windows/pathsetup.cmake
+++ b/project/cmake/scripts/android/PathSetup.cmake
@@ -1,8 +1,7 @@
1if(NOT prefix) 1if(NOT prefix)
2 set(prefix ${CMAKE_INSTALL_PREFIX}) 2 set(prefix ${CMAKE_BINARY_DIR}/install)
3else()
4 set(CMAKE_INSTALL_PREFIX ${prefix})
5endif() 3endif()
4set(CMAKE_INSTALL_PREFIX ${prefix})
6if(NOT exec_prefix) 5if(NOT exec_prefix)
7 set(exec_prefix ${prefix}) 6 set(exec_prefix ${prefix})
8endif() 7endif()
diff --git a/project/cmake/scripts/android/macros.cmake b/project/cmake/scripts/android/macros.cmake
deleted file mode 120000
index 28c77ca..0000000
--- a/project/cmake/scripts/android/macros.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../linux/macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/android/pathsetup.cmake b/project/cmake/scripts/android/pathsetup.cmake
deleted file mode 120000
index 26d7f17..0000000
--- a/project/cmake/scripts/android/pathsetup.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../linux/pathsetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/common/AddOptions.cmake b/project/cmake/scripts/common/AddOptions.cmake
new file mode 100644
index 0000000..96837c1
--- /dev/null
+++ b/project/cmake/scripts/common/AddOptions.cmake
@@ -0,0 +1,78 @@
1# - Add options without repeating them on the command line
2#
3# Synopsis:
4#
5# add_options (lang build opts)
6#
7# where:
8#
9# lang Name of the language whose compiler should receive the
10# options, e.g. CXX. If a comma-separated list is received
11# then the option is added for all those languages. Use the
12# special value ALL_LANGUAGES for these languages: CXX, C
13# and Fortran
14#
15# build Kind of build to which this options should apply,
16# such as DEBUG and RELEASE. This can also be a comma-
17# separated list. Use the special value ALL_BUILDS to apply
18# to all builds.
19#
20# opts List of options to add. Each should be quoted.
21#
22# Example:
23#
24# add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall")
25
26function(add_options langs builds)
27 # special handling of empty language specification
28 if("${langs}" STREQUAL "ALL_LANGUAGES")
29 set(langs CXX C Fortran)
30 endif()
31 foreach(lang IN LISTS langs)
32 # prepend underscore if necessary
33 foreach(build IN LISTS builds)
34 if(NOT ("${build}" STREQUAL "ALL_BUILDS"))
35 set(_bld "_${build}")
36 string(TOUPPER "${_bld}" _bld)
37 else()
38 set(_bld "")
39 endif()
40 foreach(_opt IN LISTS ARGN)
41 set(_var "CMAKE_${lang}_FLAGS${_bld}")
42 #message(STATUS "Adding \"${_opt}\" to \${${_var}}")
43 # remove it first
44 string(REPLACE "${_opt}" "" _without "${${_var}}")
45 string(STRIP "${_without}" _without)
46 # we need to strip this one as well, so they are comparable
47 string(STRIP "${${_var}}" _stripped)
48 # if it wasn't there, then add it at the end
49 if("${_without}" STREQUAL "${_stripped}")
50 # don't add any extra spaces if no options yet are set
51 if(NOT ${_stripped} STREQUAL "")
52 set(${_var} "${_stripped} ${_opt}")
53 else()
54 set(${_var} "${_opt}")
55 endif()
56 set(${_var} "${${_var}}" PARENT_SCOPE)
57 endif()
58 endforeach()
59 endforeach()
60 endforeach()
61endfunction()
62
63# set varname to flag unless user has specified something that matches regex
64function(set_default_option varname flag regex)
65 if(NOT "$ENV{CXXFLAGS}" MATCHES "${regex}"
66 AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}"
67 AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}")
68 set(${varname} ${flag} PARENT_SCOPE)
69 else()
70 set(${varname} PARENT_SCOPE)
71 endif()
72endfunction()
73
74# note: this must be called before project()
75macro(no_default_options)
76 # prevent the platform probe to set options
77 set(CMAKE_NOT_USING_CONFIG_FLAGS TRUE)
78endmacro()
diff --git a/project/cmake/scripts/common/AddonHelpers.cmake b/project/cmake/scripts/common/AddonHelpers.cmake
new file mode 100644
index 0000000..6680ed1
--- /dev/null
+++ b/project/cmake/scripts/common/AddonHelpers.cmake
@@ -0,0 +1,268 @@
1# Workaround for the fact that cpack's filenames are not customizable.
2# Each add-on is added as a separate component to facilitate zip/tgz packaging.
3# The filenames are always of the form basename-component, which is
4# incompatible with the addonid-version scheme we want. This hack renames
5# the files from the file names generated by the 'package' target.
6# Sadly we cannot extend the 'package' target, as it is a builtin target, see
7# http://public.kitware.com/Bug/view.php?id=8438
8# Thus, we have to add an 'addon-package' target.
9add_custom_target(addon-package
10 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package)
11
12macro(add_cpack_workaround target version ext)
13 if(NOT PACKAGE_DIR)
14 set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips")
15 endif()
16
17 add_custom_command(TARGET addon-package PRE_BUILD
18 COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR}
19 COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext})
20endmacro()
21
22# Grab the version from a given add-on's addon.xml
23macro (addon_version dir prefix)
24 if(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in)
25 file(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML)
26 else()
27 file(READ ${dir}/addon.xml ADDONXML)
28 endif()
29
30 string(REGEX MATCH "<addon[^>]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML})
31 string(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING})
32 message(STATUS ${prefix}_VERSION=${${prefix}_VERSION})
33endmacro()
34
35# Build, link and optionally package an add-on
36macro (build_addon target prefix libs)
37 addon_version(${target} ${prefix})
38 if(${prefix}_SOURCES)
39 add_library(${target} ${${prefix}_SOURCES})
40 target_link_libraries(${target} ${${libs}})
41 set_target_properties(${target} PROPERTIES VERSION ${${prefix}_VERSION}
42 SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}
43 PREFIX "")
44 if(OS STREQUAL "android")
45 set_target_properties(${target} PROPERTIES PREFIX "lib")
46 endif()
47 elseif(${prefix}_CUSTOM_BINARY)
48 add_custom_target(${target} ALL)
49 endif()
50
51 # get the library's location
52 if(${prefix}_CUSTOM_BINARY)
53 list(GET ${prefix}_CUSTOM_BINARY 0 LIBRARY_LOCATION)
54 list(GET ${prefix}_CUSTOM_BINARY 1 LIBRARY_FILENAME)
55 else()
56 set(LIBRARY_LOCATION $<TARGET_FILE:${target}>)
57 # get the library's filename
58 if("${CORE_SYSTEM_NAME}" STREQUAL "android")
59 # for android we need the filename without any version numbers
60 set(LIBRARY_FILENAME $<TARGET_LINKER_FILE_NAME:${target}>)
61 else()
62 set(LIBRARY_FILENAME $<TARGET_FILE_NAME:${target}>)
63 endif()
64 endif()
65
66 # if there's an addon.xml.in we need to generate the addon.xml
67 if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in)
68 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in)
69 set(PLATFORM ${CORE_SYSTEM_NAME})
70
71 file(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file)
72 string(CONFIGURE "${addon_file}" addon_file_conf @ONLY)
73 file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}")
74 if(${APP_NAME_UC}_BUILD_DIR)
75 file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}")
76 endif()
77 endif()
78
79 # if there's an settings.xml.in we need to generate the settings.xml
80 if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in)
81 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in)
82 set(PLATFORM ${CORE_SYSTEM_NAME})
83
84 file(READ ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in settings_file)
85 string(CONFIGURE "${settings_file}" settings_file_conf @ONLY)
86 file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml CONTENT "${settings_file_conf}")
87 if(${APP_NAME_UC}_BUILD_DIR)
88 file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources/settings.xml CONTENT "${settings_file_conf}")
89 endif()
90 endif()
91
92 # set zip as default if addon-package is called without PACKAGE_XXX
93 set(CPACK_GENERATOR "ZIP")
94 set(ext "zip")
95 if(PACKAGE_ZIP OR PACKAGE_TGZ)
96 if(PACKAGE_TGZ)
97 set(CPACK_GENERATOR "TGZ")
98 set(ext "tar.gz")
99 endif()
100 set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
101 set(CPACK_PACKAGE_FILE_NAME addon)
102 if(CMAKE_BUILD_TYPE STREQUAL "Release")
103 set(CPACK_STRIP_FILES TRUE)
104 endif()
105 set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
106 set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
107 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION})
108 # Pack files together to create an archive
109 install(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "xml.in" EXCLUDE)
110 if(WIN32)
111 if(NOT CPACK_PACKAGE_DIRECTORY)
112 # determine the temporary path
113 file(TO_CMAKE_PATH "$ENV{TEMP}" WIN32_TEMP_PATH)
114 string(LENGTH "${WIN32_TEMP_PATH}" WIN32_TEMP_PATH_LENGTH)
115 string(LENGTH "${PROJECT_BINARY_DIR}" PROJECT_BINARY_DIR_LENGTH)
116
117 # check if the temporary path is shorter than the default packaging directory path
118 if(WIN32_TEMP_PATH_LENGTH GREATER 0 AND WIN32_TEMP_PATH_LENGTH LESS PROJECT_BINARY_DIR_LENGTH)
119 # set the directory used by CPack for packaging to the temp directory
120 set(CPACK_PACKAGE_DIRECTORY ${WIN32_TEMP_PATH})
121 endif()
122 endif()
123
124 # in case of a VC++ project the installation location contains a $(Configuration) VS variable
125 # we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration
126 # is changed within Visual Studio)
127 string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}")
128
129 if(${prefix}_SOURCES)
130 # install the generated DLL file
131 install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target}
132 COMPONENT ${target}-${${prefix}_VERSION})
133
134 if(CMAKE_BUILD_TYPE MATCHES Debug)
135 # for debug builds also install the PDB file
136 get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY)
137 install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${target}
138 COMPONENT ${target}-${${prefix}_VERSION})
139 endif()
140 endif()
141 if (${prefix}_CUSTOM_BINARY)
142 list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY)
143 list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY)
144 install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY})
145 endif()
146 if(${prefix}_CUSTOM_DATA)
147 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources)
148 endif()
149 else()
150 if(NOT CPACK_PACKAGE_DIRECTORY)
151 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR})
152 endif()
153 if(${prefix}_SOURCES)
154 install(TARGETS ${target} DESTINATION ${target}
155 COMPONENT ${target}-${${prefix}_VERSION})
156 endif()
157 if (${prefix}_CUSTOM_BINARY)
158 list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY)
159 list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY)
160 if(OS STREQUAL "android")
161 set(TO_BINARY "lib${TO_BINARY}")
162 endif()
163 install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY}
164 COMPONENT ${target}-${${prefix}_VERSION})
165 endif()
166 if(${prefix}_CUSTOM_DATA)
167 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources)
168 endif()
169 endif()
170 add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext})
171 else()
172 if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL rbpi OR CORE_SYSTEM_NAME STREQUAL freebsd)
173 if(NOT OVERRIDE_PATHS)
174 if(CMAKE_INSTALL_PREFIX AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT CMAKE_INSTALL_PREFIX STREQUAL "${${APP_NAME_UC}_PREFIX}")
175 message(WARNING "CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} differs from ${APP_NAME} prefix, changing to ${${APP_NAME_UC}_PREFIX}. Please pass -DOVERRIDE_PATHS=1 to skip this check")
176 endif()
177 if(CMAKE_INSTALL_LIBDIR AND NOT CMAKE_INSTALL_LIBDIR STREQUAL "${${APP_NAME_UC}_LIB_DIR}")
178 message(WARNING "CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} differs from ${APP_NAME} libdir, changing to ${${APP_NAME_UC}_LIB_DIR}. Please pass -DOVERRIDE_PATHS=1 to skip this check")
179 endif()
180 if(CMAKE_INSTALL_DATADIR AND NOT CMAKE_INSTALL_DATADIR STREQUAL "${${APP_NAME_UC}_DATA_DIR}")
181 message(WARNING "CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_DATADIR} differs from ${APP_NAME} datadir, changing to ${${APP_NAME_UC}_DATA_DIR}. Please pass -DOVERRIDE_PATHS=1 to skip this check")
182 endif()
183 set(CMAKE_INSTALL_PREFIX "${${APP_NAME_UC}_PREFIX}" CACHE PATH "${APP_NAME} install prefix" FORCE)
184 set(CMAKE_INSTALL_LIBDIR "${${APP_NAME_UC}_LIB_DIR}" CACHE PATH "${APP_NAME} install libdir" FORCE)
185 set(CMAKE_INSTALL_DATADIR "${${APP_NAME_UC}_DATA_DIR}" CACHE PATH "${APP_NAME} install datadir" FORCE)
186 else()
187 if(NOT CMAKE_INSTALL_LIBDIR)
188 set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}")
189 endif()
190 if(NOT CMAKE_INSTALL_DATADIR)
191 set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/${APP_NAME_LC}")
192 endif()
193 endif()
194 else()
195 set(CMAKE_INSTALL_LIBDIR "lib/${APP_NAME_LC}")
196 set(CMAKE_INSTALL_DATADIR "share/${APP_NAME_LC}")
197 endif()
198 if(${prefix}_SOURCES)
199 install(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target})
200 endif()
201 if (${prefix}_CUSTOM_BINARY)
202 list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY)
203 list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY)
204 if(OS STREQUAL "android")
205 set(TO_BINARY "lib${TO_BINARY}")
206 endif()
207 install(FILES ${FROM_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${TO_BINARY})
208 endif()
209 install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons PATTERN "xml.in" EXCLUDE)
210 if(${prefix}_CUSTOM_DATA)
211 install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources)
212 endif()
213 endif()
214 if(${APP_NAME_UC}_BUILD_DIR)
215 file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*)
216 if(${prefix}_CUSTOM_DATA)
217 add_custom_command(TARGET ${target} POST_BUILD
218 COMMAND ${CMAKE_COMMAND} -E copy_directory
219 ${${prefix}_CUSTOM_DATA}
220 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources)
221 endif()
222 foreach(file ${files})
223 string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${target}/" "" name "${file}")
224 # A good way to deal with () in filenames
225 if(NOT ${file} MATCHES xml.in)
226 configure_file(${file} ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${name} COPYONLY)
227 endif()
228 endforeach()
229 add_custom_command(TARGET ${target} POST_BUILD
230 COMMAND ${CMAKE_COMMAND} -E copy
231 ${LIBRARY_LOCATION}
232 ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME})
233 endif()
234endmacro()
235
236# finds a path to a given file (recursive)
237function (kodi_find_path var_name filename search_path strip_file)
238 file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename})
239 if(strip_file)
240 string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE})
241 endif()
242 set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE)
243endfunction()
244
245# Cmake build options
246include(AddOptions)
247include(TestCXXAcceptsFlag)
248option(PACKAGE_ZIP "Package Zip file?" OFF)
249option(PACKAGE_TGZ "Package TGZ file?" OFF)
250option(BUILD_SHARED_LIBS "Build shared libs?" ON)
251
252# LTO support?
253CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO)
254if(HAVE_LTO)
255 option(USE_LTO "use link time optimization" OFF)
256 if(USE_LTO)
257 add_options(ALL_LANGUAGES ALL_BUILDS "-flto")
258 endif()
259endif()
260
261# set this to try linking dependencies as static as possible
262if(ADDONS_PREFER_STATIC_LIBS)
263 set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
264endif()
265
266if(${APP_NAME_UC}_BUILD_DIR)
267 list(APPEND CMAKE_PREFIX_PATH ${${APP_NAME_UC}_BUILD_DIR}/build)
268endif()
diff --git a/project/cmake/scripts/common/archsetup.cmake b/project/cmake/scripts/common/ArchSetup.cmake
index dff5558..438e3bd 100644
--- a/project/cmake/scripts/common/archsetup.cmake
+++ b/project/cmake/scripts/common/ArchSetup.cmake
@@ -71,15 +71,33 @@ if(CMAKE_TOOLCHAIN_FILE)
71 endif() 71 endif()
72endif() 72endif()
73 73
74# While CMAKE_CROSSCOMPILING is set unconditionally if there's a toolchain file,
75# this variable is set if we can execute build artefacts on the host system (for example unit tests).
76if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR AND
77 CMAKE_HOST_SYSTEM_NAME STREQUAL CMAKE_SYSTEM_NAME)
78 set(CORE_HOST_IS_TARGET TRUE)
79else()
80 set(CORE_HOST_IS_TARGET FALSE)
81endif()
82
74# Main cpp 83# Main cpp
75set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp) 84set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp)
76 85
77# system specific arch setup 86# system specific arch setup
78include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/archsetup.cmake) 87if(NOT EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake)
88 message(FATAL_ERROR "Couldn't find configuration for '${CORE_SYSTEM_NAME}' "
89 "Either the platform is not (yet) supported "
90 "or a toolchain file has to be specified. "
91 "Consult ${CMAKE_SOURCE_DIR}/README.md for instructions. "
92 "Note: Specifying a toolchain requires a clean build directory!")
93endif()
94include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake)
79 95
80message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") 96message(STATUS "Core system type: ${CORE_SYSTEM_NAME}")
81message(STATUS "Platform: ${PLATFORM}") 97message(STATUS "Platform: ${PLATFORM}")
82message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") 98message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}")
99message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}")
100message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}")
83 101
84check_type(string std::u16string HAVE_STD__U16_STRING) 102check_type(string std::u16string HAVE_STD__U16_STRING)
85check_type(string std::u32string HAVE_STD__U32_STRING) 103check_type(string std::u32string HAVE_STD__U32_STRING)
@@ -87,6 +105,7 @@ check_type(string char16_t HAVE_CHAR16_T)
87check_type(string char32_t HAVE_CHAR32_T) 105check_type(string char32_t HAVE_CHAR32_T)
88check_type(stdint.h uint_least16_t HAVE_STDINT_H) 106check_type(stdint.h uint_least16_t HAVE_STDINT_H)
89check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) 107check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE)
108check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H)
90check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) 109check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH)
91check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH) 110check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH)
92check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP) 111check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP)
@@ -97,3 +116,35 @@ check_function_exists(localtime_r HAVE_LOCALTIME_R)
97if(HAVE_LOCALTIME_R) 116if(HAVE_LOCALTIME_R)
98 list(APPEND SYSTEM_DEFINES -DHAVE_LOCALTIME_R=1) 117 list(APPEND SYSTEM_DEFINES -DHAVE_LOCALTIME_R=1)
99endif() 118endif()
119if(HAVE_INTTYPES_H)
120 list(APPEND SYSTEM_DEFINES -DHAVE_INTTYPES_H=1)
121endif()
122
123find_package(SSE)
124foreach(_sse SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 AVX AVX2)
125 if(${${_sse}_FOUND})
126 # enable SSE versions up to 4.1 by default, if available
127 if(NOT ${_sse} MATCHES "AVX" AND NOT ${_sse} STREQUAL "SSE4_2")
128 option(ENABLE_${_sse} "Enable ${_sse}" ON)
129 else()
130 option(ENABLE_${_sse} "Enable ${_sse}" OFF)
131 endif()
132 endif()
133 if(ENABLE_${_sse})
134 set(HAVE_${_sse} TRUE CACHE STRING "${_sse} enabled")
135 list(APPEND ARCH_DEFINES -DHAVE_${_sse}=1)
136 endif()
137endforeach()
138
139if(NOT DEFINED NEON OR NEON)
140 option(ENABLE_NEON "Enable NEON optimization" ${NEON})
141 if(ENABLE_NEON)
142 message(STATUS "NEON optimization enabled")
143 add_options(CXX ALL_BUILDS "-mfpu=neon -mvectorize-with-neon-quad")
144 endif()
145endif()
146
147if(CMAKE_BUILD_TYPE STREQUAL "Debug")
148 add_options (ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall")
149endif()
150
diff --git a/project/cmake/scripts/common/CMakeHelpers.cmake b/project/cmake/scripts/common/CMakeHelpers.cmake
new file mode 100644
index 0000000..995c38a
--- /dev/null
+++ b/project/cmake/scripts/common/CMakeHelpers.cmake
@@ -0,0 +1,54 @@
1# This file contains functions that support the debugging of the CMake files.
2
3# This file shouldn't be included per default in any CMake file. It should be
4# included and used only on demand. All functions are prefixed with "debug_".
5#
6# Usage:
7# include(scripts/common/CMakeHelpers.cmake)
8# debug_print_variables()
9
10# Print all CMake variables.
11macro(debug_print_variables)
12 get_cmake_property(_variableNames VARIABLES)
13 foreach(_variableName ${_variableNames})
14 message(STATUS "${_variableName} = ${${_variableName}}")
15 endforeach()
16endmacro()
17
18# Get all properties that CMake supports and convert them to a list.
19function(debug_get_properties VAR)
20 execute_process(COMMAND cmake --help-property-list
21 OUTPUT_VARIABLE _properties)
22 string(REGEX REPLACE ";" "\\\\;" _properties "${_properties}")
23 string(REGEX REPLACE "\n" ";" _properties "${_properties}")
24 list(REMOVE_DUPLICATES _properties)
25 list(REMOVE_ITEM _properties LOCATION)
26 set(${VAR} ${_properties} PARENT_SCOPE)
27endfunction()
28
29# List all properties.
30function(debug_list_properties)
31 debug_get_properties(_properties)
32 message("CMake properties = ${_properties}")
33endfunction()
34
35# Print all set properties of a specified target.
36function(debug_print_target_properties target)
37 if(NOT TARGET ${target})
38 message(FATAL_ERROR "There is no target named '${target}'")
39 endif()
40
41 debug_get_properties(_properties)
42
43 # Reading LOCATION property is deprecated and triggers a fatal error.
44 string(REGEX REPLACE ";LOCATION;|LOCATION" "" _properties "${_properties}")
45 string(REGEX REPLACE "<CONFIG>" "${CMAKE_BUILD_TYPE}" _properties
46 "${_properties}")
47 foreach(_property ${_properties})
48 get_property(_value TARGET ${target} PROPERTY ${_property} SET)
49 if(_value)
50 get_target_property(_value ${target} ${_property})
51 message("${target} ${_property} = ${_value}")
52 endif()
53 endforeach()
54endfunction()
diff --git a/project/cmake/scripts/common/checkcommits.cmake b/project/cmake/scripts/common/CheckCommits.cmake
index 304e623..304e623 100644
--- a/project/cmake/scripts/common/checkcommits.cmake
+++ b/project/cmake/scripts/common/CheckCommits.cmake
diff --git a/project/cmake/scripts/common/check_target_platform.cmake b/project/cmake/scripts/common/CheckTargetPlatform.cmake
index fc8b403..5b5d9a1 100644
--- a/project/cmake/scripts/common/check_target_platform.cmake
+++ b/project/cmake/scripts/common/CheckTargetPlatform.cmake
@@ -9,7 +9,7 @@ function(check_target_platform dir target_platform build)
9 if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt) 9 if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt)
10 # get all the specified platforms 10 # get all the specified platforms
11 file(STRINGS ${dir}/platforms.txt platforms) 11 file(STRINGS ${dir}/platforms.txt platforms)
12 separate_arguments(platforms) 12 string(REPLACE " " ";" platforms ${platforms})
13 13
14 # check if the addon/dependency should be built for the current platform 14 # check if the addon/dependency should be built for the current platform
15 foreach(platform ${platforms}) 15 foreach(platform ${platforms})
@@ -21,11 +21,11 @@ function(check_target_platform dir target_platform build)
21 if(${platform_first} STREQUAL "!") 21 if(${platform_first} STREQUAL "!")
22 # extract the platform 22 # extract the platform
23 string(LENGTH ${platform} platform_length) 23 string(LENGTH ${platform} platform_length)
24 MATH(EXPR platform_length "${platform_length} - 1") 24 math(EXPR platform_length "${platform_length} - 1")
25 string(SUBSTRING ${platform} 1 ${platform_length} platform) 25 string(SUBSTRING ${platform} 1 ${platform_length} platform)
26 26
27 # check if the current platform does not match the extracted platform 27 # check if the current platform does not match the extracted platform
28 if (NOT ${platform} STREQUAL ${target_platform}) 28 if(NOT ${platform} STREQUAL ${target_platform})
29 set(${build} TRUE) 29 set(${build} TRUE)
30 endif() 30 endif()
31 endif() 31 endif()
@@ -43,19 +43,21 @@ function(check_install_permissions install_dir have_perms)
43 # param[in] install_dir directory to check for write permissions 43 # param[in] install_dir directory to check for write permissions
44 # param[out] have_perms wether we have permissions to install to install_dir 44 # param[out] have_perms wether we have permissions to install to install_dir
45 45
46 set(${have_perms} TRUE) 46 set(testfile_lib ${install_dir}/lib/kodi/.cmake-inst-test)
47 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/lib/kodi 47 set(testfile_share ${install_dir}/share/kodi/.cmake-inst-test)
48 COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/share/kodi 48 get_filename_component(testdir_lib ${testfile_lib} DIRECTORY)
49 COMMAND ${CMAKE_COMMAND} -E touch ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test 49 get_filename_component(testdir_share ${testfile_share} DIRECTORY)
50 RESULT_VARIABLE permtest)
51 50
52 if(${permtest} GREATER 0) 51 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_lib})
53 message(STATUS "check_install_permissions: ${permtest}") 52 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_share})
54 set(${have_perms} FALSE) 53 execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_lib})
55 endif() 54 execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_share})
56 set(${have_perms} "${${have_perms}}" PARENT_SCOPE)
57 55
58 if(EXISTS ${install_dir}/lib/kodi/.cmake-inst-test OR EXISTS ${install_dir}/share/kodi/.cmake-inst-test) 56 if(EXISTS ${testfile_lib} AND EXISTS ${testfile_share})
59 file(REMOVE ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test) 57 set(${have_perms} True PARENT_SCOPE)
58 else()
59 message(STATUS "check_install_permissions ${install_dir}: failed to create files")
60 set(${have_perms} False PARENT_SCOPE)
60 endif() 61 endif()
62 file(REMOVE ${testfile_lib} ${testfile_share})
61endfunction() 63endfunction()
diff --git a/project/cmake/scripts/common/GenerateVersionedFiles.cmake b/project/cmake/scripts/common/GenerateVersionedFiles.cmake
new file mode 100644
index 0000000..e105b27
--- /dev/null
+++ b/project/cmake/scripts/common/GenerateVersionedFiles.cmake
@@ -0,0 +1,18 @@
1include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake)
2
3core_find_versions()
4file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon)
5file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/kodi.guilib)
6
7# configure_file without dependency tracking
8# configure_file would register additional file dependencies that interfere
9# with the ones from add_custom_command (and the generation would happen twice)
10function(generate_versioned_file _SRC _DEST)
11 file(READ ${CORE_SOURCE_DIR}/${_SRC} file_content)
12 string(CONFIGURE "${file_content}" file_content @ONLY)
13 file(WRITE ${CMAKE_BINARY_DIR}/${_DEST} "${file_content}")
14endfunction()
15
16generate_versioned_file(addons/xbmc.addon/addon.xml.in addons/xbmc.addon/addon.xml)
17generate_versioned_file(addons/kodi.guilib/addon.xml.in addons/kodi.guilib/addon.xml)
18generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp)
diff --git a/project/cmake/scripts/common/generatorsetup.cmake b/project/cmake/scripts/common/GeneratorSetup.cmake
index 75083ca..304b504 100644
--- a/project/cmake/scripts/common/generatorsetup.cmake
+++ b/project/cmake/scripts/common/GeneratorSetup.cmake
@@ -22,3 +22,28 @@ else()
22 set(CORE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) 22 set(CORE_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
23 message(STATUS "Generator: Single-configuration: ${CMAKE_BUILD_TYPE} (${CMAKE_GENERATOR})") 23 message(STATUS "Generator: Single-configuration: ${CMAKE_BUILD_TYPE} (${CMAKE_GENERATOR})")
24endif() 24endif()
25
26# Print CMake version
27message(STATUS "CMake Version: ${CMAKE_VERSION}")
28
29# Deal with CMake special cases
30if(CMAKE_VERSION VERSION_EQUAL 3.5.1)
31 message(WARNING "CMake 3.5.1 introduced a crash during configuration. "
32 "Please consider upgrading to 3.5.2 (cmake.org/Bug/view.php?id=16044)")
33endif()
34
35# Darwin needs CMake 3.4
36if(APPLE AND CMAKE_VERSION VERSION_LESS 3.4)
37 message(WARNING "Build on Darwin requires CMake 3.4 or later (tdb library support) "
38 "or the usage of the patched version in depends.")
39endif()
40
41# Windows needs CMake 3.6 (VS_STARTUP_PROJECT)
42if(WIN32 AND CMAKE_VERSION VERSION_LESS 3.6)
43 message(FATAL_ERROR "Build on Windows needs CMake 3.6 or later")
44endif()
45
46# Ninja needs CMake 3.2 due to ExternalProject BUILD_BYPRODUCTS usage
47if(CMAKE_GENERATOR STREQUAL Ninja AND CMAKE_VERSION VERSION_LESS 3.2)
48 message(FATAL_ERROR "Generator: Ninja requires CMake 3.2 or later")
49endif()
diff --git a/project/cmake/scripts/common/handle-depends.cmake b/project/cmake/scripts/common/HandleDepends.cmake
index 4d78928..880ccdf 100644
--- a/project/cmake/scripts/common/handle-depends.cmake
+++ b/project/cmake/scripts/common/HandleDepends.cmake
@@ -1,15 +1,17 @@
1include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) 1include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake)
2 2
3# handle addon depends 3# handle addon depends
4function(add_addon_depends addon searchpath) 4function(add_addon_depends addon searchpath)
5 # input: string addon string searchpath 5 # input: string addon string searchpath
6 6
7 set(OUTPUT_DIR ${DEPENDS_PATH}) 7 set(OUTPUT_DIR ${ADDON_DEPENDS_PATH})
8 # look for platform-specific dependencies
8 file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) 9 file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt)
9 file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) 10 file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt)
10 list(APPEND cmake_input_files ${cmake_input_files2}) 11 list(APPEND cmake_input_files ${cmake_input_files2})
11 12
12 foreach(file ${cmake_input_files}) 13 foreach(file ${cmake_input_files})
14 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${file})
13 if(NOT (file MATCHES CMakeLists.txt OR 15 if(NOT (file MATCHES CMakeLists.txt OR
14 file MATCHES install.txt OR 16 file MATCHES install.txt OR
15 file MATCHES noinstall.txt OR 17 file MATCHES noinstall.txt OR
@@ -18,9 +20,9 @@ function(add_addon_depends addon searchpath)
18 file MATCHES platforms.txt)) 20 file MATCHES platforms.txt))
19 message(STATUS "Processing ${file}") 21 message(STATUS "Processing ${file}")
20 file(STRINGS ${file} def) 22 file(STRINGS ${file} def)
21 separate_arguments(def) 23 string(REPLACE " " ";" def ${def})
22 list(LENGTH def deflength) 24 list(LENGTH def deflength)
23 get_filename_component(dir ${file} PATH) 25 get_filename_component(dir ${file} DIRECTORY)
24 26
25 # get the id of the dependency 27 # get the id of the dependency
26 if(NOT "${def}" STREQUAL "") 28 if(NOT "${def}" STREQUAL "")
@@ -45,8 +47,9 @@ function(add_addon_depends addon searchpath)
45 47
46 # check if there are any library specific flags that need to be passed on 48 # check if there are any library specific flags that need to be passed on
47 if(EXISTS ${dir}/flags.txt) 49 if(EXISTS ${dir}/flags.txt)
50 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt)
48 file(STRINGS ${dir}/flags.txt extraflags) 51 file(STRINGS ${dir}/flags.txt extraflags)
49 separate_arguments(extraflags) 52 string(REPLACE " " ";" extraflags ${extraflags})
50 message(STATUS "${id} extraflags: ${extraflags}") 53 message(STATUS "${id} extraflags: ${extraflags}")
51 endif() 54 endif()
52 55
@@ -70,16 +73,20 @@ function(add_addon_depends addon searchpath)
70 73
71 if(CMAKE_TOOLCHAIN_FILE) 74 if(CMAKE_TOOLCHAIN_FILE)
72 list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) 75 list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
73 MESSAGE("toolchain specified") 76 message("toolchain specified")
74 MESSAGE(${BUILD_ARGS}) 77 message(${BUILD_ARGS})
75 endif() 78 endif()
76 79
77 # if there's a CMakeLists.txt use it to prepare the build 80 # prepare patchfile. ensure we have a clean file after reconfiguring
78 set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) 81 set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake)
82 file(REMOVE ${PATCH_FILE})
83
84 # if there's a CMakeLists.txt use it to prepare the build
79 if(EXISTS ${dir}/CMakeLists.txt) 85 if(EXISTS ${dir}/CMakeLists.txt)
86 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt)
80 file(APPEND ${PATCH_FILE} 87 file(APPEND ${PATCH_FILE}
81 "file(COPY ${dir}/CMakeLists.txt 88 "file(COPY ${dir}/CMakeLists.txt
82 DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") 89 DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
83 endif() 90 endif()
84 91
85 # check if we have patches to apply 92 # check if we have patches to apply
@@ -104,6 +111,7 @@ function(add_addon_depends addon searchpath)
104 endif() 111 endif()
105 endif() 112 endif()
106 113
114 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch})
107 file(APPEND ${PATCH_FILE} 115 file(APPEND ${PATCH_FILE}
108 "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") 116 "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n")
109 endforeach() 117 endforeach()
@@ -125,6 +133,7 @@ function(add_addon_depends addon searchpath)
125 133
126 # check if there's a deps.txt containing dependencies on other libraries 134 # check if there's a deps.txt containing dependencies on other libraries
127 if(EXISTS ${dir}/deps.txt) 135 if(EXISTS ${dir}/deps.txt)
136 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt)
128 file(STRINGS ${dir}/deps.txt deps) 137 file(STRINGS ${dir}/deps.txt deps)
129 message(STATUS "${id} depends: ${deps}") 138 message(STATUS "${id} depends: ${deps}")
130 else() 139 else()
@@ -133,6 +142,7 @@ function(add_addon_depends addon searchpath)
133 142
134 if(CROSS_AUTOCONF AND AUTOCONF_FILES) 143 if(CROSS_AUTOCONF AND AUTOCONF_FILES)
135 foreach(afile ${AUTOCONF_FILES}) 144 foreach(afile ${AUTOCONF_FILES})
145 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile})
136 file(APPEND ${PATCH_FILE} 146 file(APPEND ${PATCH_FILE}
137 "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n 147 "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n
138 file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") 148 file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
@@ -141,7 +151,7 @@ function(add_addon_depends addon searchpath)
141 151
142 # if the patch file exists we need to set the PATCH_COMMAND 152 # if the patch file exists we need to set the PATCH_COMMAND
143 set(PATCH_COMMAND "") 153 set(PATCH_COMMAND "")
144 if (EXISTS ${PATCH_FILE}) 154 if(EXISTS ${PATCH_FILE})
145 set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) 155 set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE})
146 endif() 156 endif()
147 157
diff --git a/project/cmake/scripts/common/Macros.cmake b/project/cmake/scripts/common/Macros.cmake
new file mode 100644
index 0000000..71c39ef
--- /dev/null
+++ b/project/cmake/scripts/common/Macros.cmake
@@ -0,0 +1,619 @@
1# This script holds the main functions used to construct the build system
2
3# include system specific macros
4include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/Macros.cmake)
5
6# IDEs: Group source files in target in folders (file system hierarchy)
7# Source: http://blog.audio-tk.com/2015/09/01/sorting-source-files-and-projects-in-folders-with-cmake-and-visual-studioxcode/
8# Arguments:
9# target The target that shall be grouped by folders.
10# Optional Arguments:
11# RELATIVE allows to specify a different reference folder.
12function(source_group_by_folder target)
13 if(NOT TARGET ${target})
14 message(FATAL_ERROR "There is no target named '${target}'")
15 endif()
16
17 set(SOURCE_GROUP_DELIMITER "/")
18
19 cmake_parse_arguments(arg "" "RELATIVE" "" ${ARGN})
20 if(arg_RELATIVE)
21 set(relative_dir ${arg_RELATIVE})
22 else()
23 set(relative_dir ${CMAKE_CURRENT_SOURCE_DIR})
24 endif()
25
26 get_property(files TARGET ${target} PROPERTY SOURCES)
27 if(files)
28 list(SORT files)
29
30 if(CMAKE_GENERATOR STREQUAL Xcode)
31 set_target_properties(${target} PROPERTIES SOURCES "${files}")
32 endif()
33 endif()
34 foreach(file ${files})
35 if(NOT IS_ABSOLUTE ${file})
36 set(file ${CMAKE_CURRENT_SOURCE_DIR}/${file})
37 endif()
38 file(RELATIVE_PATH relative_file ${relative_dir} ${file})
39 get_filename_component(dir "${relative_file}" DIRECTORY)
40 if(NOT dir STREQUAL "${last_dir}")
41 if(files)
42 source_group("${last_dir}" FILES ${files})
43 endif()
44 set(files "")
45 endif()
46 set(files ${files} ${file})
47 set(last_dir "${dir}")
48 endforeach(file)
49 if(files)
50 source_group("${last_dir}" FILES ${files})
51 endif()
52endfunction()
53
54# Add sources to main application
55# Arguments:
56# name name of the library to add
57# Implicit arguments:
58# ENABLE_STATIC_LIBS Build static libraries per directory
59# SOURCES the sources of the library
60# HEADERS the headers of the library (only for IDE support)
61# OTHERS other library related files (only for IDE support)
62# On return:
63# Library will be built, optionally added to ${core_DEPENDS}
64# Sets CORE_LIBRARY for calls for setting target specific options
65function(core_add_library name)
66 if(ENABLE_STATIC_LIBS)
67 add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS})
68 set_target_properties(${name} PROPERTIES PREFIX "")
69 set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE)
70 add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid)
71 set(CORE_LIBRARY ${name} PARENT_SCOPE)
72
73 # Add precompiled headers to Kodi main libraries
74 if(CORE_SYSTEM_NAME STREQUAL windows)
75 add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi)
76 set_language_cxx(${name})
77 target_link_libraries(${name} PUBLIC effects11)
78 endif()
79 else()
80 foreach(src IN LISTS SOURCES HEADERS OTHERS)
81 get_filename_component(src_path "${src}" ABSOLUTE)
82 list(APPEND FILES ${src_path})
83 endforeach()
84 target_sources(lib${APP_NAME_LC} PRIVATE ${FILES})
85 set(CORE_LIBRARY lib${APP_NAME_LC} PARENT_SCOPE)
86 endif()
87endfunction()
88
89# Add a test library, and add sources to list for gtest integration macros
90function(core_add_test_library name)
91 if(ENABLE_STATIC_LIBS)
92 add_library(${name} STATIC ${SOURCES} ${SUPPORTED_SOURCES} ${HEADERS} ${OTHERS})
93 set_target_properties(${name} PROPERTIES PREFIX ""
94 EXCLUDE_FROM_ALL 1
95 FOLDER "Build Utilities/tests")
96 add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid)
97 set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE)
98 endif()
99 foreach(src IN LISTS SOURCES)
100 get_filename_component(src_path "${src}" ABSOLUTE)
101 set(test_sources "${src_path}" ${test_sources} CACHE STRING "" FORCE)
102 endforeach()
103endfunction()
104
105# Add an addon callback library
106# Arguments:
107# name name of the library to add
108# Implicit arguments:
109# SOURCES the sources of the library
110# HEADERS the headers of the library (only for IDE support)
111# OTHERS other library related files (only for IDE support)
112# On return:
113# Library target is defined and added to LIBRARY_FILES
114function(core_add_addon_library name)
115 get_filename_component(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NAME)
116 list(APPEND SOURCES lib${name}.cpp)
117 core_add_shared_library(${name} OUTPUT_DIRECTORY addons/${DIRECTORY})
118 set_target_properties(${name} PROPERTIES FOLDER addons)
119 target_include_directories(${name} PRIVATE
120 ${CMAKE_CURRENT_SOURCE_DIR}
121 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi
122 ${CORE_SOURCE_DIR}/xbmc)
123endfunction()
124
125# Add an dl-loaded shared library
126# Arguments:
127# name name of the library to add
128# Optional arguments:
129# WRAPPED wrap this library on POSIX platforms to add VFS support for
130# libraries that would otherwise not support it.
131# OUTPUT_DIRECTORY where to create the library in the build dir
132# (default: system)
133# Implicit arguments:
134# SOURCES the sources of the library
135# HEADERS the headers of the library (only for IDE support)
136# OTHERS other library related files (only for IDE support)
137# On return:
138# Library target is defined and added to LIBRARY_FILES
139function(core_add_shared_library name)
140 cmake_parse_arguments(arg "WRAPPED" "OUTPUT_DIRECTORY" "" ${ARGN})
141 if(arg_OUTPUT_DIRECTORY)
142 set(OUTPUT_DIRECTORY ${arg_OUTPUT_DIRECTORY})
143 else()
144 if(NOT CORE_SYSTEM_NAME STREQUAL windows)
145 set(OUTPUT_DIRECTORY system)
146 endif()
147 endif()
148 if(CORE_SYSTEM_NAME STREQUAL windows)
149 set(OUTPUT_NAME lib${name})
150 else()
151 set(OUTPUT_NAME lib${name}-${ARCH})
152 endif()
153
154 if(NOT arg_WRAPPED OR CORE_SYSTEM_NAME STREQUAL windows)
155 add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS})
156 set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
157 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
158 RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
159 RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}
160 OUTPUT_NAME ${OUTPUT_NAME} PREFIX "")
161
162 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE)
163 add_dependencies(${APP_NAME_LC}-libraries ${name})
164 else()
165 add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS})
166 set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE 1)
167 core_link_library(${name} ${OUTPUT_DIRECTORY}/lib${name})
168 endif()
169endfunction()
170
171# Sets the compile language for all C source files in a target to CXX.
172# Needs to be called from the CMakeLists.txt that defines the target.
173# Arguments:
174# target target
175function(set_language_cxx target)
176 get_property(sources TARGET ${target} PROPERTY SOURCES)
177 foreach(file IN LISTS sources)
178 if(file MATCHES "\.c$")
179 set_source_files_properties(${file} PROPERTIES LANGUAGE CXX)
180 endif()
181 endforeach()
182endfunction()
183
184# Add a data file to installation list with a mirror in build tree
185# Mirroring files in the buildtree allows to execute the app from there.
186# Arguments:
187# file full path to file to mirror
188# Optional Arguments:
189# NO_INSTALL: exclude file from installation target (only mirror)
190# DIRECTORY: directory where the file should be mirrored to
191# (default: preserve tree structure relative to CORE_SOURCE_DIR)
192# On return:
193# Files is mirrored to the build tree and added to ${install_data}
194# (if NO_INSTALL is not given).
195function(copy_file_to_buildtree file)
196 cmake_parse_arguments(arg "NO_INSTALL" "DIRECTORY" "" ${ARGN})
197 if(arg_DIRECTORY)
198 set(outdir ${arg_DIRECTORY})
199 get_filename_component(outfile ${file} NAME)
200 set(outfile ${outdir}/${outfile})
201 else()
202 string(REPLACE "${CORE_SOURCE_DIR}/" "" outfile ${file})
203 get_filename_component(outdir ${outfile} DIRECTORY)
204 endif()
205
206 if(NOT TARGET export-files)
207 file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
208 add_custom_target(export-files ALL COMMENT "Copying files into build tree"
209 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
210 set_target_properties(export-files PROPERTIES FOLDER "Build Utilities")
211 file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake "# Export files to build tree\n")
212 endif()
213
214 # Exclude autotools build artefacts and other blacklisted files in source tree.
215 if(file MATCHES "(Makefile|\.in|\.xbt|\.so|\.dylib|\.gitignore)$")
216 if(VERBOSE)
217 message(STATUS "copy_file_to_buildtree - ignoring file: ${file}")
218 endif()
219 return()
220 endif()
221
222 if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile})
223 if(VERBOSE)
224 message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}")
225 endif()
226 file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake
227 "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n")
228 endif()
229
230 if(NOT arg_NO_INSTALL)
231 list(APPEND install_data ${outfile})
232 set(install_data ${install_data} PARENT_SCOPE)
233 endif()
234endfunction()
235
236# Add data files to installation list with a mirror in build tree.
237# reads list of files to install from a given list of text files.
238# Arguments:
239# pattern globbing pattern for text files to read
240# Optional Arguments:
241# NO_INSTALL: exclude files from installation target
242# Implicit arguments:
243# CORE_SOURCE_DIR - root of source tree
244# On return:
245# Files are mirrored to the build tree and added to ${install_data}
246# (if NO_INSTALL is not given).
247function(copy_files_from_filelist_to_buildtree pattern)
248 # copies files listed in text files to the buildtree
249 # Input: [glob pattern: filepattern]
250 cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN})
251 list(APPEND pattern ${ARGN})
252 list(SORT pattern)
253 if(VERBOSE)
254 message(STATUS "copy_files_from_filelist_to_buildtree - got pattern: ${pattern}")
255 endif()
256 foreach(pat ${pattern})
257 file(GLOB filenames ${pat})
258 foreach(filename ${filenames})
259 string(STRIP ${filename} filename)
260 core_file_read_filtered(fstrings ${filename})
261 foreach(dir ${fstrings})
262 string(REPLACE " " ";" dir ${dir})
263 list(GET dir 0 src)
264 list(LENGTH dir len)
265 if(len EQUAL 1)
266 set(dest)
267 else()
268 list(GET dir -1 dest)
269 endif()
270
271 # If the full path to an existing file is specified then add that single file.
272 # Don't recursively add all files with the given name.
273 if(EXISTS ${CORE_SOURCE_DIR}/${src} AND NOT IS_DIRECTORY ${CORE_SOURCE_DIR}/${src})
274 set(files ${src})
275 else()
276 file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${src})
277 endif()
278
279 foreach(file ${files})
280 if(arg_NO_INSTALL)
281 copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest} NO_INSTALL)
282 else()
283 copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest})
284 endif()
285 endforeach()
286 endforeach()
287 endforeach()
288 endforeach()
289 set(install_data ${install_data} PARENT_SCOPE)
290endfunction()
291
292# helper macro to set modified variables in parent scope
293macro(export_dep)
294 set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE)
295 set(DEPLIBS ${DEPLIBS} PARENT_SCOPE)
296 set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE)
297 set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE)
298 mark_as_advanced(${depup}_LIBRARIES)
299endmacro()
300
301# add a required dependency of main application
302# Arguments:
303# dep name of find rule for dependency, used uppercased for variable prefix
304# On return:
305# dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES}
306function(core_require_dep dep)
307 find_package(${dep} REQUIRED)
308 string(TOUPPER ${dep} depup)
309 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
310 list(APPEND DEPLIBS ${${depup}_LIBRARIES})
311 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
312 export_dep()
313endfunction()
314
315# add a required dyloaded dependency of main application
316# Arguments:
317# dep name of find rule for dependency, used uppercased for variable prefix
318# On return:
319# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up
320function(core_require_dyload_dep dep)
321 find_package(${dep} REQUIRED)
322 string(TOUPPER ${dep} depup)
323 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
324 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
325 find_soname(${depup} REQUIRED)
326 export_dep()
327 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
328endfunction()
329
330# helper macro for optional deps
331macro(setup_enable_switch)
332 string(TOUPPER ${dep} depup)
333 if(ARGV1)
334 set(enable_switch ${ARGV1})
335 else()
336 set(enable_switch ENABLE_${depup})
337 endif()
338 # normal options are boolean, so we override set our ENABLE_FOO var to allow "auto" handling
339 set(${enable_switch} "AUTO" CACHE STRING "Enable ${depup} support?")
340endmacro()
341
342# add an optional dependency of main application
343# Arguments:
344# dep name of find rule for dependency, used uppercased for variable prefix
345# On return:
346# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES}
347function(core_optional_dep dep)
348 setup_enable_switch()
349 if(${enable_switch} STREQUAL AUTO)
350 find_package(${dep})
351 elseif(${${enable_switch}})
352 find_package(${dep} REQUIRED)
353 endif()
354
355 if(${depup}_FOUND)
356 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
357 list(APPEND DEPLIBS ${${depup}_LIBRARIES})
358 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
359 set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE)
360 export_dep()
361 else()
362 set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE)
363 endif()
364endfunction()
365
366# add an optional dyloaded dependency of main application
367# Arguments:
368# dep name of find rule for dependency, used uppercased for variable prefix
369# On return:
370# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up
371function(core_optional_dyload_dep dep)
372 setup_enable_switch()
373 if(${enable_switch})
374 find_package(${dep})
375 if(${depup}_FOUND)
376 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
377 find_soname(${depup} REQUIRED)
378 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
379 set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE)
380 export_dep()
381 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
382 endif()
383 endif()
384endfunction()
385
386function(core_file_read_filtered result filepattern)
387 # Reads STRINGS from text files
388 # with comments filtered out
389 # Result: [list: result]
390 # Input: [glob pattern: filepattern]
391 file(GLOB filenames ${filepattern})
392 list(SORT filenames)
393 foreach(filename ${filenames})
394 if(VERBOSE)
395 message(STATUS "core_file_read_filtered - filename: ${filename}")
396 endif()
397 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename})
398 file(STRINGS ${filename} fstrings REGEX "^[^#//]")
399 foreach(fstring ${fstrings})
400 string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring})
401 string(REGEX REPLACE "[ \n\r\t]//.*" "" fstring ${fstring})
402 string(STRIP ${fstring} fstring)
403 list(APPEND filename_strings ${fstring})
404 endforeach()
405 endforeach()
406 set(${result} ${filename_strings} PARENT_SCOPE)
407endfunction()
408
409function(core_add_subdirs_from_filelist files)
410 # Adds subdirectories from a sorted list of files
411 # Input: [list: filenames] [bool: sort]
412 foreach(arg ${ARGN})
413 list(APPEND files ${arg})
414 endforeach()
415 list(SORT files)
416 if(VERBOSE)
417 message(STATUS "core_add_subdirs_from_filelist - got pattern: ${files}")
418 endif()
419 foreach(filename ${files})
420 string(STRIP ${filename} filename)
421 core_file_read_filtered(fstrings ${filename})
422 foreach(subdir ${fstrings})
423 string(REPLACE " " ";" subdir ${subdir})
424 list(GET subdir 0 subdir_src)
425 list(GET subdir -1 subdir_dest)
426 if(VERBOSE)
427 message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}")
428 endif()
429 add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest})
430 endforeach()
431 endforeach()
432endfunction()
433
434macro(core_add_optional_subdirs_from_filelist pattern)
435 # Adds subdirectories from text files
436 # if the option(s) in the 3rd field are enabled
437 # Input: [glob pattern: filepattern]
438 foreach(arg ${ARGN})
439 list(APPEND pattern ${arg})
440 endforeach()
441 foreach(elem ${pattern})
442 string(STRIP ${elem} elem)
443 list(APPEND filepattern ${elem})
444 endforeach()
445
446 file(GLOB filenames ${filepattern})
447 list(SORT filenames)
448 if(VERBOSE)
449 message(STATUS "core_add_optional_subdirs_from_filelist - got pattern: ${filenames}")
450 endif()
451
452 foreach(filename ${filenames})
453 if(VERBOSE)
454 message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}")
455 endif()
456 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename})
457 file(STRINGS ${filename} fstrings REGEX "^[^#//]")
458 foreach(line ${fstrings})
459 string(REPLACE " " ";" line "${line}")
460 list(GET line 0 subdir_src)
461 list(GET line 1 subdir_dest)
462 list(GET line 3 opts)
463 foreach(opt ${opts})
464 if(ENABLE_${opt})
465 if(VERBOSE)
466 message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}")
467 endif()
468 add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest})
469 else()
470 if(VERBOSE)
471 message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir")
472 endif()
473 endif()
474 endforeach()
475 endforeach()
476 endforeach()
477endmacro()
478
479# Generates an RFC2822 timestamp
480#
481# The following variable is set:
482# RFC2822_TIMESTAMP
483function(rfc2822stamp)
484 execute_process(COMMAND date -R
485 OUTPUT_VARIABLE RESULT)
486 set(RFC2822_TIMESTAMP ${RESULT} PARENT_SCOPE)
487endfunction()
488
489# Generates an user stamp from git config info
490#
491# The following variable is set:
492# PACKAGE_MAINTAINER - user stamp in the form of "username <username@example.com>"
493# if no git tree is found, value is set to "nobody <nobody@example.com>"
494function(userstamp)
495 find_package(Git)
496 if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git)
497 execute_process(COMMAND ${GIT_EXECUTABLE} config user.name
498 OUTPUT_VARIABLE username
499 WORKING_DIRECTORY ${CORE_SOURCE_DIR}
500 OUTPUT_STRIP_TRAILING_WHITESPACE)
501 execute_process(COMMAND ${GIT_EXECUTABLE} config user.email
502 OUTPUT_VARIABLE useremail
503 WORKING_DIRECTORY ${CORE_SOURCE_DIR}
504 OUTPUT_STRIP_TRAILING_WHITESPACE)
505 set(PACKAGE_MAINTAINER "${username} <${useremail}>" PARENT_SCOPE)
506 else()
507 set(PACKAGE_MAINTAINER "nobody <nobody@example.com>" PARENT_SCOPE)
508 endif()
509endfunction()
510
511# Parses git info and sets variables used to identify the build
512# Arguments:
513# stamp variable name to return
514# Optional Arguments:
515# FULL: generate git HEAD commit in the form of 'YYYYMMDD-hash'
516# if git tree is dirty, value is set in the form of 'YYYYMMDD-hash-dirty'
517# if no git tree is found, value is set in the form of 'YYYYMMDD-nogitfound'
518# if FULL is not given, stamp is generated following the same process as above
519# but without 'YYYYMMDD'
520# On return:
521# Variable is set with generated stamp to PARENT_SCOPE
522function(core_find_git_rev stamp)
523 # allow manual setting GIT_VERSION
524 if(GIT_VERSION)
525 set(${stamp} ${GIT_VERSION} PARENT_SCOPE)
526 else()
527 find_package(Git)
528 if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git)
529 execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet --
530 RESULT_VARIABLE status_code
531 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
532 if(NOT status_code)
533 execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD --
534 RESULT_VARIABLE status_code
535 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
536 endif()
537 if(status_code)
538 execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD
539 OUTPUT_VARIABLE HASH
540 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
541 string(SUBSTRING ${HASH} 1 13 HASH)
542 else()
543 execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD
544 OUTPUT_VARIABLE HASH
545 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
546 string(SUBSTRING ${HASH} 1 7 HASH)
547 endif()
548 execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD
549 OUTPUT_VARIABLE DATE
550 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
551 string(SUBSTRING ${DATE} 1 10 DATE)
552 string(REPLACE "-" "" DATE ${DATE})
553 else()
554 string(TIMESTAMP DATE "%Y%m%d" UTC)
555 set(HASH "nogitfound")
556 endif()
557 cmake_parse_arguments(arg "FULL" "" "" ${ARGN})
558 if(arg_FULL)
559 set(${stamp} ${DATE}-${HASH} PARENT_SCOPE)
560 else()
561 set(${stamp} ${HASH} PARENT_SCOPE)
562 endif()
563 endif()
564endfunction()
565
566# Parses version.txt and libKODI_guilib.h and sets variables
567# used to construct dirs structure, file naming, API version, etc.
568#
569# The following variables are set from version.txt:
570# APP_NAME - app name
571# APP_NAME_LC - lowercased app name
572# APP_NAME_UC - uppercased app name
573# COMPANY_NAME - company name
574# APP_VERSION_MAJOR - the app version major
575# APP_VERSION_MINOR - the app version minor
576# APP_VERSION_TAG - the app version tag
577# APP_VERSION_TAG_LC - lowercased app version tag
578# APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG})
579# APP_ADDON_API - the addon API version in the form of 16.9.702
580# FILE_VERSION - file version in the form of 16,9,702,0 - Windows only
581#
582# The following variables are set from libKODI_guilib.h:
583# guilib_version - current ADDONGUI API version
584# guilib_version_min - minimal ADDONGUI API version
585macro(core_find_versions)
586 include(CMakeParseArguments)
587 core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt)
588 string(REPLACE " " ";" version_list "${version_list}")
589 cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API" "" ${version_list})
590
591 set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird
592 string(TOLOWER ${APP_APP_NAME} APP_NAME_LC)
593 string(TOUPPER ${APP_APP_NAME} APP_NAME_UC)
594 set(COMPANY_NAME ${APP_COMPANY_NAME})
595 set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR})
596 if(APP_VERSION_TAG)
597 set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG})
598 endif()
599 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0)
600 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
601 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$")
602 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version})
603 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$")
604 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min})
605 # unset variables not used anywhere else
606 unset(version_list)
607 unset(APP_APP_NAME)
608
609 # bail if we can't parse version.txt
610 if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR)
611 message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists")
612 endif()
613
614 # bail if we can't parse libKODI_guilib.h
615 if(NOT DEFINED guilib_version OR NOT DEFINED guilib_version_min)
616 message(FATAL_ERROR "Could not determine add-on API version! Make sure that ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h exists")
617 endif()
618endmacro()
619
diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/PrepareEnv.cmake
index 8e9bd1c..8e02382 100644
--- a/project/cmake/scripts/common/prepare-env.cmake
+++ b/project/cmake/scripts/common/PrepareEnv.cmake
@@ -1,25 +1,6 @@
1# parse version.txt to get the version info 1# parse version.txt and libKODI_guilib.h to get the version and API info
2if(EXISTS "${APP_ROOT}/version.txt") 2include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake)
3 file(STRINGS "${APP_ROOT}/version.txt" versions) 3core_find_versions()
4 foreach (version ${versions})
5 if(version MATCHES "^VERSION_.*")
6 string(REGEX MATCH "^[^ ]+" version_name ${version})
7 string(REPLACE "${version_name} " "" version_value ${version})
8 set(APP_${version_name} "${version_value}")
9 else()
10 string(REGEX MATCH "^[^ ]+" name ${version})
11 string(REPLACE "${name} " "" value ${version})
12 set(${name} "${value}")
13 endif()
14 endforeach()
15 string(TOLOWER ${APP_NAME} APP_NAME_LC)
16 string(TOUPPER ${APP_NAME} APP_NAME_UC)
17endif()
18
19# bail if we can't parse versions
20if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR)
21 message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists")
22endif()
23 4
24# in case we need to download something, set KODI_MIRROR to the default if not alread set 5# in case we need to download something, set KODI_MIRROR to the default if not alread set
25if(NOT DEFINED KODI_MIRROR) 6if(NOT DEFINED KODI_MIRROR)
@@ -28,24 +9,19 @@ endif()
28 9
29### copy all the addon binding header files to include/kodi 10### copy all the addon binding header files to include/kodi
30# make sure include/kodi exists and is empty 11# make sure include/kodi exists and is empty
31set(APP_LIB_DIR ${DEPENDS_PATH}/lib/${APP_NAME_LC}) 12set(APP_LIB_DIR ${ADDON_DEPENDS_PATH}/lib/${APP_NAME_LC})
32if(NOT EXISTS "${APP_LIB_DIR}/") 13if(NOT EXISTS "${APP_LIB_DIR}/")
33 file(MAKE_DIRECTORY ${APP_LIB_DIR}) 14 file(MAKE_DIRECTORY ${APP_LIB_DIR})
34endif() 15endif()
35 16
36set(APP_INCLUDE_DIR ${DEPENDS_PATH}/include/${APP_NAME_LC}) 17set(APP_DATA_DIR ${ADDON_DEPENDS_PATH}/share/${APP_NAME_LC})
37if(NOT EXISTS "${APP_INCLUDE_DIR}/") 18if(NOT EXISTS "${APP_DATA_DIR}/")
38 file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) 19 file(MAKE_DIRECTORY ${APP_DATA_DIR})
39endif() 20endif()
40 21
41# we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc 22set(APP_INCLUDE_DIR ${ADDON_DEPENDS_PATH}/include/${APP_NAME_LC})
42set(XBMC_LIB_DIR ${DEPENDS_PATH}/lib/xbmc) 23if(NOT EXISTS "${APP_INCLUDE_DIR}/")
43if(NOT EXISTS "${XBMC_LIB_DIR}/") 24 file(MAKE_DIRECTORY ${APP_INCLUDE_DIR})
44 file(MAKE_DIRECTORY ${XBMC_LIB_DIR})
45endif()
46set(XBMC_INCLUDE_DIR ${DEPENDS_PATH}/include/xbmc)
47if(NOT EXISTS "${XBMC_INCLUDE_DIR}/")
48 file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR})
49endif() 25endif()
50 26
51# make sure C++11 is always set 27# make sure C++11 is always set
@@ -56,42 +32,23 @@ if(NOT WIN32)
56 endif() 32 endif()
57endif() 33endif()
58 34
59# generate the proper kodi-config.cmake file 35# generate the proper KodiConfig.cmake file
60configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${APP_LIB_DIR}/kodi-config.cmake @ONLY) 36configure_file(${CORE_SOURCE_DIR}/project/cmake/KodiConfig.cmake.in ${APP_LIB_DIR}/KodiConfig.cmake @ONLY)
61 37
62# copy cmake helpers to lib/kodi 38# copy cmake helpers to lib/kodi
63file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake 39file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake
64 ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake 40 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake
65 DESTINATION ${APP_LIB_DIR}) 41 DESTINATION ${APP_LIB_DIR})
66 42
67# generate xbmc-config.cmake for backwards compatibility to xbmc
68configure_file(${APP_ROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY)
69
70### copy all the addon binding header files to include/kodi 43### copy all the addon binding header files to include/kodi
71# parse addon-bindings.mk to get the list of header files to copy 44# parse addon-bindings.mk to get the list of header files to copy
72file(STRINGS ${APP_ROOT}/xbmc/addons/addon-bindings.mk bindings) 45core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk)
73string(REPLACE "\n" ";" bindings "${bindings}")
74foreach(binding ${bindings}) 46foreach(binding ${bindings})
75 string(REPLACE " =" ";" binding "${binding}") 47 string(REPLACE " =" ";" binding "${binding}")
76 string(REPLACE "+=" ";" binding "${binding}") 48 string(REPLACE "+=" ";" binding "${binding}")
77 list(GET binding 1 header) 49 list(GET binding 1 header)
78 # copy the header file to include/kodi 50 # copy the header file to include/kodi
79 file(COPY ${APP_ROOT}/${header} DESTINATION ${APP_INCLUDE_DIR}) 51 configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY)
80
81 # auto-generate header files for backwards compatibility to xbmc with deprecation warning
82 # but only do it if the file doesn't already exist
83 get_filename_component(headerfile ${header} NAME)
84 if (NOT EXISTS "${XBMC_INCLUDE_DIR}/${headerfile}")
85 file(WRITE ${XBMC_INCLUDE_DIR}/${headerfile}
86"#pragma once
87#define DEPRECATION_WARNING \"Including xbmc/${headerfile} has been deprecated, please use kodi/${headerfile}\"
88#ifdef _MSC_VER
89 #pragma message(\"WARNING: \" DEPRECATION_WARNING)
90#else
91 #warning DEPRECATION_WARNING
92#endif
93#include \"kodi/${headerfile}\"")
94 endif()
95endforeach() 52endforeach()
96 53
97### on windows we need a "patch" binary to be able to patch 3rd party sources 54### on windows we need a "patch" binary to be able to patch 3rd party sources
@@ -125,12 +82,12 @@ if(WIN32)
125 endif() 82 endif()
126 83
127 # copy patch.exe into the output directory 84 # copy patch.exe into the output directory
128 file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${DEPENDS_PATH}/bin) 85 file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin)
129 86
130 # make sure that cmake can find the copied patch.exe 87 # make sure that cmake can find the copied patch.exe
131 find_program(PATCH_FOUND NAMES patch patch.exe) 88 find_program(PATCH_FOUND NAMES patch patch.exe)
132 if(NOT PATCH_FOUND) 89 if(NOT PATCH_FOUND)
133 message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${DEPENDS_PATH}/bin") 90 message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin")
134 endif() 91 endif()
135 endif() 92 endif()
136endif() 93endif()
diff --git a/project/cmake/scripts/common/projectmacros.cmake b/project/cmake/scripts/common/ProjectMacros.cmake
index 7ce4ee9..e73ef90 100644
--- a/project/cmake/scripts/common/projectmacros.cmake
+++ b/project/cmake/scripts/common/ProjectMacros.cmake
@@ -8,7 +8,7 @@
8# xbt is added to ${XBT_FILES} 8# xbt is added to ${XBT_FILES}
9function(pack_xbt input output) 9function(pack_xbt input output)
10 file(GLOB_RECURSE MEDIA_FILES ${input}/*) 10 file(GLOB_RECURSE MEDIA_FILES ${input}/*)
11 get_filename_component(dir ${output} PATH) 11 get_filename_component(dir ${output} DIRECTORY)
12 add_custom_command(OUTPUT ${output} 12 add_custom_command(OUTPUT ${output}
13 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} 13 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}
14 COMMAND TexturePacker::TexturePacker 14 COMMAND TexturePacker::TexturePacker
@@ -23,18 +23,17 @@ endfunction()
23# Add a skin to installation list, mirroring it in build tree, packing textures 23# Add a skin to installation list, mirroring it in build tree, packing textures
24# Arguments: 24# Arguments:
25# skin skin directory 25# skin skin directory
26# relative relative base path in build tree
27# On return: 26# On return:
28# xbt is added to ${XBT_FILES}, data added to ${install_data}, mirror in build tree 27# xbt is added to ${XBT_FILES}, data added to ${install_data}, mirror in build tree
29function(copy_skin_to_buildtree skin relative) 28function(copy_skin_to_buildtree skin)
30 file(GLOB_RECURSE FILES ${skin}/*) 29 file(GLOB_RECURSE FILES ${skin}/*)
31 file(GLOB_RECURSE MEDIA_FILES ${skin}/media/*) 30 file(GLOB_RECURSE MEDIA_FILES ${skin}/media/*)
32 list(REMOVE_ITEM FILES ${MEDIA_FILES}) 31 list(REMOVE_ITEM FILES ${MEDIA_FILES})
33 foreach(file ${FILES}) 32 foreach(file ${FILES})
34 copy_file_to_buildtree(${file} ${relative}) 33 copy_file_to_buildtree(${file})
35 endforeach() 34 endforeach()
36 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media) 35 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media)
37 string(REPLACE "${relative}/" "" dest ${skin}) 36 string(REPLACE "${CORE_SOURCE_DIR}/" "" dest ${skin})
38 pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt) 37 pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt)
39 38
40 file(GLOB THEMES RELATIVE ${skin}/themes ${skin}/themes/*) 39 file(GLOB THEMES RELATIVE ${skin}/themes ${skin}/themes/*)
@@ -54,6 +53,9 @@ function(GTEST_ADD_TESTS executable extra_args)
54 message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS") 53 message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
55 endif() 54 endif()
56 foreach(source ${ARGN}) 55 foreach(source ${ARGN})
56 # This assumes that every source file passed in exists. Consider using
57 # SUPPORT_SOURCES for source files which do not contain tests and might
58 # have to be generated.
57 file(READ "${source}" contents) 59 file(READ "${source}" contents)
58 string(REGEX MATCHALL "TEST_?[F]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) 60 string(REGEX MATCHALL "TEST_?[F]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
59 foreach(hit ${found_tests}) 61 foreach(hit ${found_tests})
diff --git a/project/cmake/scripts/common/Uninstall.cmake b/project/cmake/scripts/common/Uninstall.cmake
new file mode 100644
index 0000000..5660e19
--- /dev/null
+++ b/project/cmake/scripts/common/Uninstall.cmake
@@ -0,0 +1,22 @@
1# Uninstall target
2set(MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt)
3if(EXISTS ${MANIFEST})
4 file(STRINGS ${MANIFEST} files)
5 foreach(file IN LISTS files)
6 if(EXISTS $ENV{DESTDIR}${file})
7 message(STATUS "Uninstalling: ${file}")
8 execute_process(
9 COMMAND ${CMAKE_COMMAND} -E remove $ENV{DESTDIR}${file}
10 OUTPUT_VARIABLE rm_out
11 RESULT_VARIABLE rm_retval
12 )
13 if(NOT "${rm_retval}" STREQUAL 0)
14 message(FATAL_ERROR "Failed to remove file: $ENV{DESTDIR}${file}")
15 endif()
16 else()
17 message(STATUS "File does not exist: $ENV{DESTDIR}${file}")
18 endif()
19 endforeach(file)
20else()
21 message(STATUS "Cannot find install manifest: '${MANIFEST}'")
22endif()
diff --git a/project/cmake/scripts/common/addon-helpers.cmake b/project/cmake/scripts/common/addon-helpers.cmake
deleted file mode 100644
index caef610..0000000
--- a/project/cmake/scripts/common/addon-helpers.cmake
+++ /dev/null
@@ -1,171 +0,0 @@
1# Workaround for the fact that cpack's filenames are not customizable.
2# Each add-on is added as a separate component to facilitate zip/tgz packaging.
3# The filenames are always of the form basename-component, which is
4# incompatible with the addonid-version scheme we want. This hack renames
5# the files from the file names generated by the 'package' target.
6# Sadly we cannot extend the 'package' target, as it is a builtin target, see
7# http://public.kitware.com/Bug/view.php?id=8438
8# Thus, we have to add an 'addon-package' target.
9add_custom_target(addon-package
10 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package)
11
12macro(add_cpack_workaround target version ext)
13 if(NOT PACKAGE_DIR)
14 set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips")
15 endif()
16
17 add_custom_command(TARGET addon-package PRE_BUILD
18 COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR}
19 COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext})
20endmacro()
21
22# Grab the version from a given add-on's addon.xml
23macro (addon_version dir prefix)
24 IF(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in)
25 FILE(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML)
26 ELSE()
27 FILE(READ ${dir}/addon.xml ADDONXML)
28 ENDIF()
29
30 STRING(REGEX MATCH "<addon[^>]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML})
31 STRING(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING})
32 message(STATUS ${prefix}_VERSION=${${prefix}_VERSION})
33endmacro()
34
35# Build, link and optionally package an add-on
36macro (build_addon target prefix libs)
37 ADD_LIBRARY(${target} ${${prefix}_SOURCES})
38 TARGET_LINK_LIBRARIES(${target} ${${libs}})
39 addon_version(${target} ${prefix})
40 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${${prefix}_VERSION}
41 SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}
42 PREFIX "")
43 IF(OS STREQUAL "android")
44 SET_TARGET_PROPERTIES(${target} PROPERTIES PREFIX "lib")
45 ENDIF(OS STREQUAL "android")
46
47 # get the library's location
48 SET(LIBRARY_LOCATION $<TARGET_FILE:${target}>)
49 # get the library's filename
50 if("${CORE_SYSTEM_NAME}" STREQUAL "android")
51 # for android we need the filename without any version numbers
52 set(LIBRARY_FILENAME $<TARGET_LINKER_FILE_NAME:${target}>)
53 else()
54 SET(LIBRARY_FILENAME $<TARGET_FILE_NAME:${target}>)
55 endif()
56
57 # if there's an addon.xml.in we need to generate the addon.xml
58 IF(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in)
59 SET(PLATFORM ${CORE_SYSTEM_NAME})
60
61 FILE(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file)
62 STRING(CONFIGURE "${addon_file}" addon_file_conf @ONLY)
63 FILE(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}")
64 ENDIF()
65
66 # set zip as default if addon-package is called without PACKAGE_XXX
67 SET(CPACK_GENERATOR "ZIP")
68 SET(ext "zip")
69 IF(PACKAGE_ZIP OR PACKAGE_TGZ)
70 IF(PACKAGE_TGZ)
71 SET(CPACK_GENERATOR "TGZ")
72 SET(ext "tar.gz")
73 ENDIF(PACKAGE_TGZ)
74 SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
75 set(CPACK_PACKAGE_FILE_NAME addon)
76 IF(CMAKE_BUILD_TYPE STREQUAL "Release")
77 SET(CPACK_STRIP_FILES TRUE)
78 ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release")
79 set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
80 set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
81 list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION})
82 # Pack files together to create an archive
83 INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "addon.xml.in" EXCLUDE)
84 IF(WIN32)
85 if(NOT CPACK_PACKAGE_DIRECTORY)
86 # determine the temporary path
87 file(TO_CMAKE_PATH "$ENV{TEMP}" WIN32_TEMP_PATH)
88 string(LENGTH "${WIN32_TEMP_PATH}" WIN32_TEMP_PATH_LENGTH)
89 string(LENGTH "${PROJECT_BINARY_DIR}" PROJECT_BINARY_DIR_LENGTH)
90
91 # check if the temporary path is shorter than the default packaging directory path
92 if(WIN32_TEMP_PATH_LENGTH GREATER 0 AND WIN32_TEMP_PATH_LENGTH LESS PROJECT_BINARY_DIR_LENGTH)
93 # set the directory used by CPack for packaging to the temp directory
94 set(CPACK_PACKAGE_DIRECTORY ${WIN32_TEMP_PATH})
95 endif()
96 endif()
97
98 # in case of a VC++ project the installation location contains a $(Configuration) VS variable
99 # we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration
100 # is changed within Visual Studio)
101 string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}")
102
103 # install the generated DLL file
104 INSTALL(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target}
105 COMPONENT ${target}-${${prefix}_VERSION})
106
107 IF(CMAKE_BUILD_TYPE MATCHES Debug)
108 # for debug builds also install the PDB file
109 get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY)
110 INSTALL(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${target}
111 COMPONENT ${target}-${${prefix}_VERSION})
112 ENDIF()
113 ELSE(WIN32)
114 if(NOT CPACK_PACKAGE_DIRECTORY)
115 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR})
116 endif()
117 INSTALL(TARGETS ${target} DESTINATION ${target}
118 COMPONENT ${target}-${${prefix}_VERSION})
119 ENDIF(WIN32)
120 add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext})
121 ELSE(PACKAGE_ZIP OR PACKAGE_TGZ)
122 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
123 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX)
124 message(STATUS "setting install paths to match ${APP_NAME}: CMAKE_INSTALL_PREFIX: ${${APP_NAME_UC}_PREFIX}")
125 set(CMAKE_INSTALL_PREFIX "${${APP_NAME_UC}_PREFIX}" CACHE PATH "${APP_NAME} install prefix" FORCE)
126 set(CMAKE_INSTALL_LIBDIR "${${APP_NAME_UC}_LIB_DIR}" CACHE PATH "${APP_NAME} install libdir" FORCE)
127 elseif(NOT CMAKE_INSTALL_PREFIX STREQUAL "${${APP_NAME_UC}_PREFIX}" AND NOT OVERRIDE_PATHS)
128 message(FATAL_ERROR "CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} differs from ${APP_NAME} prefix ${${APP_NAME_UC}_PREFIX}. Please pass -DOVERRIDE_PATHS=1 to skip this check")
129 else()
130 if(NOT CMAKE_INSTALL_LIBDIR)
131 set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}")
132 endif()
133 endif()
134 else()
135 set(CMAKE_INSTALL_LIBDIR "lib/${APP_NAME_LC}")
136 endif()
137 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target})
138 INSTALL(DIRECTORY ${target} DESTINATION share/${APP_NAME_LC}/addons PATTERN "addon.xml.in" EXCLUDE)
139 ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ)
140endmacro()
141
142# finds a path to a given file (recursive)
143function (kodi_find_path var_name filename search_path strip_file)
144 file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename})
145 if(strip_file)
146 string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE})
147 endif(strip_file)
148 set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE)
149endfunction()
150
151# Cmake build options
152include(addoptions)
153include(TestCXXAcceptsFlag)
154OPTION(PACKAGE_ZIP "Package Zip file?" OFF)
155OPTION(PACKAGE_TGZ "Package TGZ file?" OFF)
156OPTION(BUILD_SHARED_LIBS "Build shared libs?" ON)
157
158# LTO support?
159CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO)
160IF(HAVE_LTO)
161 OPTION(USE_LTO "use link time optimization" OFF)
162 IF(USE_LTO)
163 add_options(ALL_LANGUAGES ALL_BUILDS "-flto")
164 ENDIF(USE_LTO)
165ENDIF(HAVE_LTO)
166
167# set this to try linking dependencies as static as possible
168IF(ADDONS_PREFER_STATIC_LIBS)
169 SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
170ENDIF(ADDONS_PREFER_STATIC_LIBS)
171
diff --git a/project/cmake/scripts/common/addoptions.cmake b/project/cmake/scripts/common/addoptions.cmake
deleted file mode 100644
index 0ebb823..0000000
--- a/project/cmake/scripts/common/addoptions.cmake
+++ /dev/null
@@ -1,82 +0,0 @@
1# - Add options without repeating them on the command line
2#
3# Synopsis:
4#
5# add_options (lang build opts)
6#
7# where:
8#
9# lang Name of the language whose compiler should receive the
10# options, e.g. CXX. If a comma-separated list is received
11# then the option is added for all those languages. Use the
12# special value ALL_LANGUAGES for these languages: CXX, C
13# and Fortran
14#
15# build Kind of build to which this options should apply,
16# such as DEBUG and RELEASE. This can also be a comma-
17# separated list. Use the special value ALL_BUILDS to apply
18# to all builds.
19#
20# opts List of options to add. Each should be quoted.
21#
22# Example:
23#
24# add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall")
25
26function (add_options langs builds)
27 # special handling of empty language specification
28 if ("${langs}" STREQUAL "ALL_LANGUAGES")
29 set (langs CXX C Fortran)
30 endif ("${langs}" STREQUAL "ALL_LANGUAGES")
31 foreach (lang IN LISTS langs)
32 # prepend underscore if necessary
33 foreach (build IN LISTS builds)
34 if (NOT ("${build}" STREQUAL "ALL_BUILDS"))
35 set (_bld "_${build}")
36 string (TOUPPER "${_bld}" _bld)
37 else (NOT ("${build}" STREQUAL "ALL_BUILDS"))
38 set (_bld "")
39 endif (NOT ("${build}" STREQUAL "ALL_BUILDS"))
40 foreach (_opt IN LISTS ARGN)
41 set (_var "CMAKE_${lang}_FLAGS${_bld}")
42 #message (STATUS "Adding \"${_opt}\" to \${${_var}}")
43 # remove it first
44 string (REPLACE "${_opt}" "" _without "${${_var}}")
45 string (STRIP "${_without}" _without)
46 # we need to strip this one as well, so they are comparable
47 string (STRIP "${${_var}}" _stripped)
48 # if it wasn't there, then add it at the end
49 if ("${_without}" STREQUAL "${_stripped}")
50 # don't add any extra spaces if no options yet are set
51 if (NOT ${_stripped} STREQUAL "")
52 set (${_var} "${_stripped} ${_opt}")
53 else (NOT ${_stripped} STREQUAL "")
54 set (${_var} "${_opt}")
55 endif (NOT ${_stripped} STREQUAL "")
56 set (${_var} "${${_var}}" PARENT_SCOPE)
57 endif ("${_without}" STREQUAL "${_stripped}")
58 endforeach (_opt)
59 endforeach (build)
60 endforeach (lang)
61endfunction (add_options lang build)
62
63# set varname to flag unless user has specified something that matches regex
64function (set_default_option varname flag regex)
65 if (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}"
66 AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}"
67 AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}")
68 set (${varname} ${flag} PARENT_SCOPE)
69 else (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}"
70 AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}"
71 AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}")
72 set (${varname} PARENT_SCOPE)
73 endif (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}"
74 AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}"
75 AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}")
76endfunction (set_default_option)
77
78# note: this must be called before project()
79macro (no_default_options)
80 # prevent the platform probe to set options
81 set (CMAKE_NOT_USING_CONFIG_FLAGS TRUE)
82endmacro (no_default_options)
diff --git a/project/cmake/scripts/common/generateversionedfiles.cmake b/project/cmake/scripts/common/generateversionedfiles.cmake
deleted file mode 100644
index ea1fad5..0000000
--- a/project/cmake/scripts/common/generateversionedfiles.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
1include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/macros.cmake)
2
3core_find_versions()
4file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon)
5file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/kodi.guilib)
6configure_file(${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in
7 ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml @ONLY)
8configure_file(${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in
9 ${CMAKE_BINARY_DIR}/addons/kodi.guilib/addon.xml @ONLY)
10configure_file(${CORE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in
11 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp @ONLY)
diff --git a/project/cmake/scripts/common/macros.cmake b/project/cmake/scripts/common/macros.cmake
deleted file mode 100644
index 0900740..0000000
--- a/project/cmake/scripts/common/macros.cmake
+++ /dev/null
@@ -1,383 +0,0 @@
1# This script holds the main functions used to construct the build system
2
3# include system specific macros
4include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/macros.cmake)
5
6# Add a library, optionally as a dependency of the main application
7# Arguments:
8# name name of the library to add
9# Optional Arguments:
10# NO_MAIN_DEPENDS if specified, the library is not added to main depends
11# Implicit arguments:
12# SOURCES the sources of the library
13# HEADERS the headers of the library (only for IDE support)
14# OTHERS other library related files (only for IDE support)
15# On return:
16# Library will be built, optionally added to ${core_DEPENDS}
17function(core_add_library name)
18 cmake_parse_arguments(arg "NO_MAIN_DEPENDS" "" "" ${ARGN})
19
20 if(NOT SOURCES)
21 message(STATUS "No sources added to ${name} skipping")
22 return()
23 endif()
24
25 add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS})
26 set_target_properties(${name} PROPERTIES PREFIX "")
27 if(NOT arg_NO_MAIN_DEPENDS)
28 set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE)
29 endif()
30
31 # Add precompiled headers to Kodi main libraries
32 if(WIN32 AND "${CMAKE_CURRENT_LIST_DIR}" MATCHES "^${CORE_SOURCE_DIR}/xbmc")
33 add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/win32/pch.cpp
34 PCH_TARGET kodi)
35 endif()
36
37 # IDE support
38 if(CMAKE_GENERATOR MATCHES "Xcode")
39 file(RELATIVE_PATH parentfolder ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
40 set_target_properties(${name} PROPERTIES FOLDER "${parentfolder}")
41 elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
42 file(RELATIVE_PATH foldername ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
43 set_target_properties(${name} PROPERTIES FOLDER "${foldername}")
44 source_group(" " REGULAR_EXPRESSION ".*")
45 endif()
46endfunction()
47
48# Add a test library, and add sources to list for gtest integration macros
49function(core_add_test_library name)
50 core_add_library(${name} NO_MAIN_DEPENDS)
51 set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL 1)
52 foreach(src ${SOURCES})
53 set(test_sources ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${test_sources} CACHE STRING "" FORCE)
54 endforeach()
55 set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE)
56endfunction()
57
58# Add a data file to installation list with a mirror in build tree
59# Arguments:
60# file full path to file to mirror
61# relative the relative base of file path in the build/install tree
62# Optional Arguments:
63# NO_INSTALL: exclude file from installation target
64# Implicit arguments:
65# CORE_SOURCE_DIR - root of source tree
66# On return:
67# Files is mirrored to the build tree and added to ${install_data}
68# (if NO_INSTALL is not given).
69function(copy_file_to_buildtree file relative)
70 cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN})
71 string(REPLACE "${relative}/" "" outfile ${file})
72 get_filename_component(outdir ${outfile} DIRECTORY)
73
74 if(NOT TARGET export-files)
75 file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
76 add_custom_target(export-files ALL COMMENT "Copying files into build tree"
77 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake)
78 endif()
79 if(NOT ${CORE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
80 if(VERBOSE)
81 message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}")
82 endif()
83 file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake
84 "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n")
85 endif()
86 if(NOT arg_NO_INSTALL)
87 list(APPEND install_data ${outfile})
88 set(install_data ${install_data} PARENT_SCOPE)
89 endif()
90endfunction()
91
92# Add data files to installation list with a mirror in build tree.
93# reads list of files to install from a given list of text files.
94# Arguments:
95# pattern globbing pattern for text files to read
96# Optional Arguments:
97# NO_INSTALL: exclude files from installation target
98# Implicit arguments:
99# CORE_SOURCE_DIR - root of source tree
100# On return:
101# Files are mirrored to the build tree and added to ${install_data}
102# (if NO_INSTALL is not given).
103function(copy_files_from_filelist_to_buildtree pattern)
104 # copies files listed in text files to the buildtree
105 # Input: [glob pattern: filepattern]
106 cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN})
107 list(APPEND pattern ${ARGN})
108 list(SORT pattern)
109 if(VERBOSE)
110 message(STATUS "copy_files_from_filelist_to_buildtree - got pattern: ${pattern}")
111 endif()
112 foreach(pat ${pattern})
113 file(GLOB filenames ${pat})
114 foreach(filename ${filenames})
115 string(STRIP ${filename} filename)
116 core_file_read_filtered(fstrings ${filename})
117 foreach(dir ${fstrings})
118 file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${dir})
119 foreach(file ${files})
120 if(arg_NO_INSTALL)
121 copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR} NO_INSTALL)
122 else()
123 copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR})
124 endif()
125 endforeach()
126 endforeach()
127 endforeach()
128 endforeach()
129 set(install_data ${install_data} PARENT_SCOPE)
130endfunction()
131
132# helper macro to set modified variables in parent scope
133macro(export_dep)
134 set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE)
135 set(DEPLIBS ${DEPLIBS} PARENT_SCOPE)
136 set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE)
137 set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE)
138 mark_as_advanced(${depup}_LIBRARIES)
139endmacro()
140
141# add a required dependency of main application
142# Arguments:
143# dep name of find rule for dependency, used uppercased for variable prefix
144# On return:
145# dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES}
146function(core_require_dep dep)
147 find_package(${dep} REQUIRED)
148 string(TOUPPER ${dep} depup)
149 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
150 list(APPEND DEPLIBS ${${depup}_LIBRARIES})
151 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
152 export_dep()
153endfunction()
154
155# add a required dyloaded dependency of main application
156# Arguments:
157# dep name of find rule for dependency, used uppercased for variable prefix
158# On return:
159# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up
160function(core_require_dyload_dep dep)
161 find_package(${dep} REQUIRED)
162 string(TOUPPER ${dep} depup)
163 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
164 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
165 find_soname(${depup} REQUIRED)
166 export_dep()
167 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
168endfunction()
169
170# helper macro for optional deps
171macro(setup_enable_switch)
172 string(TOUPPER ${dep} depup)
173 if (ARGV1)
174 set(enable_switch ${ARGV1})
175 else()
176 set(enable_switch ENABLE_${depup})
177 endif()
178endmacro()
179
180# add an optional dependency of main application
181# Arguments:
182# dep name of find rule for dependency, used uppercased for variable prefix
183# On return:
184# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES}
185function(core_optional_dep dep)
186 setup_enable_switch()
187 if(${enable_switch})
188 find_package(${dep})
189 if(${depup}_FOUND)
190 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
191 list(APPEND DEPLIBS ${${depup}_LIBRARIES})
192 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
193 set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE)
194 export_dep()
195 else()
196 set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE)
197 endif()
198 endif()
199endfunction()
200
201# add an optional dyloaded dependency of main application
202# Arguments:
203# dep name of find rule for dependency, used uppercased for variable prefix
204# On return:
205# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up
206function(core_optional_dyload_dep dep)
207 setup_enable_switch()
208 if(${enable_switch})
209 find_package(${dep})
210 if(${depup}_FOUND)
211 list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS})
212 find_soname(${depup} REQUIRED)
213 list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS})
214 set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE)
215 export_dep()
216 set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE)
217 endif()
218 endif()
219endfunction()
220
221function(core_file_read_filtered result filepattern)
222 # Reads STRINGS from text files
223 # with comments filtered out
224 # Result: [list: result]
225 # Input: [glob pattern: filepattern]
226 file(GLOB filenames ${filepattern})
227 list(SORT filenames)
228 foreach(filename ${filenames})
229 if(VERBOSE)
230 message(STATUS "core_file_read_filtered - filename: ${filename}")
231 endif()
232 file(STRINGS ${filename} fstrings REGEX "^[^#//]")
233 foreach(fstring ${fstrings})
234 string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring})
235 string(REGEX REPLACE "//.*" "" fstring ${fstring})
236 string(STRIP ${fstring} fstring)
237 list(APPEND filename_strings ${fstring})
238 endforeach()
239 endforeach()
240 set(${result} ${filename_strings} PARENT_SCOPE)
241endfunction()
242
243function(core_add_subdirs_from_filelist files)
244 # Adds subdirectories from a sorted list of files
245 # Input: [list: filenames] [bool: sort]
246 foreach(arg ${ARGN})
247 list(APPEND files ${arg})
248 endforeach()
249 list(SORT files)
250 if(VERBOSE)
251 message(STATUS "core_add_subdirs_from_filelist - got pattern: ${files}")
252 endif()
253 foreach(filename ${files})
254 string(STRIP ${filename} filename)
255 core_file_read_filtered(fstrings ${filename})
256 foreach(subdir ${fstrings})
257 STRING_SPLIT(subdir " " ${subdir})
258 list(GET subdir 0 subdir_src)
259 list(GET subdir -1 subdir_dest)
260 if(VERBOSE)
261 message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}")
262 endif()
263 add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest})
264 endforeach()
265 endforeach()
266endfunction()
267
268macro(core_add_optional_subdirs_from_filelist pattern)
269 # Adds subdirectories from text files
270 # if the option(s) in the 3rd field are enabled
271 # Input: [glob pattern: filepattern]
272 foreach(arg ${ARGN})
273 list(APPEND pattern ${arg})
274 endforeach()
275 foreach(elem ${pattern})
276 string(STRIP ${elem} elem)
277 list(APPEND filepattern ${elem})
278 endforeach()
279
280 file(GLOB filenames ${filepattern})
281 list(SORT filenames)
282 if(VERBOSE)
283 message(STATUS "core_add_optional_subdirs_from_filelist - got pattern: ${filenames}")
284 endif()
285
286 foreach(filename ${filenames})
287 if(VERBOSE)
288 message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}")
289 endif()
290 file(STRINGS ${filename} fstrings REGEX "^[^#//]")
291 foreach(line ${fstrings})
292 string(REPLACE " " ";" line "${line}")
293 list(GET line 0 subdir_src)
294 list(GET line 1 subdir_dest)
295 list(GET line 3 opts)
296 foreach(opt ${opts})
297 if(ENABLE_${opt})
298 if(VERBOSE)
299 message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}")
300 endif()
301 add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest})
302 else()
303 if(VERBOSE)
304 message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir")
305 endif()
306 endif()
307 endforeach()
308 endforeach()
309 endforeach()
310endmacro()
311
312macro(today RESULT)
313 if (WIN32)
314 execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
315 string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
316 elseif(UNIX)
317 execute_process(COMMAND date -u +%F
318 OUTPUT_VARIABLE ${RESULT})
319 string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
320 else()
321 message(SEND_ERROR "date not implemented")
322 set(${RESULT} 000000)
323 endif()
324 string(REGEX REPLACE "(\r?\n)+$" "" ${RESULT} "${${RESULT}}")
325endmacro()
326
327function(core_find_git_rev)
328 find_package(Git)
329 if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git)
330 execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet --
331 RESULT_VARIABLE status_code
332 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
333 if (NOT status_code)
334 execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD --
335 RESULT_VARIABLE status_code
336 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
337 endif()
338 if (status_code)
339 execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD
340 OUTPUT_VARIABLE HASH
341 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
342 string(SUBSTRING ${HASH} 1 13 HASH)
343 else()
344 execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD
345 OUTPUT_VARIABLE HASH
346 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
347 string(SUBSTRING ${HASH} 1 7 HASH)
348 endif()
349 execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD
350 OUTPUT_VARIABLE DATE
351 WORKING_DIRECTORY ${CORE_SOURCE_DIR})
352 string(SUBSTRING ${DATE} 1 10 DATE)
353 else()
354 today(DATE)
355 set(HASH "nogitfound")
356 endif()
357 string(REPLACE "-" "" DATE ${DATE})
358 set(GIT_REV "${DATE}-${HASH}")
359 if(GIT_REV)
360 set(APP_SCMID ${GIT_REV} PARENT_SCOPE)
361 endif()
362endfunction()
363
364macro(core_find_versions)
365 include(CMakeParseArguments)
366 core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt)
367 string(REPLACE " " ";" version_list "${version_list}")
368 cmake_parse_arguments(APP "" "VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_NAME;COMPANY_NAME" "" ${version_list})
369
370 set(APP_NAME ${APP_APP_NAME}) # inconsistency in upstream
371 string(TOLOWER ${APP_APP_NAME} APP_NAME_LC)
372 set(COMPANY_NAME ${APP_COMPANY_NAME})
373 set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR})
374 if(APP_VERSION_TAG)
375 set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG})
376 endif()
377 string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0)
378 string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
379 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$")
380 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version})
381 file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$")
382 string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min})
383endmacro()
diff --git a/project/cmake/scripts/common/managestring.cmake b/project/cmake/scripts/common/managestring.cmake
deleted file mode 100644
index 7321f4c..0000000
--- a/project/cmake/scripts/common/managestring.cmake
+++ /dev/null
@@ -1,235 +0,0 @@
1# - Collection of String utility macros.
2# Defines the following macros:
3# STRING_TRIM(var str [NOUNQUOTE])
4# - Trim a string by removing the leading and trailing spaces,
5# just like STRING(STRIP ...) in CMake 2.6 and later.
6# This macro is needed as CMake 2.4 does not support STRING(STRIP ..)
7# This macro also remove quote and double quote marks around the string,
8# unless NOUNQUOTE is defined.
9# * Parameters:
10# + var: A variable that stores the result.
11# + str: A string.
12# + NOUNQUOTE: (Optional) do not remove the double quote mark around the string.
13#
14# STRING_UNQUOTE(var str)
15# - Remove double quote marks and quote marks around a string.
16# If the string is not quoted, then it returns an empty string.
17# * Parameters:
18# + var: A variable that stores the result.
19# + str: A string.
20#
21# STRING_JOIN(var delimiter str_list [str...])
22# - Concatenate strings, with delimiter inserted between strings.
23# * Parameters:
24# + var: A variable that stores the result.
25# + str_list: A list of string.
26# + str: (Optional) more string to be join.
27#
28# STRING_SPLIT(var delimiter str [NOESCAPE_SEMICOLON])
29# - Split a string into a list using a delimiter, which can be in 1 or more
30# characters long.
31# * Parameters:
32# + var: A variable that stores the result.
33# + delimiter: To separate a string.
34# + str: A string.
35# + NOESCAPE_SEMICOLON: (Optional) Do not escape semicolons.
36#
37
38IF(NOT DEFINED _MANAGE_STRING_CMAKE_)
39 SET(_MANAGE_STRING_CMAKE_ "DEFINED")
40
41 MACRO(STRING_TRIM var str)
42 SET(${var} "")
43 IF (NOT "${ARGN}" STREQUAL "NOUNQUOTE")
44 # Need not trim a quoted string.
45 STRING_UNQUOTE(_var "${str}")
46 IF(NOT _var STREQUAL "")
47 # String is quoted
48 SET(${var} "${_var}")
49 ENDIF(NOT _var STREQUAL "")
50 ENDIF(NOT "${ARGN}" STREQUAL "NOUNQUOTE")
51
52 IF(${var} STREQUAL "")
53 SET(_var_1 "${str}")
54 STRING(REGEX REPLACE "^[ \t\r\n]+" "" _var_2 "${str}" )
55 STRING(REGEX REPLACE "[ \t\r\n]+$" "" _var_3 "${_var_2}" )
56 SET(${var} "${_var_3}")
57 ENDIF(${var} STREQUAL "")
58 ENDMACRO(STRING_TRIM var str)
59
60 # Internal macro
61 # Variable cannot be escaped here, as variable is already substituted
62 # at the time it passes to this macro.
63 MACRO(STRING_ESCAPE var str)
64 # ';' and '\' are tricky, need to be encoded.
65 # '#' => '#H'
66 # '\' => '#B'
67 # ';' => '#S'
68 SET(_NOESCAPE_SEMICOLON "")
69 SET(_NOESCAPE_HASH "")
70
71 FOREACH(_arg ${ARGN})
72 IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
73 SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON")
74 ELSEIF(${_arg} STREQUAL "NOESCAPE_HASH")
75 SET(_NOESCAPE_HASH "NOESCAPE_HASH")
76 ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
77 ENDFOREACH(_arg)
78
79 IF(_NOESCAPE_HASH STREQUAL "")
80 STRING(REGEX REPLACE "#" "#H" _ret "${str}")
81 ELSE(_NOESCAPE_HASH STREQUAL "")
82 SET(_ret "${str}")
83 ENDIF(_NOESCAPE_HASH STREQUAL "")
84
85 STRING(REGEX REPLACE "\\\\" "#B" _ret "${_ret}")
86 IF(_NOESCAPE_SEMICOLON STREQUAL "")
87 STRING(REGEX REPLACE ";" "#S" _ret "${_ret}")
88 ENDIF(_NOESCAPE_SEMICOLON STREQUAL "")
89 SET(${var} "${_ret}")
90 ENDMACRO(STRING_ESCAPE var str)
91
92 MACRO(STRING_UNESCAPE var str)
93 # '#B' => '\'
94 # '#H' => '#'
95 # '#D' => '$'
96 # '#S' => ';'
97 SET(_ESCAPE_VARIABLE "")
98 SET(_NOESCAPE_SEMICOLON "")
99 SET(_ret "${str}")
100 FOREACH(_arg ${ARGN})
101 IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
102 SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON")
103 ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE")
104 SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE")
105 STRING(REGEX REPLACE "#D" "$" _ret "${_ret}")
106 ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
107 ENDFOREACH(_arg)
108
109 STRING(REGEX REPLACE "#B" "\\\\" _ret "${_ret}")
110 IF(_NOESCAPE_SEMICOLON STREQUAL "")
111 # ';' => '#S'
112 STRING(REGEX REPLACE "#S" "\\\\;" _ret "${_ret}")
113 ELSE(_NOESCAPE_SEMICOLON STREQUAL "")
114 STRING(REGEX REPLACE "#S" ";" _ret "${_ret}")
115 ENDIF(_NOESCAPE_SEMICOLON STREQUAL "")
116
117 IF(NOT _ESCAPE_VARIABLE STREQUAL "")
118 # '#D' => '$'
119 STRING(REGEX REPLACE "#D" "$" _ret "${_ret}")
120 ENDIF(NOT _ESCAPE_VARIABLE STREQUAL "")
121 STRING(REGEX REPLACE "#H" "#" _ret "${_ret}")
122 SET(${var} "${_ret}")
123 ENDMACRO(STRING_UNESCAPE var str)
124
125
126 MACRO(STRING_UNQUOTE var str)
127 STRING_ESCAPE(_ret "${str}" ${ARGN})
128 IF(_ret MATCHES "^[ \t\r\n]+")
129 STRING(REGEX REPLACE "^[ \t\r\n]+" "" _ret "${_ret}")
130 ENDIF(_ret MATCHES "^[ \t\r\n]+")
131 IF(_ret MATCHES "^\"")
132 # Double quote
133 STRING(REGEX REPLACE "\"\(.*\)\"[ \t\r\n]*$" "\\1" _ret "${_ret}")
134 ELSEIF(_ret MATCHES "^'")
135 # Single quote
136 STRING(REGEX REPLACE "'\(.*\)'[ \t\r\n]*$" "\\1" _ret "${_ret}")
137 ELSE(_ret MATCHES "^\"")
138 SET(_ret "")
139 ENDIF(_ret MATCHES "^\"")
140
141 # Unencoding
142 STRING_UNESCAPE(${var} "${_ret}" ${ARGN})
143 ENDMACRO(STRING_UNQUOTE var str)
144
145 MACRO(STRING_JOIN var delimiter str_list)
146 SET(_ret "")
147 FOREACH(_str ${str_list})
148 IF(_ret STREQUAL "")
149 SET(_ret "${_str}")
150 ELSE(_ret STREQUAL "")
151 SET(_ret "${_ret}${delimiter}${_str}")
152 ENDIF(_ret STREQUAL "")
153 ENDFOREACH(_str ${str_list})
154
155 FOREACH(_str ${ARGN})
156 IF(_ret STREQUAL "")
157 SET(_ret "${_str}")
158 ELSE(_ret STREQUAL "")
159 SET(_ret "${_ret}${delimiter}${_str}")
160 ENDIF(_ret STREQUAL "")
161 ENDFOREACH(_str ${str_list})
162 SET(${var} "${_ret}")
163 ENDMACRO(STRING_JOIN var delimiter str_list)
164
165 MACRO(STRING_SPLIT var delimiter str)
166 SET(_max_tokens "")
167 SET(_NOESCAPE_SEMICOLON "")
168 SET(_ESCAPE_VARIABLE "")
169 FOREACH(_arg ${ARGN})
170 IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
171 SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON")
172 ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE")
173 SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE")
174 ELSE(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
175 SET(_max_tokens ${_arg})
176 ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON")
177 ENDFOREACH(_arg)
178
179 IF(NOT _max_tokens)
180 SET(_max_tokens -1)
181 ENDIF(NOT _max_tokens)
182
183 STRING_ESCAPE(_str "${str}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE})
184 STRING_ESCAPE(_delimiter "${delimiter}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE})
185
186 SET(_str_list "")
187 SET(_token_count 0)
188 STRING(LENGTH "${_delimiter}" _de_len)
189
190 WHILE(NOT _token_count EQUAL _max_tokens)
191 MATH(EXPR _token_count ${_token_count}+1)
192 IF(_token_count EQUAL _max_tokens)
193 # Last token, no need splitting
194 SET(_str_list ${_str_list} "${_str}")
195 ELSE(_token_count EQUAL _max_tokens)
196 # in case encoded characters are delimiters
197 STRING(LENGTH "${_str}" _str_len)
198 SET(_index 0)
199 SET(_token "")
200 SET(_str_remain "")
201 MATH(EXPR _str_end ${_str_len}-${_de_len}+1)
202 SET(_bound "k")
203 WHILE(_index LESS _str_end)
204 STRING(SUBSTRING "${_str}" ${_index} ${_de_len} _str_cursor)
205 IF(_str_cursor STREQUAL _delimiter)
206 # Get the token
207 STRING(SUBSTRING "${_str}" 0 ${_index} _token)
208 # Get the rest
209 MATH(EXPR _rest_index ${_index}+${_de_len})
210 MATH(EXPR _rest_len ${_str_len}-${_index}-${_de_len})
211 STRING(SUBSTRING "${_str}" ${_rest_index} ${_rest_len} _str_remain)
212 SET(_index ${_str_end})
213 ELSE(_str_cursor STREQUAL _delimiter)
214 MATH(EXPR _index ${_index}+1)
215 ENDIF(_str_cursor STREQUAL _delimiter)
216 ENDWHILE(_index LESS _str_end)
217
218 IF(_str_remain STREQUAL "")
219 # Meaning: end of string
220 LIST(APPEND _str_list "${_str}")
221 SET(_max_tokens ${_token_count})
222 ELSE(_str_remain STREQUAL "")
223 LIST(APPEND _str_list "${_token}")
224 SET(_str "${_str_remain}")
225 ENDIF(_str_remain STREQUAL "")
226 ENDIF(_token_count EQUAL _max_tokens)
227 ENDWHILE(NOT _token_count EQUAL _max_tokens)
228
229
230 # Unencoding
231 STRING_UNESCAPE(${var} "${_str_list}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE})
232 ENDMACRO(STRING_SPLIT var delimiter str)
233
234ENDIF(NOT DEFINED _MANAGE_STRING_CMAKE_)
235
diff --git a/project/cmake/scripts/common/pathsetup.cmake b/project/cmake/scripts/common/pathsetup.cmake
deleted file mode 100644
index 54b352d..0000000
--- a/project/cmake/scripts/common/pathsetup.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
1# This script configures installation paths
2
3include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/pathsetup.cmake)
diff --git a/project/cmake/scripts/darwin/install.cmake b/project/cmake/scripts/darwin/install.cmake
deleted file mode 100644
index e69de29..0000000
--- a/project/cmake/scripts/darwin/install.cmake
+++ /dev/null
diff --git a/project/cmake/scripts/freebsd/archsetup.cmake b/project/cmake/scripts/freebsd/ArchSetup.cmake
index b85121f..013205c 100644
--- a/project/cmake/scripts/freebsd/archsetup.cmake
+++ b/project/cmake/scripts/freebsd/ArchSetup.cmake
@@ -14,6 +14,3 @@ else()
14 message(WARNING "unknown CPU: ${CPU}") 14 message(WARNING "unknown CPU: ${CPU}")
15 endif() 15 endif()
16endif() 16endif()
17
18set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use")
19set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE})
diff --git a/project/cmake/scripts/freebsd/Install.cmake b/project/cmake/scripts/freebsd/Install.cmake
new file mode 120000
index 0000000..28ce012
--- /dev/null
+++ b/project/cmake/scripts/freebsd/Install.cmake
@@ -0,0 +1 @@
../linux/Install.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/freebsd/Macros.cmake b/project/cmake/scripts/freebsd/Macros.cmake
new file mode 120000
index 0000000..2fdbb25
--- /dev/null
+++ b/project/cmake/scripts/freebsd/Macros.cmake
@@ -0,0 +1 @@
../linux/Macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/freebsd/PathSetup.cmake b/project/cmake/scripts/freebsd/PathSetup.cmake
new file mode 120000
index 0000000..6786c1c
--- /dev/null
+++ b/project/cmake/scripts/freebsd/PathSetup.cmake
@@ -0,0 +1 @@
../linux/PathSetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/freebsd/install.cmake b/project/cmake/scripts/freebsd/install.cmake
deleted file mode 100644
index 8247416..0000000
--- a/project/cmake/scripts/freebsd/install.cmake
+++ /dev/null
@@ -1,60 +0,0 @@
1set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
2set(bindir ${CMAKE_INSTALL_PREFIX}/bin)
3
4configure_file(${CORE_SOURCE_DIR}/tools/Linux/xbmc.sh.in
5 ${CORE_BUILD_DIR}/scripts/xbmc @ONLY)
6configure_file(${CORE_SOURCE_DIR}/tools/Linux/xbmc-standalone.sh.in
7 ${CORE_BUILD_DIR}/scripts/xbmc-standalone @ONLY)
8
9install(TARGETS xbmc-xrandr DESTINATION lib/xbmc)
10install(FILES ${addon_bindings} DESTINATION include/xbmc)
11install(FILES ${cmake_files} ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/modules/xbmc-config.cmake
12 DESTINATION lib/xbmc)
13install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/xbmc
14 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/xbmc-standalone
15 DESTINATION bin)
16install(FILES ${CORE_SOURCE_DIR}/tools/Linux/FEH.py
17 DESTINATION share/xbmc)
18
19install(FILES ${CORE_SOURCE_DIR}/tools/Linux/xbmc-xsession.desktop
20 RENAME XBMC.desktop
21 DESTINATION share/xsessions)
22
23install(FILES ${CORE_SOURCE_DIR}/copying.txt
24 ${CORE_SOURCE_DIR}/LICENSE.GPL
25 ${CORE_SOURCE_DIR}/version.txt
26 ${CORE_SOURCE_DIR}/docs/README.freebsd
27 DESTINATION share/doc/xbmc)
28
29foreach(texture ${XBT_FILES})
30 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
31 get_filename_component(dir ${dir} PATH)
32 install(FILES ${texture}
33 DESTINATION share/xbmc/${dir})
34endforeach()
35
36foreach(wraplib ${WRAP_FILES})
37 get_filename_component(dir ${wraplib} PATH)
38 install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib}
39 DESTINATION lib/xbmc/${dir})
40endforeach()
41
42foreach(file ${install_data})
43 get_filename_component(dir ${file} PATH)
44 install(FILES ${CMAKE_BINARY_DIR}/${file}
45 DESTINATION share/xbmc/${dir})
46endforeach()
47
48install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs)
49 foreach(dir \${dirs})
50 file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*)
51 foreach(file \${FILES})
52 get_filename_component(dir \${file} PATH)
53 file(INSTALL \${file} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/xbmc/\${dir})
54 endforeach()
55 endforeach()")
56foreach(subdir ${build_dirs})
57 string(REPLACE " " ";" subdir ${subdir})
58 list(GET subdir 0 id)
59 install(CODE "execute_process(COMMAND make -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install)")
60endforeach()
diff --git a/project/cmake/scripts/freebsd/macros.cmake b/project/cmake/scripts/freebsd/macros.cmake
deleted file mode 100644
index f0bf7ba..0000000
--- a/project/cmake/scripts/freebsd/macros.cmake
+++ /dev/null
@@ -1 +0,0 @@
1include(../linux/macros.cmake)
diff --git a/project/cmake/scripts/freebsd/pathsetup.cmake b/project/cmake/scripts/freebsd/pathsetup.cmake
deleted file mode 100644
index 1fb45b6..0000000
--- a/project/cmake/scripts/freebsd/pathsetup.cmake
+++ /dev/null
@@ -1 +0,0 @@
1include(${PROJECT_SOURCE_DIR}/scripts/linux/pathsetup.cmake)
diff --git a/project/cmake/scripts/ios/archsetup.cmake b/project/cmake/scripts/ios/ArchSetup.cmake
index e6639f7..56661e2 100644
--- a/project/cmake/scripts/ios/archsetup.cmake
+++ b/project/cmake/scripts/ios/ArchSetup.cmake
@@ -12,10 +12,9 @@ set(CMAKE_SYSTEM_NAME Darwin)
12if(WITH_ARCH) 12if(WITH_ARCH)
13 set(ARCH ${WITH_ARCH}) 13 set(ARCH ${WITH_ARCH})
14else() 14else()
15 if(CPU STREQUAL armv7) 15 if(CPU STREQUAL armv7 OR CPU STREQUAL arm64)
16 set(ARCH arm-apple-darwin) 16 set(ARCH arm-osx)
17 elseif(CPU STREQUAL arm64) 17 set(NEON False)
18 set(ARCH arm-apple-darwin)
19 else() 18 else()
20 message(SEND_ERROR "Unknown CPU: ${CPU}") 19 message(SEND_ERROR "Unknown CPU: ${CPU}")
21 endif() 20 endif()
@@ -30,9 +29,8 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo"
30 "-framework QuartzCore" "-framework MediaPlayer" 29 "-framework QuartzCore" "-framework MediaPlayer"
31 "-framework CFNetwork" "-framework CoreGraphics" 30 "-framework CFNetwork" "-framework CoreGraphics"
32 "-framework Foundation" "-framework UIKit" 31 "-framework Foundation" "-framework UIKit"
33 "-framework CoreMedia" "-framework AVFoundation") 32 "-framework CoreMedia" "-framework AVFoundation"
33 "-framework VideoToolbox")
34 34
35set(ENABLE_DVDCSS OFF) 35set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE)
36set(ENABLE_OPTICAL OFF) 36set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
37set(ENABLE_VTB ON)
38set(VTB_FOUND 1 CACHE INTERNAL "VTB")
diff --git a/project/cmake/scripts/ios/Install.cmake b/project/cmake/scripts/ios/Install.cmake
new file mode 100644
index 0000000..052565f
--- /dev/null
+++ b/project/cmake/scripts/ios/Install.cmake
@@ -0,0 +1,74 @@
1# IOS packaging
2
3set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}-iphoneos)
4
5file(MAKE_DIRECTORY ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app)
6set(BUNDLE_RESOURCES xbmc/platform/darwin/ios/Default-568h@2x.png
7 xbmc/platform/darwin/ios/Default-667h@2x.png
8 xbmc/platform/darwin/ios/Default-736h@3x.png
9 xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png
10 tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
11 tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
12 tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
13 tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
14 tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
15 tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
16 tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
17 tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
18 tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
19 tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
20 tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
21 tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
22 tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
23 tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
24
25foreach(resource IN LISTS BUNDLE_RESOURCES)
26 configure_file(${CORE_SOURCE_DIR}/${resource} ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app COPYONLY)
27endforeach()
28configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings
29 ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/English.lproj/InfoPlist.strings COPYONLY)
30
31configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in
32 ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/Info.plist @ONLY)
33
34add_custom_target(bundle
35 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/${APP_NAME}.bin
36 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
37 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
38 COMMAND "ACTION=build"
39 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}"
40 "TARGET_NAME=${APP_NAME}.app"
41 "APP_NAME=${APP_NAME}"
42 "PRODUCT_NAME=${APP_NAME}"
43 "WRAPPER_EXTENSION=app"
44 "SRCROOT=${CMAKE_BINARY_DIR}"
45 ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command
46 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
47 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}"
48 "TARGET_NAME=${APP_NAME}.app"
49 "APP_NAME=${APP_NAME}"
50 "PRODUCT_NAME=${APP_NAME}"
51 "FULL_PRODUCT_NAME=${APP_NAME}.app"
52 "WRAPPER_EXTENSION=app"
53 "SRCROOT=${CMAKE_BINARY_DIR}"
54 ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command)
55add_dependencies(bundle ${APP_NAME_LC})
56
57set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..)
58configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in
59 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh @ONLY)
60configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in
61 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY)
62
63add_custom_target(deb
64 COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.."
65 "PLATFORM_NAME=${PLATFORM}"
66 "CODESIGNING_FOLDER_PATH=${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app"
67 "BUILT_PRODUCTS_DIR=${PACKAGE_OUTPUT_DIR}"
68 "WRAPPER_NAME=${APP_NAME}.app"
69 "APP_NAME=${APP_NAME}"
70 "CODE_SIGN_IDENTITY=\"\""
71 ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
72 COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG}
73 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios)
74add_dependencies(deb bundle)
diff --git a/project/cmake/scripts/ios/Macros.cmake b/project/cmake/scripts/ios/Macros.cmake
new file mode 120000
index 0000000..54c1b28
--- /dev/null
+++ b/project/cmake/scripts/ios/Macros.cmake
@@ -0,0 +1 @@
../osx/Macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/ios/PathSetup.cmake b/project/cmake/scripts/ios/PathSetup.cmake
new file mode 120000
index 0000000..d7f25b2
--- /dev/null
+++ b/project/cmake/scripts/ios/PathSetup.cmake
@@ -0,0 +1 @@
../osx/PathSetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/ios/install.cmake b/project/cmake/scripts/ios/install.cmake
deleted file mode 120000
index 0ea6586..0000000
--- a/project/cmake/scripts/ios/install.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../darwin/install.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/ios/macros.cmake b/project/cmake/scripts/ios/macros.cmake
deleted file mode 120000
index 45c7ad1..0000000
--- a/project/cmake/scripts/ios/macros.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../darwin/macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/ios/pathsetup.cmake b/project/cmake/scripts/ios/pathsetup.cmake
deleted file mode 120000
index f8e1248..0000000
--- a/project/cmake/scripts/ios/pathsetup.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../darwin/pathsetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/linux/ArchSetup.cmake b/project/cmake/scripts/linux/ArchSetup.cmake
new file mode 100644
index 0000000..cae0bb8
--- /dev/null
+++ b/project/cmake/scripts/linux/ArchSetup.cmake
@@ -0,0 +1,41 @@
1set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX)
2set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED
3 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
4set(PLATFORM_DIR linux)
5set(CMAKE_SYSTEM_NAME Linux)
6if(WITH_ARCH)
7 set(ARCH ${WITH_ARCH})
8else()
9 if(CPU STREQUAL x86_64)
10 set(ARCH x86_64-linux)
11 set(NEON False)
12 elseif(CPU MATCHES "i.86")
13 set(ARCH i486-linux)
14 set(NEON False)
15 add_options(CXX ALL_BUILDS "-msse")
16 elseif(CPU MATCHES arm)
17 set(ARCH arm)
18 set(NEON True)
19 elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64)
20 set(ARCH aarch64)
21 set(NEON False)
22 else()
23 message(SEND_ERROR "Unknown CPU: ${CPU}")
24 endif()
25endif()
26
27# Make sure we strip binaries in Release build
28if(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_COMPILER_IS_GNUCXX)
29 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
30endif()
31
32find_package(CXX11 REQUIRED)
33include(LDGOLD)
34
35# Code Coverage
36if(CMAKE_BUILD_TYPE STREQUAL Coverage)
37 set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test)
38 set(COVERAGE_SOURCE_DIR ${CORE_SOURCE_DIR})
39 set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test")
40 set(COVERAGE_EXCLUDES */test/* lib/* */lib/*)
41endif()
diff --git a/project/cmake/scripts/linux/CodeCoverage.cmake b/project/cmake/scripts/linux/CodeCoverage.cmake
new file mode 100644
index 0000000..efc2208
--- /dev/null
+++ b/project/cmake/scripts/linux/CodeCoverage.cmake
@@ -0,0 +1,97 @@
1# - CodeCoverage
2# Generate code coverage reports with LCOV and GCovr.
3#
4# Configuration:
5# COVERAGE_SOURCE_DIR - Source root directory (default ${CMAKE_SOURCE_DIR}).
6# COVERAGE_BINARY_DIR - Directory where the coverage reports (and intermediate files)
7# are generated to.
8# COVERAGE_EXCLUDES - List of exclude patterns (for example '*/tests/*').
9#
10# The following targets will be generated:
11# coverage - Builds an html report. Requires LCOV.
12# coverage_xml - Builds an xml report (in Cobertura format for Jenkins).
13# Requires Gcovr.
14#
15# Inspired by https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
16
17# Comiler and linker setup
18set(CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING
19 "Flags used by the C compiler during coverage builds." FORCE)
20set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING
21 "Flags used by the C++ compiler during coverage builds." FORCE)
22set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING
23 "Flags used for linking binaries during coverage builds." FORCE)
24set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING
25 "Flags used by the shared libraries linker during coverage builds." FORCE)
26mark_as_advanced(
27 CMAKE_C_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE
28 CMAKE_SHARED_LINKER_FLAGS_COVERAGE CMAKE_STATIC_LINKER_FLAGS_COVERAGE
29)
30
31find_program(LCOV_EXECUTABLE lcov)
32find_program(GENINFO_EXECUTABLE geninfo)
33find_program(GENHTML_EXECUTABLE genhtml)
34find_program(GCOVR_EXECUTABLE gcovr)
35mark_as_advanced(LCOV_EXECUTABLE GENINFO_EXECUTABLE GENHTML_EXECUTABLE GCOVR_EXECUTABLE)
36
37# Default options
38if(NOT COVERAGE_SOURCE_DIR)
39 set(COVERAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
40endif()
41if(NOT COVERAGE_BINARY_DIR)
42 set(COVERAGE_BINARY_DIR ${CMAKE_BINARY_DIR}/coverage)
43endif()
44if(NOT COVERAGE_EXCLUDES)
45 set(COVERAGE_EXCLUDES)
46endif()
47
48# Allow variables in COVERAGE_DEPENDS that are not evaluated before this file is included.
49string(CONFIGURE "${COVERAGE_DEPENDS}" COVERAGE_DEPENDS)
50
51# Add coverage target that generates an HTML report using LCOV
52if(LCOV_EXECUTABLE AND GENINFO_EXECUTABLE AND GENHTML_EXECUTABLE)
53 file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR})
54 add_custom_target(coverage
55 COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_BINARY_DIR}
56 COMMAND ${LCOV_EXECUTABLE} -z -q -d ${CMAKE_BINARY_DIR}
57 COMMAND ${LCOV_EXECUTABLE} -c -q -i -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR}
58 -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info
59 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true
60 COMMAND ${LCOV_EXECUTABLE} -c -q -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR}
61 -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info
62 COMMAND ${LCOV_EXECUTABLE} -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info
63 -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info
64 -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info -q
65 COMMAND ${LCOV_EXECUTABLE} -q -r ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info
66 /usr/include/* ${CMAKE_BINARY_DIR}/* ${COVERAGE_EXCLUDES}
67 -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info
68 COMMAND ${GENHTML_EXECUTABLE} ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info
69 -o ${COVERAGE_BINARY_DIR}/html -s --legend --highlight --demangle-cpp
70 COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/html/index.html"
71 WORKING_DIRECTORY ${COVERAGE_BINARY_DIR}
72 VERBATIM
73 DEPENDS ${COVERAGE_DEPENDS}
74 COMMENT "Generate code coverage html report"
75 )
76else()
77 message(WARNING "Target coverage not available (lcov, geninfo and genhtml needed).")
78endif()
79
80# Add coverage target that generates an XML report using Gcovr
81if(GCOVR_EXECUTABLE)
82 file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR})
83 string(REGEX REPLACE "([^;]+)" "--exclude=\"\\1\"" _gcovr_excludes "${COVERAGE_EXCLUDES}")
84 string(REPLACE "*" ".*" _gcovr_excludes "${_gcovr_excludes}")
85 add_custom_target(coverage_xml
86 COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true
87 COMMAND ${GCOVR_EXECUTABLE} -x -r ${COVERAGE_SOURCE_DIR} -o ${COVERAGE_BINARY_DIR}/coverage.xml
88 --object-directory ${CMAKE_BINARY_DIR} ${_gcovr_excludes} ${CMAKE_BINARY_DIR}
89 COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/coverage.xml"
90 WORKING_DIRECTORY ${COVERAGE_BINARY_DIR}
91 DEPENDS ${COVERAGE_DEPENDS}
92 COMMENT "Generate code coverage xml report"
93 )
94 unset(_gcovr_excludes)
95else()
96 message(WARNING "Target coverage_xml not available (gcovr needed).")
97endif()
diff --git a/project/cmake/scripts/linux/ExtraTargets.cmake b/project/cmake/scripts/linux/ExtraTargets.cmake
new file mode 100644
index 0000000..2bb5f6f
--- /dev/null
+++ b/project/cmake/scripts/linux/ExtraTargets.cmake
@@ -0,0 +1,12 @@
1# xrandr
2if(ENABLE_X11 AND X_FOUND AND XRANDR_FOUND)
3 find_package(X QUIET)
4 find_package(XRandR QUIET)
5 add_executable(${APP_NAME_LC}-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c)
6 target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES})
7endif()
8
9# WiiRemote
10if(ENABLE_EVENTCLIENTS)
11 add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote)
12endif()
diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake
new file mode 100644
index 0000000..5458707
--- /dev/null
+++ b/project/cmake/scripts/linux/Install.cmake
@@ -0,0 +1,355 @@
1if(X_FOUND)
2 set(USE_X11 1)
3else()
4 set(USE_X11 0)
5endif()
6if(OPENGL_FOUND)
7 set(USE_OPENGL 1)
8else()
9 set(USE_OPENGL 0)
10endif()
11if(OPENGLES_FOUND)
12 set(USE_OPENGLES 1)
13else()
14 set(USE_OPENGLES 0)
15endif()
16
17# CMake config
18set(APP_PREFIX ${prefix})
19set(APP_LIB_DIR ${libdir}/${APP_NAME_LC})
20set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC})
21set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC})
22set(CXX11_SWITCH "-std=c++11")
23
24# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone
25if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse)
26 if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND)
27 file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content)
28 set(XBMC_STANDALONE_SH_PULSE ${pulse_content})
29 endif()
30endif()
31
32# Configure startup scripts
33configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in
34 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY)
35configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in
36 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY)
37
38# Configure cmake files
39configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in
40 ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY)
41
42# Configure xsession entry
43configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in
44 ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY)
45
46# Install app
47install(TARGETS ${APP_NAME_LC}
48 DESTINATION ${libdir}/${APP_NAME_LC}
49 COMPONENT kodi-bin)
50if(ENABLE_X11 AND XRANDR_FOUND)
51 install(TARGETS ${APP_NAME_LC}-xrandr
52 DESTINATION ${libdir}/${APP_NAME_LC}
53 COMPONENT kodi-bin)
54endif()
55
56# Install scripts
57install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}
58 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone
59 DESTINATION ${bindir}
60 COMPONENT kodi-bin)
61
62# Install libraries
63foreach(library ${LIBRARY_FILES})
64 get_filename_component(dir ${library} DIRECTORY)
65 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${dir})
66 install(PROGRAMS ${library}
67 DESTINATION ${libdir}/${APP_NAME_LC}/${dir}
68 COMPONENT kodi-bin)
69endforeach()
70
71# Install add-ons, fonts, icons, keyboard maps, keymaps, etc
72# (addons, media, system, userdata folders in share/kodi/)
73foreach(file ${install_data})
74 get_filename_component(dir ${file} DIRECTORY)
75 install(FILES ${CMAKE_BINARY_DIR}/${file}
76 DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
77 COMPONENT kodi)
78endforeach()
79
80# Install xsession entry
81install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop
82 DESTINATION ${datarootdir}/xsessions
83 COMPONENT kodi)
84
85# Install desktop entry
86install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop
87 DESTINATION ${datarootdir}/applications
88 COMPONENT kodi)
89
90# Install icons
91install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png
92 RENAME ${APP_NAME_LC}.png
93 DESTINATION ${datarootdir}/icons/hicolor/16x16/apps
94 COMPONENT kodi)
95install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png
96 RENAME ${APP_NAME_LC}.png
97 DESTINATION ${datarootdir}/icons/hicolor/22x22/apps
98 COMPONENT kodi)
99install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png
100 RENAME ${APP_NAME_LC}.png
101 DESTINATION ${datarootdir}/icons/hicolor/24x24/apps
102 COMPONENT kodi)
103install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png
104 RENAME ${APP_NAME_LC}.png
105 DESTINATION ${datarootdir}/icons/hicolor/32x32/apps
106 COMPONENT kodi)
107install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png
108 RENAME ${APP_NAME_LC}.png
109 DESTINATION ${datarootdir}/icons/hicolor/48x48/apps
110 COMPONENT kodi)
111install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png
112 RENAME ${APP_NAME_LC}.png
113 DESTINATION ${datarootdir}/icons/hicolor/64x64/apps
114 COMPONENT kodi)
115install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png
116 RENAME ${APP_NAME_LC}.png
117 DESTINATION ${datarootdir}/icons/hicolor/128x128/apps
118 COMPONENT kodi)
119install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png
120 RENAME ${APP_NAME_LC}.png
121 DESTINATION ${datarootdir}/icons/hicolor/256x256/apps
122 COMPONENT kodi)
123install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t
124 $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)"
125 COMPONENT kodi)
126
127# Install docs
128install(FILES ${CORE_SOURCE_DIR}/copying.txt
129 ${CORE_SOURCE_DIR}/LICENSE.GPL
130 ${CORE_SOURCE_DIR}/version.txt
131 ${CORE_SOURCE_DIR}/docs/README.linux
132 DESTINATION ${datarootdir}/doc/${APP_NAME_LC}
133 COMPONENT kodi)
134
135install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt
136 DESTINATION ${datarootdir}/${APP_NAME_LC}
137 COMPONENT kodi)
138
139# Install kodi-tools-texturepacker
140install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker
141 DESTINATION ${bindir}
142 COMPONENT kodi-tools-texturepacker)
143
144# Install kodi-addon-dev headers
145install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h
146 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp
147 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h
148 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h
149 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h
150 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
151 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
152 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h
153 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h
154 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h
155 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h
156 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h
157 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h
158 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h
159 ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h
160 ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h
161 DESTINATION ${includedir}/${APP_NAME_LC}
162 COMPONENT kodi-addon-dev)
163
164# Install kodi-addon-dev add-on bindings
165install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake
166 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake
167 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake
168 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake
169 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake
170 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake
171 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake
172 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake
173 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake
174 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake
175 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake
176 ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake
177 ${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake
178 DESTINATION ${datarootdir}/${APP_NAME_LC}/cmake
179 COMPONENT kodi-addon-dev)
180
181# Install kodi-audio-dev
182install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h
183 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h
184 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h
185 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h
186 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h
187 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h
188 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h
189 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h
190 DESTINATION ${includedir}/${APP_NAME_LC}
191 COMPONENT kodi-audio-dev)
192
193if(ENABLE_EVENTCLIENTS)
194 # Install kodi-eventclients-common BT python files
195 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py
196 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py
197 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py
198 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt
199 COMPONENT kodi-eventclients-common)
200
201 # Install kodi-eventclients-common PS3 python files
202 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py
203 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py
204 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py
205 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py
206 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py
207 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3
208 COMPONENT kodi-eventclients-common)
209
210 # Install kodi-eventclients-common python files
211 file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/")
212 install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py
213 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py
214 "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
215 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py
216 ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py
217 DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}
218 COMPONENT kodi-eventclients-common)
219
220 # Install kodi-eventclients-common icons
221 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png
222 ${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png
223 ${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png
224 ${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png
225 DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC}
226 COMPONENT kodi-eventclients-common)
227
228 # Install kodi-eventclients-dev headers
229 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h
230 DESTINATION ${includedir}/${APP_NAME_LC}
231 COMPONENT kodi-eventclients-dev)
232
233 # Install kodi-eventclients-dev C# examples
234 install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs"
235 DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#"
236 COMPONENT kodi-eventclients-dev)
237
238 # Install kodi-eventclients-dev C++ examples
239 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp
240 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp
241 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp
242 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp
243 ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp
244 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++
245 COMPONENT kodi-eventclients-dev)
246
247 # Install kodi-eventclients-dev java examples
248 install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java
249 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java
250 COMPONENT kodi-eventclients-dev)
251
252 # Install kodi-eventclients-dev python examples
253 install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py
254 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py
255 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py
256 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py
257 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py
258 ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py
259 DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python
260 COMPONENT kodi-eventclients-dev)
261
262 # Install kodi-eventclients-ps3
263 install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py"
264 RENAME ${APP_NAME_LC}-ps3remote
265 DESTINATION ${bindir}
266 COMPONENT kodi-eventclients-ps3)
267
268 # Install kodi-eventclients-wiiremote
269 install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/WiiRemote/${APP_NAME_LC}-wiiremote
270 DESTINATION ${bindir}
271 COMPONENT kodi-eventclients-wiiremote)
272
273 # Install kodi-eventclients-xbmc-send
274 install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py"
275 RENAME ${APP_NAME_LC}-send
276 DESTINATION ${bindir}
277 COMPONENT kodi-eventclients-xbmc-send)
278endif()
279
280# Install kodi-inputstream-dev
281install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
282 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h
283 DESTINATION ${includedir}/${APP_NAME_LC}
284 COMPONENT kodi-inputstream-dev)
285
286# Install kodi-pvr-dev
287install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h
288 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h
289 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h
290 DESTINATION ${includedir}/${APP_NAME_LC}
291 COMPONENT kodi-pvr-dev)
292
293# Install kodi-screensaver-dev
294install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h
295 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h
296 DESTINATION ${includedir}/${APP_NAME_LC}
297 COMPONENT kodi-screensaver-dev)
298
299# Install kodi-visualization-dev
300install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h
301 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h
302 DESTINATION ${includedir}/${APP_NAME_LC}
303 COMPONENT kodi-visualization-dev)
304
305# Install kodi-peripheral-dev
306install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h
307 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h
308 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h
309 ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp
310 DESTINATION ${includedir}/${APP_NAME_LC}
311 COMPONENT kodi-peripheral-dev)
312
313# Install XBT skin files
314foreach(texture ${XBT_FILES})
315 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
316 get_filename_component(dir ${dir} DIRECTORY)
317 install(FILES ${texture}
318 DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}
319 COMPONENT kodi)
320endforeach()
321
322# Install extra stuff if it exists
323if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs)
324 install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs)
325 foreach(dir \${dirs})
326 file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*)
327 foreach(file \${FILES})
328 get_filename_component(dir \${file} DIRECTORY)
329 file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir})
330 endforeach()
331 endforeach()")
332endif()
333
334if(NOT "$ENV{DESTDIR}" STREQUAL "")
335 set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR})
336endif()
337foreach(subdir ${build_dirs})
338 if(NOT subdir MATCHES kodi-platform)
339 string(REPLACE " " ";" subdir ${subdir})
340 list(GET subdir 0 id)
341 install(CODE "execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})")
342 endif()
343endforeach()
344
345# generate packages? yes please, if everything checks out
346if(CPACK_GENERATOR)
347 if(CPACK_GENERATOR STREQUAL DEB AND CORE_SYSTEM_NAME STREQUAL linux)
348 if(CMAKE_BUILD_TYPE STREQUAL Debug)
349 message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.")
350 endif()
351 include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake)
352 else()
353 message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.")
354 endif()
355endif()
diff --git a/project/cmake/scripts/linux/macros.cmake b/project/cmake/scripts/linux/Macros.cmake
index 7453a1c..72e9d5c 100644
--- a/project/cmake/scripts/linux/macros.cmake
+++ b/project/cmake/scripts/linux/Macros.cmake
@@ -5,7 +5,7 @@ function(core_link_library lib wraplib)
5 set(check_arg "") 5 set(check_arg "")
6 if(TARGET ${lib}) 6 if(TARGET ${lib})
7 set(target ${lib}) 7 set(target ${lib})
8 set(link_lib ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${lib}/${lib}.a) 8 set(link_lib $<TARGET_FILE:${lib}>)
9 set(check_arg ${ARGV2}) 9 set(check_arg ${ARGV2})
10 set(data_arg ${ARGV3}) 10 set(data_arg ${ARGV3})
11 else() 11 else()
@@ -14,28 +14,42 @@ function(core_link_library lib wraplib)
14 set(check_arg ${ARGV3}) 14 set(check_arg ${ARGV3})
15 set(data_arg ${ARGV4}) 15 set(data_arg ${ARGV4})
16 endif() 16 endif()
17
18 # wrapper has to be adapted in order to support coverage.
19 if(CMAKE_BUILD_TYPE STREQUAL Coverage)
20 set(export "")
21 endif()
22
17 if(check_arg STREQUAL export) 23 if(check_arg STREQUAL export)
18 set(export ${export} 24 set(export ${export}
19 -Wl,--version-script=${ARGV3}) 25 -Wl,--version-script=${ARGV3})
20 elseif(check_arg STREQUAL nowrap)
21 set(export ${data_arg})
22 elseif(check_arg STREQUAL extras) 26 elseif(check_arg STREQUAL extras)
23 foreach(arg ${data_arg}) 27 foreach(arg ${data_arg})
24 list(APPEND export ${arg}) 28 list(APPEND export ${arg})
25 endforeach() 29 endforeach()
30 elseif(check_arg STREQUAL archives)
31 set(extra_libs ${data_arg})
26 endif() 32 endif()
27 get_filename_component(dir ${wraplib} PATH) 33
28 add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} 34 string(REGEX REPLACE "[ ]+" ";" _flags ${CMAKE_SHARED_LINKER_FLAGS})
29 COMMAND cmake -E make_directory ${dir} 35 get_filename_component(dir ${wraplib} DIRECTORY)
36 add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}
37 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}
30 COMMAND ${CMAKE_C_COMPILER} 38 COMMAND ${CMAKE_C_COMPILER}
31 ARGS -Wl,--whole-archive 39 ARGS ${_flags} -Wl,--whole-archive
32 ${link_lib} 40 "${link_lib}" ${extra_libs}
33 -Wl,--no-whole-archive -lm 41 -Wl,--no-whole-archive -lm
42 -Wl,-soname,${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}
34 -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} 43 -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}
35 ${export} 44 ${export}
36 DEPENDS ${target} wrapper.def wrapper) 45 DEPENDS ${target} wrapper.def wrapper)
37 list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) 46
38 set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) 47 get_filename_component(libname ${wraplib} NAME_WE)
48 add_custom_target(wrap_${libname} ALL DEPENDS ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX})
49 set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped)
50 add_dependencies(${APP_NAME_LC}-libraries wrap_${libname})
51
52 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} CACHE STRING "" FORCE)
39endfunction() 53endfunction()
40 54
41function(find_soname lib) 55function(find_soname lib)
@@ -70,7 +84,9 @@ function(find_soname lib)
70 OUTPUT_VARIABLE ${lib}_SONAME) 84 OUTPUT_VARIABLE ${lib}_SONAME)
71 string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME}) 85 string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME})
72 string(STRIP ${${lib}_SONAME} ${lib}_SONAME) 86 string(STRIP ${${lib}_SONAME} ${lib}_SONAME)
73 message(STATUS "${lib} soname: ${${lib}_SONAME}") 87 if(VERBOSE)
88 message(STATUS "${lib} soname: ${${lib}_SONAME}")
89 endif()
74 set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) 90 set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE)
75 endif() 91 endif()
76 if(arg_REQUIRED AND NOT ${lib}_SONAME) 92 if(arg_REQUIRED AND NOT ${lib}_SONAME)
diff --git a/project/cmake/scripts/linux/PathSetup.cmake b/project/cmake/scripts/linux/PathSetup.cmake
new file mode 100644
index 0000000..f69711e
--- /dev/null
+++ b/project/cmake/scripts/linux/PathSetup.cmake
@@ -0,0 +1,39 @@
1include(GNUInstallDirs)
2
3if(NOT prefix)
4 set(prefix ${CMAKE_INSTALL_PREFIX})
5else()
6 set(CMAKE_INSTALL_PREFIX ${prefix})
7endif()
8if(NOT exec_prefix)
9 set(exec_prefix ${prefix})
10endif()
11if(NOT libdir)
12 set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
13endif()
14if(NOT bindir)
15 set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
16endif()
17if(NOT includedir)
18 set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
19endif()
20if(NOT datarootdir)
21 set(datarootdir ${CMAKE_INSTALL_FULL_DATAROOTDIR})
22endif()
23if(NOT datadir)
24 set(datadir ${CMAKE_INSTALL_FULL_DATADIR})
25endif()
26if(NOT docdir)
27 set(docdir ${CMAKE_INSTALL_FULL_DOCDIR})
28endif()
29
30list(APPEND final_message "-- PATH config --")
31list(APPEND final_message "Prefix: ${prefix}")
32list(APPEND final_message "Libdir: ${libdir}")
33list(APPEND final_message "Bindir: ${bindir}")
34list(APPEND final_message "Includedir: ${includedir}")
35list(APPEND final_message "Datarootdir: ${datarootdir}")
36list(APPEND final_message "Datadir: ${datadir}")
37
38set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\"
39 -DINSTALL_PATH=\"${datarootdir}/kodi\")
diff --git a/project/cmake/scripts/linux/archsetup.cmake b/project/cmake/scripts/linux/archsetup.cmake
deleted file mode 100644
index e193768..0000000
--- a/project/cmake/scripts/linux/archsetup.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
1set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX)
2set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED
3 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
4set(PLATFORM_DIR linux)
5set(CMAKE_SYSTEM_NAME Linux)
6if(WITH_ARCH)
7 set(ARCH ${WITH_ARCH})
8else()
9 if(CPU STREQUAL x86_64)
10 set(ARCH x86_64-linux)
11 elseif(CPU MATCHES "i.86")
12 set(ARCH i486-linux)
13 else()
14 message(SEND_ERROR "Unknown CPU: ${CPU}")
15 endif()
16endif()
17
18find_package(CXX11 REQUIRED)
19
20set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use")
21set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE})
diff --git a/project/cmake/scripts/linux/install.cmake b/project/cmake/scripts/linux/install.cmake
deleted file mode 100644
index 962a816..0000000
--- a/project/cmake/scripts/linux/install.cmake
+++ /dev/null
@@ -1,146 +0,0 @@
1if(X_FOUND)
2 set(USE_X11 1)
3else()
4 set(USE_X11 0)
5endif()
6if(OPENGL_FOUND)
7 set(USE_OPENGL 1)
8else()
9 set(USE_OPENGL 0)
10endif()
11if(OPENGLES_FOUND)
12 set(USE_OPENGLES 1)
13else()
14 set(USE_OPENGLES 0)
15endif()
16
17configure_file(${CORE_SOURCE_DIR}/project/cmake/${APP_NAME_LC}-config.cmake.in
18 ${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake @ONLY)
19
20configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in
21 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY)
22
23# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone
24if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse)
25 if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND)
26 file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content)
27 set(XBMC_STANDALONE_SH_PULSE ${pulse_content})
28 endif()
29endif()
30
31configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in
32 ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY)
33
34install(TARGETS ${APP_NAME_LC} DESTINATION ${libdir}/kodi)
35if(ENABLE_X11 AND XRANDR_FOUND)
36 install(TARGETS ${APP_NAME_LC}-xrandr DESTINATION ${libdir}/${APP_NAME_LC})
37endif()
38
39if(NOT EXISTS ${libdir}/xbmc)
40install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${libdir})")
41endif()
42install(FILES ${addon_bindings} DESTINATION ${includedir}/kodi)
43if(NOT EXISTS ${includedir}/xbmc)
44install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${includedir})")
45endif()
46
47install(FILES ${cmake_files}
48 DESTINATION ${libdir}/kodi)
49install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake
50 DESTINATION ${libdir}/${APP_NAME_LC})
51install(FILES ${CORE_SOURCE_DIR}/project/cmake/xbmc-config.cmake.in
52 RENAME xbmc-config.cmake
53 DESTINATION ${libdir}/${APP_NAME_LC})
54
55install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}
56 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone
57 DESTINATION ${bindir})
58install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC} xbmc WORKING_DIRECTORY ${bindir})")
59install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}-standalone xbmc-standalone WORKING_DIRECTORY ${bindir})")
60
61configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in
62 ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop)
63install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop
64 DESTINATION ${datarootdir}/xsessions)
65install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}.desktop xbmc.desktop WORKING_DIRECTORY ${datarootdir}/xsessions/)")
66
67if(NOT EXISTS ${datarootdir}/xbmc)
68install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${datarootdir})")
69endif()
70
71install(FILES ${CORE_SOURCE_DIR}/copying.txt
72 ${CORE_SOURCE_DIR}/LICENSE.GPL
73 ${CORE_SOURCE_DIR}/version.txt
74 ${CORE_SOURCE_DIR}/docs/README.linux
75 DESTINATION ${datarootdir}/doc/kodi)
76
77install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop
78 DESTINATION ${datarootdir}/applications)
79
80foreach(texture ${XBT_FILES})
81 string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture})
82 get_filename_component(dir ${dir} PATH)
83 install(FILES ${texture}
84 DESTINATION ${datarootdir}/kodi/${dir})
85endforeach()
86
87foreach(wraplib ${WRAP_FILES})
88 get_filename_component(dir ${wraplib} PATH)
89 install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib}
90 DESTINATION ${libdir}/kodi/${dir})
91endforeach()
92
93foreach(file ${install_data})
94 get_filename_component(dir ${file} PATH)
95 install(FILES ${CMAKE_BINARY_DIR}/${file}
96 DESTINATION ${datarootdir}/kodi/${dir})
97endforeach()
98
99if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs)
100 install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs)
101 foreach(dir \${dirs})
102 file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*)
103 foreach(file \${FILES})
104 get_filename_component(dir \${file} PATH)
105 file(INSTALL \${file} DESTINATION ${datarootdir}/kodi/\${dir})
106 endforeach()
107 endforeach()")
108endif()
109
110if(NOT "$ENV{DESTDIR}" STREQUAL "")
111 set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR})
112endif()
113foreach(subdir ${build_dirs})
114 if(NOT subdir MATCHES kodi-platform)
115 string(REPLACE " " ";" subdir ${subdir})
116 list(GET subdir 0 id)
117 install(CODE "execute_process(COMMAND make -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})")
118 endif()
119endforeach()
120
121install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png
122 RENAME ${APP_NAME_LC}.png
123 DESTINATION ${datarootdir}/icons/hicolor/16x16/apps)
124install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png
125 RENAME ${APP_NAME_LC}.png
126 DESTINATION ${datarootdir}/icons/hicolor/22x22/apps)
127install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png
128 RENAME ${APP_NAME_LC}.png
129 DESTINATION ${datarootdir}/icons/hicolor/24x24/apps)
130install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png
131 RENAME ${APP_NAME_LC}.png
132 DESTINATION ${datarootdir}/icons/hicolor/32x32/apps)
133install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png
134 RENAME ${APP_NAME_LC}.png
135 DESTINATION ${datarootdir}/icons/hicolor/48x48/apps)
136install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png
137 RENAME ${APP_NAME_LC}.png
138 DESTINATION ${datarootdir}/icons/hicolor/64x64/apps)
139install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png
140 RENAME ${APP_NAME_LC}.png
141 DESTINATION ${datarootdir}/icons/hicolor/128x128/apps)
142install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png
143 RENAME ${APP_NAME_LC}.png
144 DESTINATION ${datarootdir}/icons/hicolor/256x256/apps)
145
146install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)")
diff --git a/project/cmake/scripts/darwin/archsetup.cmake b/project/cmake/scripts/osx/ArchSetup.cmake
index accb8ab..3047863 100644
--- a/project/cmake/scripts/darwin/archsetup.cmake
+++ b/project/cmake/scripts/osx/ArchSetup.cmake
@@ -1,5 +1,5 @@
1if(NOT CMAKE_TOOLCHAIN_FILE) 1if(NOT CMAKE_TOOLCHAIN_FILE)
2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for darwin. See ${PROJECT_SOURCE_DIR}/README.md") 2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for osx. See ${PROJECT_SOURCE_DIR}/README.md")
3endif() 3endif()
4 4
5set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp 5set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp
@@ -14,10 +14,9 @@ set(CMAKE_SYSTEM_NAME Darwin)
14if(WITH_ARCH) 14if(WITH_ARCH)
15 set(ARCH ${WITH_ARCH}) 15 set(ARCH ${WITH_ARCH})
16else() 16else()
17 if(CPU STREQUAL x86_64) 17 if(CPU STREQUAL x86_64 OR CPU STREQUAL i386)
18 set(ARCH x86_64-apple-darwin) 18 set(ARCH x86-osx)
19 elseif(CPU STREQUAL i386) 19 set(NEON False)
20 set(ARCH i386-apple-darwin)
21 else() 20 else()
22 message(SEND_ERROR "Unknown CPU: ${CPU}") 21 message(SEND_ERROR "Unknown CPU: ${CPU}")
23 endif() 22 endif()
@@ -31,4 +30,5 @@ list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit"
31 "-framework IOSurface" "-framework SystemConfiguration" 30 "-framework IOSurface" "-framework SystemConfiguration"
32 "-framework ApplicationServices" "-framework AppKit" 31 "-framework ApplicationServices" "-framework AppKit"
33 "-framework CoreAudio" "-framework AudioToolbox" 32 "-framework CoreAudio" "-framework AudioToolbox"
34 "-framework CoreGraphics") 33 "-framework CoreGraphics" "-framework CoreMedia"
34 "-framework VideoToolbox")
diff --git a/project/cmake/scripts/osx/ExtraTargets.cmake b/project/cmake/scripts/osx/ExtraTargets.cmake
new file mode 100644
index 0000000..ed9c089
--- /dev/null
+++ b/project/cmake/scripts/osx/ExtraTargets.cmake
@@ -0,0 +1,3 @@
1# XBMCHelper
2add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper)
3add_dependencies(${APP_NAME_LC} XBMCHelper)
diff --git a/project/cmake/scripts/osx/Install.cmake b/project/cmake/scripts/osx/Install.cmake
new file mode 100644
index 0000000..3924ccf
--- /dev/null
+++ b/project/cmake/scripts/osx/Install.cmake
@@ -0,0 +1,40 @@
1# OSX packaging
2
3set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG})
4
5configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/Info.plist.in
6 ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist @ONLY)
7execute_process(COMMAND perl -p -i -e "s/r####/${APP_SCMID}/" ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist)
8
9add_custom_target(bundle
10 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> ${PACKAGE_OUTPUT_DIR}/${APP_NAME}
11 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
12 ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
13 COMMAND "ACTION=build"
14 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}"
15 "TARGET_NAME=${APP_NAME}.app"
16 "APP_NAME=${APP_NAME}"
17 "SRCROOT=${CMAKE_BINARY_DIR}"
18 ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-osx.command
19 COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
20 "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}"
21 "TARGET_NAME=${APP_NAME}.app"
22 "APP_NAME=${APP_NAME}"
23 "FULL_PRODUCT_NAME=${APP_NAME}.app"
24 "SRCROOT=${CMAKE_BINARY_DIR}"
25 ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command)
26set_target_properties(bundle PROPERTIES FOLDER "Build Utilities")
27add_dependencies(bundle ${APP_NAME_LC})
28
29configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh.in
30 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh @ONLY)
31
32add_custom_target(dmg
33 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/
34 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/
35 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/osx/
36 ${CMAKE_BINARY_DIR}/tools/darwin/packaging/media/osx/
37 COMMAND ./mkdmg-osx.sh ${CORE_BUILD_CONFIG}
38 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx)
39set_target_properties(dmg PROPERTIES FOLDER "Build Utilities")
40add_dependencies(dmg bundle)
diff --git a/project/cmake/scripts/darwin/macros.cmake b/project/cmake/scripts/osx/Macros.cmake
index 4ee17c2..0d04439 100644
--- a/project/cmake/scripts/darwin/macros.cmake
+++ b/project/cmake/scripts/osx/Macros.cmake
@@ -1,5 +1,5 @@
1function(core_link_library lib wraplib) 1function(core_link_library lib wraplib)
2 if(CMAKE_GENERATOR MATCHES "Unix Makefiles") 2 if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja)
3 set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) 3 set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o)
4 elseif(CMAKE_GENERATOR MATCHES "Xcode") 4 elseif(CMAKE_GENERATOR MATCHES "Xcode")
5 set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) 5 set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o)
@@ -8,8 +8,9 @@ function(core_link_library lib wraplib)
8 endif() 8 endif()
9 9
10 set(export -bundle -undefined dynamic_lookup -read_only_relocs suppress 10 set(export -bundle -undefined dynamic_lookup -read_only_relocs suppress
11 -Wl,-alias_list,${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def 11 -Wl,-alias_list,${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def
12 ${CORE_BUILD_DIR}/${wrapper_obj}) 12 ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${wrapper_obj})
13 set(extension ${CMAKE_SHARED_MODULE_SUFFIX})
13 set(check_arg "") 14 set(check_arg "")
14 if(TARGET ${lib}) 15 if(TARGET ${lib})
15 set(target ${lib}) 16 set(target ${lib})
@@ -25,34 +26,34 @@ function(core_link_library lib wraplib)
25 if(check_arg STREQUAL export) 26 if(check_arg STREQUAL export)
26 set(export ${export} 27 set(export ${export}
27 -Wl,--version-script=${ARGV3}) 28 -Wl,--version-script=${ARGV3})
28 elseif(check_arg STREQUAL nowrap)
29 set(export ${data_arg})
30 elseif(check_arg STREQUAL extras) 29 elseif(check_arg STREQUAL extras)
31 foreach(arg ${data_arg}) 30 foreach(arg ${data_arg})
32 list(APPEND export ${arg}) 31 list(APPEND export ${arg})
33 endforeach() 32 endforeach()
33 elseif(check_arg STREQUAL archives)
34 set(extra_libs ${data_arg})
34 endif() 35 endif()
35 get_filename_component(dir ${wraplib} PATH) 36 get_filename_component(dir ${wraplib} DIRECTORY)
36 37
37 # We can't simply pass the linker flags to the args section of the custom command 38 # We can't simply pass the linker flags to the args section of the custom command
38 # because cmake will add quotes around it (and the linker will fail due to those). 39 # because cmake will add quotes around it (and the linker will fail due to those).
39 # We need to do this handstand first ... 40 # We need to do this handstand first ...
40 separate_arguments(CUSTOM_COMMAND_ARGS_LDFLAGS UNIX_COMMAND "${CMAKE_SHARED_LINKER_FLAGS}") 41 string(REPLACE " " ";" CUSTOM_COMMAND_ARGS_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS})
41 42
42 add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} 43 add_custom_command(OUTPUT ${wraplib}-${ARCH}${extension}
43 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} 44 COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}
44 COMMAND ${CMAKE_C_COMPILER} 45 COMMAND ${CMAKE_C_COMPILER}
45 ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} 46 ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} ${extra_libs}
46 -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} 47 -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension}
47 DEPENDS ${target} wrapper.def wrapper 48 DEPENDS ${target} wrapper.def wrapper
48 VERBATIM) 49 VERBATIM)
49 50
50 # Uncomment to create wrap_<lib> targets for debugging 51 get_filename_component(libname ${wraplib} NAME_WE)
51 #get_filename_component(libname ${wraplib} NAME_WE) 52 add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${extension})
52 #add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) 53 set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped)
54 add_dependencies(${APP_NAME_LC}-libraries wrap_${libname})
53 55
54 list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) 56 set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} CACHE STRING "" FORCE)
55 set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE)
56endfunction() 57endfunction()
57 58
58function(find_soname lib) 59function(find_soname lib)
@@ -98,7 +99,9 @@ function(find_soname lib)
98 OUTPUT_VARIABLE filename 99 OUTPUT_VARIABLE filename
99 OUTPUT_STRIP_TRAILING_WHITESPACE) 100 OUTPUT_STRIP_TRAILING_WHITESPACE)
100 get_filename_component(${lib}_SONAME "${filename}" NAME) 101 get_filename_component(${lib}_SONAME "${filename}" NAME)
101 message(STATUS "${lib} soname: ${${lib}_SONAME}") 102 if(VERBOSE)
103 message(STATUS "${lib} soname: ${${lib}_SONAME}")
104 endif()
102 endif() 105 endif()
103 endforeach() 106 endforeach()
104 if(arg_REQUIRED AND NOT ${lib}_SONAME) 107 if(arg_REQUIRED AND NOT ${lib}_SONAME)
diff --git a/project/cmake/scripts/darwin/pathsetup.cmake b/project/cmake/scripts/osx/PathSetup.cmake
index 071dfd4..071dfd4 100644
--- a/project/cmake/scripts/darwin/pathsetup.cmake
+++ b/project/cmake/scripts/osx/PathSetup.cmake
diff --git a/project/cmake/scripts/rbpi/archsetup.cmake b/project/cmake/scripts/rbpi/ArchSetup.cmake
index 72a610f..fa1f9f4 100644
--- a/project/cmake/scripts/rbpi/archsetup.cmake
+++ b/project/cmake/scripts/rbpi/ArchSetup.cmake
@@ -1,7 +1,3 @@
1if(NOT CMAKE_TOOLCHAIN_FILE)
2 message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for rbpi. See ${PROJECT_SOURCE_DIR}/README.md")
3endif()
4
5set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI 1set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI
6 -DHAS_OMXPLAYER -DHAVE_OMXLIB) 2 -DHAS_OMXPLAYER -DHAVE_OMXLIB)
7set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED 3set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED
@@ -16,8 +12,10 @@ if(WITH_ARCH)
16else() 12else()
17 if(CPU STREQUAL arm1176jzf-s) 13 if(CPU STREQUAL arm1176jzf-s)
18 set(ARCH arm-linux-gnueabihf) 14 set(ARCH arm-linux-gnueabihf)
19 elseif(CPU MATCHES "cortex-a7") 15 set(NEON False)
16 elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53")
20 set(ARCH arm-linux-gnueabihf) 17 set(ARCH arm-linux-gnueabihf)
18 set(NEON True)
21 else() 19 else()
22 message(SEND_ERROR "Unknown CPU: ${CPU}") 20 message(SEND_ERROR "Unknown CPU: ${CPU}")
23 endif() 21 endif()
@@ -25,8 +23,6 @@ endif()
25 23
26find_package(CXX11 REQUIRED) 24find_package(CXX11 REQUIRED)
27 25
28set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use")
29set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE})
30set(MMAL_FOUND 1 CACHE INTERNAL "MMAL") 26set(MMAL_FOUND 1 CACHE INTERNAL "MMAL")
31set(OMX_FOUND 1 CACHE INTERNAL "OMX") 27set(OMX_FOUND 1 CACHE INTERNAL "OMX")
32set(OMXLIB_FOUND 1 CACHE INTERNAL "OMX") 28set(OMXLIB_FOUND 1 CACHE INTERNAL "OMX")
diff --git a/project/cmake/scripts/rbpi/Install.cmake b/project/cmake/scripts/rbpi/Install.cmake
new file mode 120000
index 0000000..28ce012
--- /dev/null
+++ b/project/cmake/scripts/rbpi/Install.cmake
@@ -0,0 +1 @@
../linux/Install.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/rbpi/Macros.cmake b/project/cmake/scripts/rbpi/Macros.cmake
new file mode 120000
index 0000000..2fdbb25
--- /dev/null
+++ b/project/cmake/scripts/rbpi/Macros.cmake
@@ -0,0 +1 @@
../linux/Macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/rbpi/PathSetup.cmake b/project/cmake/scripts/rbpi/PathSetup.cmake
new file mode 120000
index 0000000..6786c1c
--- /dev/null
+++ b/project/cmake/scripts/rbpi/PathSetup.cmake
@@ -0,0 +1 @@
../linux/PathSetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/rbpi/install.cmake b/project/cmake/scripts/rbpi/install.cmake
deleted file mode 120000
index 0409981..0000000
--- a/project/cmake/scripts/rbpi/install.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../linux/install.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/rbpi/macros.cmake b/project/cmake/scripts/rbpi/macros.cmake
deleted file mode 120000
index 28c77ca..0000000
--- a/project/cmake/scripts/rbpi/macros.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../linux/macros.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/rbpi/pathsetup.cmake b/project/cmake/scripts/rbpi/pathsetup.cmake
deleted file mode 120000
index 26d7f17..0000000
--- a/project/cmake/scripts/rbpi/pathsetup.cmake
+++ /dev/null
@@ -1 +0,0 @@
1../linux/pathsetup.cmake \ No newline at end of file
diff --git a/project/cmake/scripts/windows/archsetup.cmake b/project/cmake/scripts/windows/ArchSetup.cmake
index a54ab65..431b641 100644
--- a/project/cmake/scripts/windows/archsetup.cmake
+++ b/project/cmake/scripts/windows/ArchSetup.cmake
@@ -5,7 +5,7 @@ set(ARCH win32)
5 5
6# -------- Paths (mainly for find_package) --------- 6# -------- Paths (mainly for find_package) ---------
7 7
8set(PLATFORM_DIR win32) 8set(PLATFORM_DIR platform/win32)
9 9
10# Precompiled headers fail with per target output directory. (needs CMake 3.1) 10# Precompiled headers fail with per target output directory. (needs CMake 3.1)
11set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) 11set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs)
@@ -16,7 +16,6 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpe
16list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin) 16list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin)
17list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies) 17list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies)
18 18
19set(JPEG_NAMES ${JPEG_NAMES} jpeg-static)
20set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) 19set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python)
21 20
22 21
@@ -28,7 +27,6 @@ set(SYSTEM_DEFINES -DNOMINMAX -D_USE_32BIT_TIME_T -DHAS_DX -D__STDC_CONSTANT_MAC
28 -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING 27 -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING
29 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" 28 -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi"
30 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" 29 -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi"
31 -DBUILDING_WITH_CMAKE
32 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO -D_ITERATOR_DEBUG_LEVEL=0>) 30 $<$<CONFIG:Debug>:-DD3D_DEBUG_INFO -D_ITERATOR_DEBUG_LEVEL=0>)
33 31
34# Make sure /FS is set for Visual Studio in order to prevent simultanious access to pdb files. 32# Make sure /FS is set for Visual Studio in order to prevent simultanious access to pdb files.
@@ -36,6 +34,9 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio")
36 set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}") 34 set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}")
37endif() 35endif()
38 36
37# Google Test needs to use shared version of runtime libraries
38set(gtest_force_shared_crt ON CACHE STRING "" FORCE)
39
39 40
40# -------- Linker options --------- 41# -------- Linker options ---------
41 42
@@ -78,4 +79,11 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OP
78 79
79if(CMAKE_GENERATOR MATCHES "Visual Studio") 80if(CMAKE_GENERATOR MATCHES "Visual Studio")
80 set_property(GLOBAL PROPERTY USE_FOLDERS ON) 81 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
82
83 # Generate a batch file that opens Visual Studio with the necessary env variables set.
84 file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat
85 "@echo off\n"
86 "set KODI_HOME=%~dp0\n"
87 "set PATH=%~dp0\\system\n"
88 "start %~dp0\\${PROJECT_NAME}.sln")
81endif() 89endif()
diff --git a/project/cmake/scripts/windows/c-flag-overrides.cmake b/project/cmake/scripts/windows/CFlagOverrides.cmake
index fd85f5c..3158e75 100644
--- a/project/cmake/scripts/windows/c-flag-overrides.cmake
+++ b/project/cmake/scripts/windows/CFlagOverrides.cmake
@@ -2,4 +2,4 @@ if(MSVC)
2 set(CMAKE_C_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") 2 set(CMAKE_C_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2")
3 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") 3 set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0")
4 set(CMAKE_C_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") 4 set(CMAKE_C_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG")
5endif(MSVC) 5endif()
diff --git a/project/cmake/scripts/windows/cxx-flag-overrides.cmake b/project/cmake/scripts/windows/CXXFlagOverrides.cmake
index 536b809..0b52dc6 100644
--- a/project/cmake/scripts/windows/cxx-flag-overrides.cmake
+++ b/project/cmake/scripts/windows/CXXFlagOverrides.cmake
@@ -2,4 +2,4 @@ if(MSVC)
2 set(CMAKE_CXX_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") 2 set(CMAKE_CXX_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2")
3 set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") 3 set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0")
4 set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") 4 set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG")
5endif(MSVC) 5endif()
diff --git a/project/cmake/scripts/android/install.cmake b/project/cmake/scripts/windows/Install.cmake
index e69de29..e69de29 100644
--- a/project/cmake/scripts/android/install.cmake
+++ b/project/cmake/scripts/windows/Install.cmake
diff --git a/project/cmake/scripts/windows/Macros.cmake b/project/cmake/scripts/windows/Macros.cmake
new file mode 100644
index 0000000..2d3500d
--- /dev/null
+++ b/project/cmake/scripts/windows/Macros.cmake
@@ -0,0 +1,66 @@
1function(core_link_library lib wraplib)
2 message(AUTHOR_WARNING "core_link_library is not compatible with windows.")
3endfunction()
4
5function(find_soname lib)
6 # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h.
7 # Therefore the output of this function is unused.
8endfunction()
9
10# Add precompiled header to target
11# Arguments:
12# target existing target that will be set up to compile with a precompiled header
13# pch_header the precompiled header file
14# pch_source the precompiled header source file
15# Optional Arguments:
16# PCH_TARGET build precompiled header as separate target with the given name
17# so that the same precompiled header can be used for multiple libraries
18# EXCLUDE_SOURCES if not all target sources shall use the precompiled header,
19# the relevant files can be listed here
20# On return:
21# Compiles the pch_source into a precompiled header and adds the header to
22# the given target
23function(add_precompiled_header target pch_header pch_source)
24 cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN})
25
26 if(PCH_PCH_TARGET)
27 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch)
28 else()
29 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch)
30 endif()
31
32 # Set compile options and dependency for sources
33 get_target_property(sources ${target} SOURCES)
34 list(REMOVE_ITEM sources ${pch_source})
35 foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES)
36 list(REMOVE_ITEM sources ${exclude_source})
37 endforeach()
38 set_source_files_properties(${sources}
39 PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\""
40 OBJECT_DEPENDS "${pch_binary}")
41
42 # Set compile options for precompiled header
43 if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch)
44 set_source_files_properties(${pch_source}
45 PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\""
46 OBJECT_OUTPUTS "${pch_binary}")
47 endif()
48
49 # Compile precompiled header
50 if(PCH_PCH_TARGET)
51 # As own target for usage in multiple libraries
52 if(NOT TARGET ${PCH_PCH_TARGET}_pch)
53 add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source})
54 set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140
55 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}
56 FOLDER "Build Utilities")
57 endif()
58 # From VS2012 onwards, precompiled headers have to be linked against (LNK2011).
59 target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch)
60 set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140
61 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
62 else()
63 # As part of the target
64 target_sources(${target} PRIVATE ${pch_source})
65 endif()
66endfunction()
diff --git a/project/cmake/scripts/linux/pathsetup.cmake b/project/cmake/scripts/windows/PathSetup.cmake
index 8550616..8550616 100644
--- a/project/cmake/scripts/linux/pathsetup.cmake
+++ b/project/cmake/scripts/windows/PathSetup.cmake
diff --git a/project/cmake/scripts/windows/install.cmake b/project/cmake/scripts/windows/install.cmake
deleted file mode 100644
index e69de29..0000000
--- a/project/cmake/scripts/windows/install.cmake
+++ /dev/null
diff --git a/project/cmake/scripts/windows/macros.cmake b/project/cmake/scripts/windows/macros.cmake
deleted file mode 100644
index 2b61875..0000000
--- a/project/cmake/scripts/windows/macros.cmake
+++ /dev/null
@@ -1,145 +0,0 @@
1function(core_link_library lib wraplib)
2# set(export -Wl,--unresolved-symbols=ignore-all
3# `cat ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def`
4# ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o)
5# set(check_arg "")
6# if(TARGET ${lib})
7# set(target ${lib})
8# set(link_lib ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${lib}/${lib}.a)
9# set(check_arg ${ARGV2})
10# set(data_arg ${ARGV3})
11# else()
12# set(target ${ARGV2})
13# set(link_lib ${lib})
14# set(check_arg ${ARGV3})
15# set(data_arg ${ARGV4})
16# endif()
17# if(check_arg STREQUAL "export")
18# set(export ${export}
19# -Wl,--version-script=${ARGV3})
20# elseif(check_arg STREQUAL "nowrap")
21# set(export ${data_arg})
22# elseif(check_arg STREQUAL "extras")
23# foreach(arg ${data_arg})
24# list(APPEND export ${arg})
25# endforeach()
26# endif()
27# get_filename_component(dir ${wraplib} PATH)
28# add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}
29# COMMAND cmake -E make_directory ${dir}
30# COMMAND ${CMAKE_C_COMPILER}
31# ARGS -Wl,--whole-archive
32# ${link_lib}
33# -Wl,--no-whole-archive -lm
34# -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}
35# ${export}
36# DEPENDS ${target} wrapper.def wrapper)
37# list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX})
38# set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE)
39endfunction()
40
41function(find_soname lib)
42 # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h.
43 # Therefore the output of this function is unused.
44endfunction()
45
46# Add precompiled header to target
47# Arguments:
48# target existing target that will be set up to compile with a precompiled header
49# pch_header the precompiled header file
50# pch_source the precompiled header source file
51# Optional Arguments:
52# PCH_TARGET build precompiled header as separate target with the given name
53# so that the same precompiled header can be used for multiple libraries
54# EXCLUDE_SOURCES if not all target sources shall use the precompiled header,
55# the relevant files can be listed here
56# On return:
57# Compiles the pch_source into a precompiled header and adds the header to
58# the given target
59function(add_precompiled_header target pch_header pch_source)
60 cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN})
61
62 if(PCH_PCH_TARGET)
63 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch)
64 else()
65 set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch)
66 endif()
67
68 # Set compile options and dependency for sources
69 get_target_property(sources ${target} SOURCES)
70 list(REMOVE_ITEM sources ${pch_source})
71 foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES)
72 list(REMOVE_ITEM sources ${exclude_source})
73 endforeach()
74 set_source_files_properties(${sources}
75 PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\""
76 OBJECT_DEPENDS "${pch_binary}")
77
78 # Set compile options for precompiled header
79 if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch)
80 set_source_files_properties(${pch_source}
81 PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\""
82 OBJECT_OUTPUTS "${pch_binary}")
83 endif()
84
85 # Compile precompiled header
86 if(PCH_PCH_TARGET)
87 # As own target for usage in multiple libraries
88 if(NOT TARGET ${PCH_PCH_TARGET}_pch)
89 add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source})
90 set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140
91 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
92 endif()
93 # From VS2012 onwards, precompiled headers have to be linked against (LNK2011).
94 target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch)
95 set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140
96 COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
97 else()
98 # As part of the target
99 target_sources(${target} PRIVATE ${pch_source})
100 endif()
101endfunction()
102
103# Adds an FX-compiled shader to a target
104# Creates a custom command that FX-compiles the given shader and adds the
105# generated header file to the given target.
106# Arguments:
107# target Target to add the FX-compiled shader to
108# hlsl HLSL shader input file
109# profile HLSL profile that specifies the shader model
110# entrypoint Shader entry point
111# On return:
112# FXC_FILE is set to the name of the generated header file.
113function(add_shader_dx target hlsl profile entrypoint)
114 get_filename_component(file ${hlsl} NAME_WE)
115 add_custom_command(OUTPUT ${file}.h
116 COMMAND ${FXC} /Fh ${file}.h
117 /E ${entrypoint}
118 /T ${profile}
119 /Vn ${file}
120 /Qstrip_reflect
121 ${hlsl}
122 DEPENDS ${hlsl}
123 COMMENT "FX compile ${hlsl}"
124 VERBATIM)
125 target_sources(${target} PRIVATE ${file}.h)
126 target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
127endfunction()
128
129# Copies the main dlls to the root of the buildtree
130# On return:
131# files added to ${install_data}, mirror in build tree
132function(copy_main_dlls_to_buildtree)
133 set(dir ${PROJECT_SOURCE_DIR}/../Win32BuildSetup/dependencies)
134 file(GLOB_RECURSE files ${dir}/*)
135 foreach(file ${files})
136 copy_file_to_buildtree(${file} ${dir})
137 endforeach()
138
139 if(D3DCOMPILER_DLL)
140 get_filename_component(d3dcompiler_dir ${D3DCOMPILER_DLL} DIRECTORY)
141 copy_file_to_buildtree(${D3DCOMPILER_DLL} ${d3dcompiler_dir})
142 endif()
143
144 set(install_data ${install_data} PARENT_SCOPE)
145endfunction()
diff --git a/project/cmake/treedata/common/externals.txt b/project/cmake/treedata/common/externals.txt
index 632b354..e3b9ab4 100644
--- a/project/cmake/treedata/common/externals.txt
+++ b/project/cmake/treedata/common/externals.txt
@@ -1,3 +1,2 @@
1xbmc/contrib/kissfft kissfft 1xbmc/contrib/kissfft kissfft
2lib/libUPnP upnp
3lib/libexif exif 2lib/libexif exif
diff --git a/project/cmake/treedata/common/games.txt b/project/cmake/treedata/common/games.txt
index e4e8b89..b622f5a 100644
--- a/project/cmake/treedata/common/games.txt
+++ b/project/cmake/treedata/common/games.txt
@@ -1,3 +1,4 @@
1xbmc/games/controllers games/controllers 1xbmc/games/controllers games/controllers
2xbmc/games/controllers/dialogs games/controllers/dialogs
2xbmc/games/controllers/guicontrols games/controllers/guicontrols 3xbmc/games/controllers/guicontrols games/controllers/guicontrols
3xbmc/games/controllers/windows games/controllers/windows 4xbmc/games/controllers/windows games/controllers/windows
diff --git a/project/cmake/treedata/common/network.txt b/project/cmake/treedata/common/network.txt
index c0ec4a3..6331b2d 100644
--- a/project/cmake/treedata/common/network.txt
+++ b/project/cmake/treedata/common/network.txt
@@ -1,6 +1,4 @@
1xbmc/network network 1xbmc/network network
2xbmc/network/dacp network/dacp
3xbmc/network/httprequesthandler network/httprequesthandler 2xbmc/network/httprequesthandler network/httprequesthandler
4xbmc/network/httprequesthandler/python network/httprequesthandler/python 3xbmc/network/httprequesthandler/python network/httprequesthandler/python
5xbmc/network/upnp network/upnp
6xbmc/network/websocket network/websocket 4xbmc/network/websocket network/websocket
diff --git a/project/cmake/treedata/common/subdirs.txt b/project/cmake/treedata/common/subdirs.txt
index c2828e0..e2bca7e 100644
--- a/project/cmake/treedata/common/subdirs.txt
+++ b/project/cmake/treedata/common/subdirs.txt
@@ -10,13 +10,13 @@ xbmc/addons/binary/interfaces/api1/InputStream api1AddonCallbacks_InputStream
10xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral 10xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral
11xbmc/addons/binary/interfaces/api1/PVR api1AddonCallbacks_PVR 11xbmc/addons/binary/interfaces/api1/PVR api1AddonCallbacks_PVR
12xbmc/commons commons 12xbmc/commons commons
13xbmc/cdrip cdrip
14xbmc/dbwrappers dbwrappers 13xbmc/dbwrappers dbwrappers
15xbmc/dialogs dialogs 14xbmc/dialogs dialogs
16xbmc/epg epg 15xbmc/epg epg
17xbmc/guilib guilib 16xbmc/guilib guilib
18xbmc/input input 17xbmc/input input
19xbmc/input/joysticks input/joysticks 18xbmc/input/joysticks input/joysticks
19xbmc/input/joysticks/dialogs input/joysticks/dialogs
20xbmc/input/joysticks/generic input/joysticks/generic 20xbmc/input/joysticks/generic input/joysticks/generic
21xbmc/listproviders listproviders 21xbmc/listproviders listproviders
22xbmc/media media 22xbmc/media media
diff --git a/project/cmake/treedata/freebsd/subdirs.txt b/project/cmake/treedata/freebsd/subdirs.txt
index faff03c..df2fa76 100644
--- a/project/cmake/treedata/freebsd/subdirs.txt
+++ b/project/cmake/treedata/freebsd/subdirs.txt
@@ -1,4 +1,13 @@
1xbmc/linux linuxsupport 1xbmc/linux linuxsupport
2xbmc/input/linux input/linux 2xbmc/linux/sse4 sse4
3xbmc/network/linux network/linux 3xbmc/input/linux input/linux
4xbmc/freebsd freebsdsupport 4xbmc/input/touch input/touch
5xbmc/input/touch/generic input/touch/generic
6xbmc/network/linux network/linux
7xbmc/peripherals/bus/linux peripherals/bus/linux
8xbmc/powermanagement/linux powermanagement/linux
9xbmc/storage/linux storage/linux
10xbmc/filesystem/posix filesystem/posix
11xbmc/utils/posix utils_posix
12xbmc/platform/posix posix
13xbmc/freebsd freebsdsupport
diff --git a/project/cmake/treedata/linux/subdirs.txt b/project/cmake/treedata/linux/subdirs.txt
index 81a48e3..2dc8045 100644
--- a/project/cmake/treedata/linux/subdirs.txt
+++ b/project/cmake/treedata/linux/subdirs.txt
@@ -9,4 +9,5 @@ xbmc/powermanagement/linux powermanagement/linux
9xbmc/storage/linux storage/linux 9xbmc/storage/linux storage/linux
10xbmc/filesystem/posix filesystem/posix 10xbmc/filesystem/posix filesystem/posix
11xbmc/utils/posix utils_posix 11xbmc/utils/posix utils_posix
12xbmc/windowing/egl windowing/egl
12xbmc/platform/posix posix 13xbmc/platform/posix posix
diff --git a/project/cmake/treedata/optional/common/cdrip.txt b/project/cmake/treedata/optional/common/cdrip.txt
new file mode 100644
index 0000000..79b5390
--- /dev/null
+++ b/project/cmake/treedata/optional/common/cdrip.txt
@@ -0,0 +1 @@
xbmc/cdrip cdrip # OPTICAL
diff --git a/project/cmake/treedata/optional/common/dacp.txt b/project/cmake/treedata/optional/common/dacp.txt
new file mode 100644
index 0000000..fd225c2
--- /dev/null
+++ b/project/cmake/treedata/optional/common/dacp.txt
@@ -0,0 +1 @@
xbmc/network/dacp network/dacp # AIRTUNES
diff --git a/project/cmake/treedata/optional/common/upnp.txt b/project/cmake/treedata/optional/common/upnp.txt
new file mode 100644
index 0000000..5589b80
--- /dev/null
+++ b/project/cmake/treedata/optional/common/upnp.txt
@@ -0,0 +1,2 @@
1lib/libUPnP upnp # UPNP
2xbmc/network/upnp network/upnp # UPNP
diff --git a/project/cmake/treedata/darwin/subdirs.txt b/project/cmake/treedata/osx/subdirs.txt
index f0fc5c5..f0fc5c5 100644
--- a/project/cmake/treedata/darwin/subdirs.txt
+++ b/project/cmake/treedata/osx/subdirs.txt
diff --git a/project/cmake/treedata/windows/externals.txt b/project/cmake/treedata/windows/externals.txt
new file mode 100644
index 0000000..989677e
--- /dev/null
+++ b/project/cmake/treedata/windows/externals.txt
@@ -0,0 +1 @@
lib/win32/Effects11 Effects11
diff --git a/project/cmake/treedata/windows/subdirs.txt b/project/cmake/treedata/windows/subdirs.txt
index 60c0095..e52d2f6 100644
--- a/project/cmake/treedata/windows/subdirs.txt
+++ b/project/cmake/treedata/windows/subdirs.txt
@@ -1,4 +1,4 @@
1xbmc/win32 win32support 1xbmc/platform/win32 platform_win32
2xbmc/input/windows input/windows 2xbmc/input/windows input/windows
3xbmc/input/touch input/touch 3xbmc/input/touch input/touch
4xbmc/input/touch/generic input/touch/generic 4xbmc/input/touch/generic input/touch/generic
@@ -9,7 +9,6 @@ xbmc/powermanagement/windows powermanagement/windows
9xbmc/storage/windows storage/windows 9xbmc/storage/windows storage/windows
10xbmc/filesystem/win32 filesystem/win32 10xbmc/filesystem/win32 filesystem/win32
11xbmc/utils/win32 utils_win32 11xbmc/utils/win32 utils_win32
12xbmc/platform/win32 platform_win32
13xbmc/rendering/dx rendering_dx 12xbmc/rendering/dx rendering_dx
14xbmc/threads/platform/win threads_win 13xbmc/threads/platform/win threads_win
15xbmc/windowing/windows windowing/windows 14xbmc/windowing/windows windowing/windows
diff --git a/project/cmake/xbmc-config.cmake.in b/project/cmake/xbmc-config.cmake.in
deleted file mode 100644
index 73d1c9c..0000000
--- a/project/cmake/xbmc-config.cmake.in
+++ /dev/null
@@ -1,4 +0,0 @@
1message(WARNING "find_package(xbmc) has been deprecated, please use find_package(kodi)")
2
3find_package(kodi REQUIRED)
4set(XBMC_INCLUDE_DIR ${KODI_INCLUDE_DIR}) \ No newline at end of file