From 8cdf8dec703d882b46ca50a769fabb95ffc48e2c Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 24 Nov 2016 21:27:41 +0100 Subject: sync with upstream --- project/cmake/CMakeLists.txt | 335 +- project/cmake/KodiConfig.cmake.in | 34 + project/cmake/README.md | 175 +- project/cmake/addons/CMakeLists.txt | 122 +- project/cmake/addons/README.md | 14 +- project/cmake/addons/bootstrap/Bootstrap.cmake | 39 + project/cmake/addons/bootstrap/CMakeLists.txt | 7 +- project/cmake/addons/bootstrap/bootstrap.cmake | 40 - project/cmake/addons/depends/CMakeLists.txt | 15 +- project/cmake/addons/depends/README | 6 +- .../depends/common/kodi-platform/kodi-platform.txt | 2 +- .../addons/depends/common/tinyxml/CMakeLists.txt | 3 +- .../cmake/addons/depends/windows/CMakeLists.txt | 23 +- .../cmake/addons/depends/windows/Find7Zip.cmake | 7 - project/cmake/addons/depends/windows/Install.cmake | 24 + .../cmake/addons/depends/windows/extract-7z.cmake | 10 - .../addons/depends/windows/extract-direct.cmake | 2 - project/cmake/addons/depends/windows/install.cmake | 24 - project/cmake/cpack/CPackConfigDEB.cmake | 352 +++ project/cmake/cpack/deb/NEWS.Debian | 24 + project/cmake/cpack/deb/copyright | 3244 ++++++++++++++++++++ project/cmake/cpack/deb/lintian/overrides/kodi | 1 + project/cmake/cpack/deb/menu/kodi | 2 + project/cmake/cpack/deb/package-description.txt | 16 + .../cmake/cpack/deb/packages/kodi-addon-dev.txt.in | 25 + .../cmake/cpack/deb/packages/kodi-audio-dev.txt.in | 25 + project/cmake/cpack/deb/packages/kodi-bin.txt.in | 25 + .../deb/packages/kodi-eventclients-common.txt.in | 25 + .../deb/packages/kodi-eventclients-dev.txt.in | 25 + .../deb/packages/kodi-eventclients-ps3.txt.in | 25 + .../packages/kodi-eventclients-wiiremote.txt.in | 25 + .../packages/kodi-eventclients-xbmc-send.txt.in | 25 + .../cpack/deb/packages/kodi-inputstream-dev.txt.in | 25 + .../cpack/deb/packages/kodi-peripheral-dev.txt.in | 24 + .../cmake/cpack/deb/packages/kodi-pvr-dev.txt.in | 25 + .../cpack/deb/packages/kodi-screensaver-dev.txt.in | 25 + .../deb/packages/kodi-tools-texturepacker.txt.in | 25 + .../deb/packages/kodi-visualization-dev.txt.in | 25 + project/cmake/cpack/deb/packages/kodi.txt.in | 25 + project/cmake/cpack/deb/postinst | 5 + project/cmake/cpack/deb/postrm | 3 + project/cmake/installdata/addon-bindings.txt | 37 - project/cmake/installdata/cmake-files.txt | 13 - project/cmake/installdata/common/addons.txt | 8 +- project/cmake/installdata/darwin/runtime.txt | 1 - project/cmake/installdata/ios/certificates.txt | 1 + project/cmake/installdata/ios/packaging.txt | 3 + project/cmake/installdata/ios/runtime.txt | 2 + project/cmake/installdata/osx/certificates.txt | 1 + project/cmake/installdata/osx/packaging.txt | 4 + project/cmake/installdata/osx/runtime.txt | 2 + project/cmake/installdata/rbpi/lirc.txt | 1 + project/cmake/installdata/windows/dlls.txt | 8 +- project/cmake/installdata/windows/python.txt | 1 + project/cmake/kodi-config.cmake.in | 29 - project/cmake/modules/FindASS.cmake | 48 +- project/cmake/modules/FindAlsa.cmake | 52 +- project/cmake/modules/FindAvahi.cmake | 71 +- project/cmake/modules/FindBluetooth.cmake | 44 + project/cmake/modules/FindBluray.cmake | 39 +- project/cmake/modules/FindCCache.cmake | 22 +- project/cmake/modules/FindCEC.cmake | 16 +- project/cmake/modules/FindCWiid.cmake | 44 + project/cmake/modules/FindCXX11.cmake | 4 +- project/cmake/modules/FindCdio.cmake | 51 +- project/cmake/modules/FindCpluff.cmake | 44 +- project/cmake/modules/FindCrossGUID.cmake | 39 +- project/cmake/modules/FindCurl.cmake | 94 +- project/cmake/modules/FindD3DX11Effects.cmake | 25 +- project/cmake/modules/FindDBus.cmake | 52 + project/cmake/modules/FindDbus.cmake | 21 - project/cmake/modules/FindEMBEDDED.cmake | 3 +- project/cmake/modules/FindFFMPEG.cmake | 26 +- project/cmake/modules/FindFreeType.cmake | 49 +- project/cmake/modules/FindFribidi.cmake | 48 +- project/cmake/modules/FindJsonSchemaBuilder.cmake | 2 + project/cmake/modules/FindLibDRM.cmake | 45 + project/cmake/modules/FindLibDvd.cmake | 291 +- project/cmake/modules/FindLibSmbClient.cmake | 65 - project/cmake/modules/FindLibXml2.cmake | 84 + project/cmake/modules/FindLzo2.cmake | 45 +- project/cmake/modules/FindMicroHttpd.cmake | 125 +- project/cmake/modules/FindMySqlClient.cmake | 24 +- project/cmake/modules/FindNFS.cmake | 2 +- project/cmake/modules/FindOpenGLES.cmake | 2 +- project/cmake/modules/FindOpenGl.cmake | 4 +- project/cmake/modules/FindPulseAudio.cmake | 108 +- project/cmake/modules/FindPython.cmake | 51 +- project/cmake/modules/FindRTMP.cmake | 21 - project/cmake/modules/FindSSE.cmake | 238 +- project/cmake/modules/FindSSH.cmake | 52 +- project/cmake/modules/FindSWIG.cmake | 27 +- project/cmake/modules/FindShairplay.cmake | 4 +- project/cmake/modules/FindSmbClient.cmake | 47 + project/cmake/modules/FindSqlite3.cmake | 49 +- project/cmake/modules/FindTagLib.cmake | 4 +- project/cmake/modules/FindTinyXML.cmake | 2 +- project/cmake/modules/FindUDEV.cmake | 47 + project/cmake/modules/FindUDev.cmake | 22 - project/cmake/modules/FindVAAPI.cmake | 18 + project/cmake/modules/FindVDPAU.cmake | 17 +- project/cmake/modules/FindX.cmake | 62 +- project/cmake/modules/FindXRandR.cmake | 51 +- project/cmake/modules/FindXSLT.cmake | 50 + project/cmake/modules/FindXslt.cmake | 18 - project/cmake/modules/FindYajl.cmake | 71 +- project/cmake/modules/LDGOLD.cmake | 45 + .../cmake/modules/extra/ECMEnableSanitizers.cmake | 149 + project/cmake/scripts/android/ArchSetup.cmake | 35 + project/cmake/scripts/android/Install.cmake | 123 + project/cmake/scripts/android/Macros.cmake | 1 + project/cmake/scripts/android/PathSetup.cmake | 33 + project/cmake/scripts/android/archsetup.cmake | 30 - project/cmake/scripts/android/install.cmake | 0 project/cmake/scripts/android/macros.cmake | 1 - project/cmake/scripts/android/pathsetup.cmake | 1 - project/cmake/scripts/common/AddOptions.cmake | 78 + project/cmake/scripts/common/AddonHelpers.cmake | 268 ++ project/cmake/scripts/common/ArchSetup.cmake | 150 + project/cmake/scripts/common/CMakeHelpers.cmake | 54 + project/cmake/scripts/common/CheckCommits.cmake | 75 + .../cmake/scripts/common/CheckTargetPlatform.cmake | 63 + .../scripts/common/GenerateVersionedFiles.cmake | 18 + project/cmake/scripts/common/GeneratorSetup.cmake | 49 + project/cmake/scripts/common/HandleDepends.cmake | 219 ++ project/cmake/scripts/common/Macros.cmake | 619 ++++ project/cmake/scripts/common/PrepareEnv.cmake | 93 + project/cmake/scripts/common/ProjectMacros.cmake | 89 + project/cmake/scripts/common/Uninstall.cmake | 22 + project/cmake/scripts/common/addon-helpers.cmake | 171 -- project/cmake/scripts/common/addoptions.cmake | 82 - project/cmake/scripts/common/archsetup.cmake | 99 - .../scripts/common/check_target_platform.cmake | 61 - project/cmake/scripts/common/checkcommits.cmake | 75 - .../scripts/common/generateversionedfiles.cmake | 11 - project/cmake/scripts/common/generatorsetup.cmake | 24 - project/cmake/scripts/common/handle-depends.cmake | 209 -- project/cmake/scripts/common/macros.cmake | 383 --- project/cmake/scripts/common/managestring.cmake | 235 -- project/cmake/scripts/common/pathsetup.cmake | 3 - project/cmake/scripts/common/prepare-env.cmake | 136 - project/cmake/scripts/common/projectmacros.cmake | 87 - project/cmake/scripts/darwin/archsetup.cmake | 34 - project/cmake/scripts/darwin/install.cmake | 0 project/cmake/scripts/darwin/macros.cmake | 108 - project/cmake/scripts/darwin/pathsetup.cmake | 32 - project/cmake/scripts/freebsd/ArchSetup.cmake | 16 + project/cmake/scripts/freebsd/Install.cmake | 1 + project/cmake/scripts/freebsd/Macros.cmake | 1 + project/cmake/scripts/freebsd/PathSetup.cmake | 1 + project/cmake/scripts/freebsd/archsetup.cmake | 19 - project/cmake/scripts/freebsd/install.cmake | 60 - project/cmake/scripts/freebsd/macros.cmake | 1 - project/cmake/scripts/freebsd/pathsetup.cmake | 1 - project/cmake/scripts/ios/ArchSetup.cmake | 36 + project/cmake/scripts/ios/Install.cmake | 74 + project/cmake/scripts/ios/Macros.cmake | 1 + project/cmake/scripts/ios/PathSetup.cmake | 1 + project/cmake/scripts/ios/archsetup.cmake | 38 - project/cmake/scripts/ios/install.cmake | 1 - project/cmake/scripts/ios/macros.cmake | 1 - project/cmake/scripts/ios/pathsetup.cmake | 1 - project/cmake/scripts/linux/ArchSetup.cmake | 41 + project/cmake/scripts/linux/CodeCoverage.cmake | 97 + project/cmake/scripts/linux/ExtraTargets.cmake | 12 + project/cmake/scripts/linux/Install.cmake | 355 +++ project/cmake/scripts/linux/Macros.cmake | 95 + project/cmake/scripts/linux/PathSetup.cmake | 39 + project/cmake/scripts/linux/archsetup.cmake | 21 - project/cmake/scripts/linux/install.cmake | 146 - project/cmake/scripts/linux/macros.cmake | 79 - project/cmake/scripts/linux/pathsetup.cmake | 34 - project/cmake/scripts/osx/ArchSetup.cmake | 34 + project/cmake/scripts/osx/ExtraTargets.cmake | 3 + project/cmake/scripts/osx/Install.cmake | 40 + project/cmake/scripts/osx/Macros.cmake | 111 + project/cmake/scripts/osx/PathSetup.cmake | 32 + project/cmake/scripts/rbpi/ArchSetup.cmake | 28 + project/cmake/scripts/rbpi/Install.cmake | 1 + project/cmake/scripts/rbpi/Macros.cmake | 1 + project/cmake/scripts/rbpi/PathSetup.cmake | 1 + project/cmake/scripts/rbpi/archsetup.cmake | 32 - project/cmake/scripts/rbpi/install.cmake | 1 - project/cmake/scripts/rbpi/macros.cmake | 1 - project/cmake/scripts/rbpi/pathsetup.cmake | 1 - project/cmake/scripts/windows/ArchSetup.cmake | 89 + project/cmake/scripts/windows/CFlagOverrides.cmake | 5 + .../cmake/scripts/windows/CXXFlagOverrides.cmake | 5 + project/cmake/scripts/windows/Install.cmake | 0 project/cmake/scripts/windows/Macros.cmake | 66 + project/cmake/scripts/windows/PathSetup.cmake | 34 + project/cmake/scripts/windows/archsetup.cmake | 81 - .../cmake/scripts/windows/c-flag-overrides.cmake | 5 - .../cmake/scripts/windows/cxx-flag-overrides.cmake | 5 - project/cmake/scripts/windows/install.cmake | 0 project/cmake/scripts/windows/macros.cmake | 145 - project/cmake/scripts/windows/pathsetup.cmake | 34 - project/cmake/treedata/common/externals.txt | 1 - project/cmake/treedata/common/games.txt | 1 + project/cmake/treedata/common/network.txt | 2 - project/cmake/treedata/common/subdirs.txt | 2 +- project/cmake/treedata/darwin/subdirs.txt | 12 - project/cmake/treedata/freebsd/subdirs.txt | 17 +- project/cmake/treedata/linux/subdirs.txt | 1 + project/cmake/treedata/optional/common/cdrip.txt | 1 + project/cmake/treedata/optional/common/dacp.txt | 1 + project/cmake/treedata/optional/common/upnp.txt | 2 + project/cmake/treedata/osx/subdirs.txt | 12 + project/cmake/treedata/windows/externals.txt | 1 + project/cmake/treedata/windows/subdirs.txt | 3 +- project/cmake/xbmc-config.cmake.in | 4 - 211 files changed, 9681 insertions(+), 3725 deletions(-) create mode 100644 project/cmake/KodiConfig.cmake.in create mode 100644 project/cmake/addons/bootstrap/Bootstrap.cmake delete mode 100644 project/cmake/addons/bootstrap/bootstrap.cmake delete mode 100644 project/cmake/addons/depends/windows/Find7Zip.cmake create mode 100644 project/cmake/addons/depends/windows/Install.cmake delete mode 100644 project/cmake/addons/depends/windows/extract-7z.cmake delete mode 100644 project/cmake/addons/depends/windows/extract-direct.cmake delete mode 100644 project/cmake/addons/depends/windows/install.cmake create mode 100644 project/cmake/cpack/CPackConfigDEB.cmake create mode 100644 project/cmake/cpack/deb/NEWS.Debian create mode 100644 project/cmake/cpack/deb/copyright create mode 100644 project/cmake/cpack/deb/lintian/overrides/kodi create mode 100644 project/cmake/cpack/deb/menu/kodi create mode 100644 project/cmake/cpack/deb/package-description.txt create mode 100644 project/cmake/cpack/deb/packages/kodi-addon-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-audio-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-bin.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-eventclients-common.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-eventclients-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-eventclients-ps3.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-eventclients-wiiremote.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-eventclients-xbmc-send.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-inputstream-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-peripheral-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-pvr-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-screensaver-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-tools-texturepacker.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi-visualization-dev.txt.in create mode 100644 project/cmake/cpack/deb/packages/kodi.txt.in create mode 100755 project/cmake/cpack/deb/postinst create mode 100755 project/cmake/cpack/deb/postrm delete mode 100644 project/cmake/installdata/addon-bindings.txt delete mode 100644 project/cmake/installdata/cmake-files.txt delete mode 100644 project/cmake/installdata/darwin/runtime.txt create mode 100644 project/cmake/installdata/ios/certificates.txt create mode 100644 project/cmake/installdata/ios/packaging.txt create mode 100644 project/cmake/installdata/ios/runtime.txt create mode 100644 project/cmake/installdata/osx/certificates.txt create mode 100644 project/cmake/installdata/osx/packaging.txt create mode 100644 project/cmake/installdata/osx/runtime.txt create mode 120000 project/cmake/installdata/rbpi/lirc.txt create mode 100644 project/cmake/installdata/windows/python.txt delete mode 100644 project/cmake/kodi-config.cmake.in create mode 100644 project/cmake/modules/FindBluetooth.cmake create mode 100644 project/cmake/modules/FindCWiid.cmake create mode 100644 project/cmake/modules/FindDBus.cmake delete mode 100644 project/cmake/modules/FindDbus.cmake create mode 100644 project/cmake/modules/FindLibDRM.cmake delete mode 100644 project/cmake/modules/FindLibSmbClient.cmake create mode 100644 project/cmake/modules/FindLibXml2.cmake delete mode 100644 project/cmake/modules/FindRTMP.cmake create mode 100644 project/cmake/modules/FindSmbClient.cmake create mode 100644 project/cmake/modules/FindUDEV.cmake delete mode 100644 project/cmake/modules/FindUDev.cmake create mode 100644 project/cmake/modules/FindXSLT.cmake delete mode 100644 project/cmake/modules/FindXslt.cmake create mode 100644 project/cmake/modules/LDGOLD.cmake create mode 100644 project/cmake/modules/extra/ECMEnableSanitizers.cmake create mode 100644 project/cmake/scripts/android/ArchSetup.cmake create mode 100644 project/cmake/scripts/android/Install.cmake create mode 120000 project/cmake/scripts/android/Macros.cmake create mode 100644 project/cmake/scripts/android/PathSetup.cmake delete mode 100644 project/cmake/scripts/android/archsetup.cmake delete mode 100644 project/cmake/scripts/android/install.cmake delete mode 120000 project/cmake/scripts/android/macros.cmake delete mode 120000 project/cmake/scripts/android/pathsetup.cmake create mode 100644 project/cmake/scripts/common/AddOptions.cmake create mode 100644 project/cmake/scripts/common/AddonHelpers.cmake create mode 100644 project/cmake/scripts/common/ArchSetup.cmake create mode 100644 project/cmake/scripts/common/CMakeHelpers.cmake create mode 100644 project/cmake/scripts/common/CheckCommits.cmake create mode 100644 project/cmake/scripts/common/CheckTargetPlatform.cmake create mode 100644 project/cmake/scripts/common/GenerateVersionedFiles.cmake create mode 100644 project/cmake/scripts/common/GeneratorSetup.cmake create mode 100644 project/cmake/scripts/common/HandleDepends.cmake create mode 100644 project/cmake/scripts/common/Macros.cmake create mode 100644 project/cmake/scripts/common/PrepareEnv.cmake create mode 100644 project/cmake/scripts/common/ProjectMacros.cmake create mode 100644 project/cmake/scripts/common/Uninstall.cmake delete mode 100644 project/cmake/scripts/common/addon-helpers.cmake delete mode 100644 project/cmake/scripts/common/addoptions.cmake delete mode 100644 project/cmake/scripts/common/archsetup.cmake delete mode 100644 project/cmake/scripts/common/check_target_platform.cmake delete mode 100644 project/cmake/scripts/common/checkcommits.cmake delete mode 100644 project/cmake/scripts/common/generateversionedfiles.cmake delete mode 100644 project/cmake/scripts/common/generatorsetup.cmake delete mode 100644 project/cmake/scripts/common/handle-depends.cmake delete mode 100644 project/cmake/scripts/common/macros.cmake delete mode 100644 project/cmake/scripts/common/managestring.cmake delete mode 100644 project/cmake/scripts/common/pathsetup.cmake delete mode 100644 project/cmake/scripts/common/prepare-env.cmake delete mode 100644 project/cmake/scripts/common/projectmacros.cmake delete mode 100644 project/cmake/scripts/darwin/archsetup.cmake delete mode 100644 project/cmake/scripts/darwin/install.cmake delete mode 100644 project/cmake/scripts/darwin/macros.cmake delete mode 100644 project/cmake/scripts/darwin/pathsetup.cmake create mode 100644 project/cmake/scripts/freebsd/ArchSetup.cmake create mode 120000 project/cmake/scripts/freebsd/Install.cmake create mode 120000 project/cmake/scripts/freebsd/Macros.cmake create mode 120000 project/cmake/scripts/freebsd/PathSetup.cmake delete mode 100644 project/cmake/scripts/freebsd/archsetup.cmake delete mode 100644 project/cmake/scripts/freebsd/install.cmake delete mode 100644 project/cmake/scripts/freebsd/macros.cmake delete mode 100644 project/cmake/scripts/freebsd/pathsetup.cmake create mode 100644 project/cmake/scripts/ios/ArchSetup.cmake create mode 100644 project/cmake/scripts/ios/Install.cmake create mode 120000 project/cmake/scripts/ios/Macros.cmake create mode 120000 project/cmake/scripts/ios/PathSetup.cmake delete mode 100644 project/cmake/scripts/ios/archsetup.cmake delete mode 120000 project/cmake/scripts/ios/install.cmake delete mode 120000 project/cmake/scripts/ios/macros.cmake delete mode 120000 project/cmake/scripts/ios/pathsetup.cmake create mode 100644 project/cmake/scripts/linux/ArchSetup.cmake create mode 100644 project/cmake/scripts/linux/CodeCoverage.cmake create mode 100644 project/cmake/scripts/linux/ExtraTargets.cmake create mode 100644 project/cmake/scripts/linux/Install.cmake create mode 100644 project/cmake/scripts/linux/Macros.cmake create mode 100644 project/cmake/scripts/linux/PathSetup.cmake delete mode 100644 project/cmake/scripts/linux/archsetup.cmake delete mode 100644 project/cmake/scripts/linux/install.cmake delete mode 100644 project/cmake/scripts/linux/macros.cmake delete mode 100644 project/cmake/scripts/linux/pathsetup.cmake create mode 100644 project/cmake/scripts/osx/ArchSetup.cmake create mode 100644 project/cmake/scripts/osx/ExtraTargets.cmake create mode 100644 project/cmake/scripts/osx/Install.cmake create mode 100644 project/cmake/scripts/osx/Macros.cmake create mode 100644 project/cmake/scripts/osx/PathSetup.cmake create mode 100644 project/cmake/scripts/rbpi/ArchSetup.cmake create mode 120000 project/cmake/scripts/rbpi/Install.cmake create mode 120000 project/cmake/scripts/rbpi/Macros.cmake create mode 120000 project/cmake/scripts/rbpi/PathSetup.cmake delete mode 100644 project/cmake/scripts/rbpi/archsetup.cmake delete mode 120000 project/cmake/scripts/rbpi/install.cmake delete mode 120000 project/cmake/scripts/rbpi/macros.cmake delete mode 120000 project/cmake/scripts/rbpi/pathsetup.cmake create mode 100644 project/cmake/scripts/windows/ArchSetup.cmake create mode 100644 project/cmake/scripts/windows/CFlagOverrides.cmake create mode 100644 project/cmake/scripts/windows/CXXFlagOverrides.cmake create mode 100644 project/cmake/scripts/windows/Install.cmake create mode 100644 project/cmake/scripts/windows/Macros.cmake create mode 100644 project/cmake/scripts/windows/PathSetup.cmake delete mode 100644 project/cmake/scripts/windows/archsetup.cmake delete mode 100644 project/cmake/scripts/windows/c-flag-overrides.cmake delete mode 100644 project/cmake/scripts/windows/cxx-flag-overrides.cmake delete mode 100644 project/cmake/scripts/windows/install.cmake delete mode 100644 project/cmake/scripts/windows/macros.cmake delete mode 100644 project/cmake/scripts/windows/pathsetup.cmake delete mode 100644 project/cmake/treedata/darwin/subdirs.txt create mode 100644 project/cmake/treedata/optional/common/cdrip.txt create mode 100644 project/cmake/treedata/optional/common/dacp.txt create mode 100644 project/cmake/treedata/optional/common/upnp.txt create mode 100644 project/cmake/treedata/osx/subdirs.txt create mode 100644 project/cmake/treedata/windows/externals.txt delete mode 100644 project/cmake/xbmc-config.cmake.in (limited to 'project') 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 @@ cmake_minimum_required(VERSION 3.1) -project(kodi) +project(kodi LANGUAGES CXX C ASM) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules) if(DEPENDS_DIR) list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_DIR}) endif() +# Set CORE_SOURCE_DIR and CORE_BUILD_DIR +get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE) +set(CORE_BUILD_DIR build) + +message(STATUS "Source directory: ${CORE_SOURCE_DIR}") +message(STATUS "Build directory: ${CMAKE_BINARY_DIR}") +if(CMAKE_BINARY_DIR STREQUAL CORE_SOURCE_DIR) + message(WARNING "In-source build detected. It is recommended to build out-of-source.") +endif() + +# Hide messages from Check*.cmake (e.g. CheckCSourceCompiles) +if(NOT VERBOSE) + set(CMAKE_REQUIRED_QUIET ON) +endif() + +# Includes +include(modules/extra/ECMEnableSanitizers.cmake) +include(scripts/common/GeneratorSetup.cmake) +include(scripts/common/AddOptions.cmake) +include(scripts/common/ArchSetup.cmake) +include(scripts/common/Macros.cmake) +include(scripts/common/ProjectMacros.cmake) +include(scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) +include(ExternalProject) + +# Languages and global compiler settings set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp") # general option(VERBOSE "Enable verbose output?" OFF) option(ENABLE_DVDCSS "Enable libdvdcss support?" ON) option(ENABLE_UPNP "Enable UPnP support?" ON) option(ENABLE_NONFREE "Enable non-free components?" ON) -option(ENABLE_MICROHTTPD "Enable MicroHttpd webserver?" ON) -option(ENABLE_MYSQLCLIENT "Enable MySql support?" ON) -option(ENABLE_AVAHI "Enable Avahi support?" ON) -option(ENABLE_RTMP "Enable RTMP support?" ON) -option(ENABLE_BLURAY "Enable BluRay support?" ON) -option(ENABLE_PLIST "Enable AirPlay support?" ON) -option(ENABLE_NFS "Enable NFS support?" ON) option(ENABLE_AIRTUNES "Enable AirTunes support?" ON) option(ENABLE_CEC "Enable CEC support?" ON) +option(ENABLE_OPTICAL "Enable optical support?" ON) if(UNIX) if(NOT APPLE) option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" ON) - else() - option(ENABLE_VTB "Enable VTB support?" OFF) endif() option(FFMPEG_PATH "Path to external ffmpeg?" "") option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON) - option(ENABLE_ALSA "Enable ALSA support?" ON) - option(ENABLE_PULSEAUDIO "Enable PulseAudio support?" ON) - option(ENABLE_DBUS "Enable dbus support?" ON) - option(ENABLE_LIBUSB "Enable libusb support?" ON) - option(ENABLE_UDEV "Enable UDev support?" ON) - option(ENABLE_OPENGL "Enable OpenGL?" ON) - option(ENABLE_OPENGLES "Enable OpenGLES?" ON) option(ENABLE_OPENSSL "Enable OpenSSL?" ON) option(ENABLE_SDL "Enable SDL?" OFF) - option(ENABLE_X11 "Enable X11 support?" ON) - option(ENABLE_EGL "Enable EGL?" OFF) - option(ENABLE_VAAPI "Enable VAAPI support?" ON) - option(ENABLE_VDPAU "Enable VDPAU support?" ON) - option(ENABLE_OPTICAL "Enable optical support?" ON) + if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) + option(ENABLE_X11 "Enable X11 support?" ON) + option(ENABLE_AML "Enable AML?" OFF) + endif() endif() # System options if(NOT WIN32) @@ -53,25 +64,26 @@ if(NOT WIN32) option(WITH_CPU "build with given cpu" OFF) option(ENABLE_CCACHE "Enable Ccache support" ON) endif() +if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL rbpi) + option(ENABLE_LIRC "Enable LIRC support?" ON) + option(ENABLE_EVENTCLIENTS "Enable event clients support?" OFF) +endif() -get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE) -set(CORE_BUILD_DIR build) - -message(STATUS "Source directory: ${CORE_SOURCE_DIR}") -message(STATUS "Build directory: ${CMAKE_BINARY_DIR}") - -include(scripts/common/generatorsetup.cmake) -include(scripts/common/addoptions.cmake) -include(scripts/common/archsetup.cmake) -include(scripts/common/macros.cmake) -include(scripts/common/managestring.cmake) -include(scripts/common/projectmacros.cmake) -include(scripts/common/pathsetup.cmake) -include(ExternalProject) +# Build static libraries per directory +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_GENERATOR STREQUAL Xcode) + set(ENABLE_STATIC_LIBS TRUE) +else() + set(ENABLE_STATIC_LIBS FALSE) +endif() -core_find_git_rev() +core_find_git_rev(APP_SCMID FULL) core_find_versions() +# Dynamically loaded libraries built with the project +add_custom_target(${APP_NAME_LC}-libraries) +set(LIBRARY_FILES "" CACHE STRING "" FORCE) +mark_as_advanced(LIBRARY_FILES) + set(INCLUDES ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/addons/library.xbmc.addon ${CORE_SOURCE_DIR}/lib @@ -84,20 +96,19 @@ set(INCLUDES ${CORE_SOURCE_DIR} find_package(PkgConfig) if(CMAKE_CROSSCOMPILING) if(PKG_CONFIG_EXECUTABLE) - message(STATUS "CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}") set(PKG_CONFIG_FOUND TRUE) endif() endif() -find_package(Threads REQUIRED) +find_package(Threads REQUIRED QUIET) list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT}) # Required dependencies set(required_deps Sqlite3 FreeType PCRE Cpluff LibDvd - TinyXML Python Yajl Xslt - JPEG Lzo2 Fribidi TagLib FFMPEG CrossGUID) + TinyXML Python Yajl + Lzo2 Fribidi TagLib FFMPEG CrossGUID) if(NOT WIN32) - list(APPEND required_deps LibSmbClient ZLIB) + list(APPEND required_deps ZLIB) else() list(APPEND required_deps D3DX11Effects) endif() @@ -106,18 +117,18 @@ if(CORE_SYSTEM_NAME STREQUAL android) endif() # Optional dependencies -set(optional_deps MicroHttpd MySqlClient SSH - Alsa UDev Dbus Avahi +set(optional_deps MicroHttpd MySqlClient SSH XSLT + Alsa UDEV DBus Avahi SmbClient PulseAudio VDPAU VAAPI) # Required, dyloaded deps set(required_dyload Curl ASS) # Optional, dyloaded deps -set(dyload_optional RTMP CEC Bluray Plist NFS) +set(dyload_optional CEC Bluray Plist NFS) # Required by shared objects we link -set(required_dep_libs PNG EXPAT) +set(required_dep_libs EXPAT) # Required tools find_package(TexturePacker REQUIRED) @@ -165,6 +176,11 @@ if(ENABLE_OPTICAL) core_require_dep(Cdio) endif() +if(ENABLE_LIRC) + set(LIRC_DEVICE /dev/lircd CACHE STRING "LIRC device to use") + list(APPEND DEP_DEFINES -DLIRC_DEVICE="${LIRC_DEVICE}" -DHAVE_LIRC=1) +endif() + if(ENABLE_AIRTUNES) find_package(Shairplay) if(SHAIRPLAY_FOUND) @@ -172,36 +188,36 @@ if(ENABLE_AIRTUNES) endif() endif() -if(ENABLE_VTB) - list(APPEND DEP_DEFINES -DHAVE_VIDEOTOOLBOXDECODER=1) +if(CORE_SYSTEM_NAME STREQUAL osx) + core_require_dep(Sdl) +else() + core_optional_dep(Sdl) endif() if(NOT WIN32) core_optional_dep(OpenGl) if(OPENGL_FOUND) - if(NOT APPLE) - core_optional_dep(Sdl) - else() - core_require_dep(Sdl) - endif() core_optional_dep(X ENABLE_X11) + core_optional_dep(LibDRM ENABLE_X11) core_optional_dep(XRandR ENABLE_X11) else() - core_optional_dep(OpenGLES ENABLE_OPENGLES) + core_optional_dep(OpenGLES) if(OPENGLES_FOUND) - core_optional_dep(EGL ENABLE_EGL) - core_optional_dep(OMX ENABLE_OMX) - core_optional_dep(AML ENABLE_AML) core_optional_dep(X ENABLE_X11) - core_optional_dep(Sdl) + core_optional_dep(LibDRM ENABLE_X11) endif() endif() - - if(CORE_SYSTEM_NAME STREQUAL rbpi) - core_require_dep(MMAL) + if(NOT APPLE) + core_require_dep(EGL) endif() endif() +if(CORE_SYSTEM_NAME STREQUAL android OR CORE_SYSTEM_NAME STREQUAL linux) + core_optional_dep(AML) +elseif(CORE_SYSTEM_NAME STREQUAL rbpi) + core_require_dep(MMAL) +endif() + if(ENABLE_CCACHE) core_optional_dep(CCache) endif() @@ -217,7 +233,7 @@ add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp -DARCH_DEFINES="${ARCH_DEFINES}" -DAPP_SCMID=${APP_SCMID} -Dprefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} - -P ${PROJECT_SOURCE_DIR}/scripts/common/generateversionedfiles.cmake + -P ${PROJECT_SOURCE_DIR}/scripts/common/GenerateVersionedFiles.cmake DEPENDS ${CORE_SOURCE_DIR}/version.txt ${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in ${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in @@ -226,13 +242,15 @@ list(APPEND install_data addons/xbmc.addon/addon.xml) list(APPEND install_data addons/xbmc.json/addon.xml) list(APPEND install_data addons/kodi.guilib/addon.xml) add_library(compileinfo OBJECT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) +set_target_properties(compileinfo PROPERTIES FOLDER "Build Utilities") target_compile_options(compileinfo PRIVATE "${SYSTEM_DEFINES}") # RC File if(WIN32) - configure_file(${CORE_SOURCE_DIR}/xbmc/win32/XBMC_PC.rc.in - ${CORE_BUILD_DIR}/xbmc/win32/XBMC_PC.rc @ONLY) - add_library(resources OBJECT ${CORE_BUILD_DIR}/xbmc/win32/XBMC_PC.rc) + configure_file(${CORE_SOURCE_DIR}/xbmc/platform/win32/XBMC_PC.rc.in + ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc @ONLY) + add_library(resources OBJECT ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc) + set_target_properties(resources PROPERTIES FOLDER "Build Utilities") target_include_directories(resources PRIVATE ${CORE_SOURCE_DIR}/tools/windows/packaging/media) set(RESOURCES $) endif() @@ -247,23 +265,8 @@ mark_as_advanced(core_DEPENDS) mark_as_advanced(test_archives) mark_as_advanced(test_sources) -file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/addon-bindings.txt bindings) -foreach(binding ${bindings}) - list(APPEND addon_bindings ${CORE_SOURCE_DIR}/${binding}) -endforeach() - -file(STRINGS ${PROJECT_SOURCE_DIR}/installdata/cmake-files.txt cmakefiles) -foreach(cmakefile ${cmakefiles}) - list(APPEND cmake_files ${CORE_SOURCE_DIR}/${cmakefile}) -endforeach() - add_subdirectory(${CORE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL) - -# Subdirs -core_add_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/common/*.txt - ${PROJECT_SOURCE_DIR}/treedata/${CORE_SYSTEM_NAME}/*.txt) -core_add_optional_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/optional/common/*.txt - ${PROJECT_SOURCE_DIR}/treedata/optional/${CORE_SYSTEM_NAME}/*.txt) +set_target_properties(gtest PROPERTIES FOLDER "External Projects") # copy files to build tree copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/common/*.txt @@ -281,23 +284,9 @@ endforeach() add_custom_target(pack-skins ALL DEPENDS TexturePacker::TexturePacker export-files ${XBT_FILES}) - -core_link_library(exif system/libexif) -if(CORE_SYSTEM_NAME STREQUAL linux) - core_link_library(sse4 system/libsse4) -endif() - -core_link_library(XBMC_addon addons/library.xbmc.addon/libXBMC_addon) -core_link_library(XBMC_codec addons/library.xbmc.codec/libXBMC_codec) -core_link_library(XBMC_pvr addons/library.xbmc.pvr/libXBMC_pvr) -core_link_library(KODI_adsp addons/library.kodi.adsp/libKODI_adsp) -core_link_library(KODI_audioengine addons/library.kodi.audioengine/libKODI_audioengine) -core_link_library(KODI_guilib addons/library.kodi.guilib/libKODI_guilib) -core_link_library(KODI_inputstream addons/library.kodi.inputstream/libKODI_inputstream) -core_link_library(KODI_peripheral addons/library.kodi.peripheral/libKODI_peripheral) +set_target_properties(pack-skins PROPERTIES FOLDER "Build Utilities") file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/system/players/VideoPlayer) -add_custom_target(wrap-libraries ALL DEPENDS ${WRAP_FILES}) set(LIBCEC_SONAME "${CEC_SONAME}") if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL android) @@ -308,62 +297,166 @@ elseif(CORE_SYSTEM_NAME STREQUAL android) ${CORE_BUILD_DIR}/DllPaths_generated_android.h @ONLY) endif() +# main library (used for main binary and tests) +add_library(lib${APP_NAME_LC} STATIC $) +set_target_properties(lib${APP_NAME_LC} PROPERTIES PREFIX "") +add_dependencies(lib${APP_NAME_LC} libcpluff ffmpeg dvdnav crossguid) + # Codegen add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig) # Other files (IDE) set(OTHER_FILES README.md) +# Subdirs +core_add_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/common/*.txt + ${PROJECT_SOURCE_DIR}/treedata/${CORE_SYSTEM_NAME}/*.txt) +core_add_optional_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/optional/common/*.txt + ${PROJECT_SOURCE_DIR}/treedata/optional/${CORE_SYSTEM_NAME}/*.txt) + +target_link_libraries(lib${APP_NAME_LC} PUBLIC ${core_DEPENDS} ${SYSTEM_LDFLAGS} ${DEPLIBS} ${CMAKE_DL_LIBS}) +set_target_properties(lib${APP_NAME_LC} PROPERTIES PROJECT_LABEL "xbmc") +source_group_by_folder(lib${APP_NAME_LC} RELATIVE ${CORE_SOURCE_DIR}/xbmc) +if(WIN32) + add_precompiled_header(lib${APP_NAME_LC} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + set_language_cxx(lib${APP_NAME_LC}) +endif() + # main binary -add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} $ "${RESOURCES}" ${OTHER_FILES}) +if(NOT CORE_SYSTEM_NAME STREQUAL android) + add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} "${RESOURCES}" ${OTHER_FILES}) +else() + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") + add_library(${APP_NAME_LC} SHARED ${CORE_MAIN_SOURCE} "${RESOURCES}" ${OTHER_FILES}) +endif() +add_dependencies(${APP_NAME_LC} ${APP_NAME_LC}-libraries export-files pack-skins) whole_archive(_MAIN_LIBRARIES ${core_DEPENDS}) -target_link_libraries(${APP_NAME_LC} ${SYSTEM_LDFLAGS} ${_MAIN_LIBRARIES} ${DEPLIBS} ${CMAKE_DL_LIBS}) +target_link_libraries(${APP_NAME_LC} ${_MAIN_LIBRARIES} lib${APP_NAME_LC} ${DEPLIBS}) unset(_MAIN_LIBRARIES) -add_dependencies(${APP_NAME_LC} export-files) -if(NOT WIN32) - set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") -else() + +if(WIN32) set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) - copy_main_dlls_to_buildtree() + set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC}) + target_sources(kodi PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) +elseif(CORE_SYSTEM_NAME STREQUAL android) + # Nothing +else() + set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") endif() # testing copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/test-reference-data.txt NO_INSTALL) -add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CORE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp $) -whole_archive(_TEST_LIBRARIES ${core_DEPENDS} gtest ${test_archives}) -target_link_libraries(${APP_NAME_LC}-test ${SYSTEM_LDFLAGS} ${_TEST_LIBRARIES} ${DEPLIBS} ${CMAKE_DL_LIBS}) +add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CORE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp ${test_sources}) +whole_archive(_TEST_LIBRARIES ${core_DEPENDS} gtest) +target_link_libraries(${APP_NAME_LC}-test PRIVATE ${SYSTEM_LDFLAGS} ${_TEST_LIBRARIES} lib${APP_NAME_LC} ${DEPLIBS} ${CMAKE_DL_LIBS}) unset(_TEST_LIBRARIES) -add_dependencies(${APP_NAME_LC}-test export-files) +add_dependencies(${APP_NAME_LC}-test ${APP_NAME_LC}-libraries export-files) +if(WIN32) + add_precompiled_header(${APP_NAME_LC}-test pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) +endif() -# make test and make check (cannot be executed when cross compiling) -if(NOT CMAKE_CROSSCOMPILING) +# Enable unit-test related targets +if(CORE_HOST_IS_TARGET) enable_testing() gtest_add_tests(${APP_NAME_LC}-test "" ${test_sources}) add_custom_target(check ${CMAKE_CTEST_COMMAND} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) add_dependencies(check ${APP_NAME_LC}-test) + # Valgrind (memcheck) + find_program(VALGRIND_EXECUTABLE NAMES valgrind) + if(VALGRIND_EXECUTABLE) + set(CTEST_MEMORYCHECK_COMMAND ${VALGRIND_EXECUTABLE}) + set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --trace-children=yes --leak-check=yes --track-origins=yes") + include(CTest) + add_custom_target(check-valgrind ${CMAKE_CTEST_COMMAND} -D ExperimentalMemCheck \${ARGS} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) + add_dependencies(check-valgrind ${APP_NAME_LC}-test) + endif() + # For testing commit series - add_custom_target(check-commits ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/checkcommits.cmake + add_custom_target(check-commits ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/CheckCommits.cmake -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}) + set_target_properties(check-commits PROPERTIES FOLDER "Build Utilities") + + # code coverage + if(CMAKE_BUILD_TYPE STREQUAL Coverage) + if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) + include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) + else() + message(FATAL_ERROR "Code coverage not (yet) implemented for platform ${CORE_SYSTEM_NAME}") + endif() + endif() + + # Documentation + find_package(Doxygen) + if(DOXYGEN_FOUND) + add_custom_target(doc + COMMAND ${DOXYGEN_EXECUTABLE} ${CORE_SOURCE_DIR}/doxygen_resources/Doxyfile.doxy + COMMAND ${CMAKE_COMMAND} -E echo "Documentation built to: file://${CORE_SOURCE_DIR}/docs/html/index.html" + WORKING_DIRECTORY ${CORE_SOURCE_DIR}/doxygen_resources + COMMENT "Generating Doxygen documentation" VERBATIM) + endif() endif() # link wrapper if(FFMPEG_LINK_EXECUTABLE) set(CMAKE_CXX_LINK_EXECUTABLE "${FFMPEG_LINK_EXECUTABLE}") endif() +if(FFMPEG_CREATE_SHARED_LIBRARY) + set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${FFMPEG_CREATE_SHARED_LIBRARY}") +endif() + +# Platform specific additional extra targets +if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) + include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) +endif() + +include(scripts/${CORE_SYSTEM_NAME}/Install.cmake) -# randr -if(ENABLE_X11 AND XRANDR_FOUND) - add_executable(kodi-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c) - target_link_libraries(kodi-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) +# Add uninstall target +if(CMAKE_GENERATOR MATCHES Makefile) + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/Uninstall.cmake) + set_target_properties(uninstall PROPERTIES FOLDER "Build Utilities") endif() -# XBMCHelper -if(CORE_SYSTEM_TYPE STREQUAL darwin) - add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) +# Create target that allows to build binary-addons. +# Use make binary-addons ADDONS="visualization.spectrum" to select the addons to build. +if(CMAKE_GENERATOR STREQUAL "Unix Makefiles") + if(CMAKE_CROSSCOMPILING) + set(_cross_args CROSS_COMPILING=yes TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) + endif() + if(NOT CORE_SYSTEM_NAME STREQUAL android) + set(_prefix ${CMAKE_BINARY_DIR}/addons) + set(_extra "CMAKE_EXTRA=-DPACKAGE_ZIP=ON") + else() + set(_prefix ${CMAKE_INSTALL_PREFIX}) + endif() + add_custom_target(binary-addons + COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons clean + COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99 + PREFIX=${_prefix} INSTALL_PREFIX=${_prefix} ${_cross_args} ${_extra}) + unset(_cross_args) + unset(_prefix) endif() -include(scripts/${CORE_SYSTEM_NAME}/install.cmake) +# Prepare add-on build env +core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) +foreach(binding ${bindings}) + string(REPLACE " =" ";" binding "${binding}") + string(REPLACE "+=" ";" binding "${binding}") + list(GET binding 1 header) + get_filename_component(file ${header} NAME) + configure_file(${CORE_SOURCE_DIR}/${header} ${CORE_BUILD_DIR}/include/${APP_NAME_LC}/${file} COPYONLY) +endforeach() + +set(APP_LIB_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${APP_NAME_LC}) +set(APP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/${APP_NAME_LC}) +set(CXX11_SWITCH "-std=c++11") +configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in + ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/${APP_NAME}Config.cmake @ONLY) +configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddonHelpers.cmake + ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddonHelpers.cmake COPYONLY) +configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddOptions.cmake + ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddOptions.cmake COPYONLY) # Status message(STATUS "#---- CONFIGURATION ----#") @@ -388,6 +481,8 @@ if(VERBOSE) message(STATUS "datarootdir: ${datarootdir}") message(STATUS "#---------------------------------------------#") message(STATUS "GIT_REV: ${APP_SCMID}") + message(STATUS "#---------------------------------------------#") + message(STATUS "CPACK_GENERATOR : ${CPACK_GENERATOR}") + message(STATUS "CPACK_SOURCE_GENERATOR: ${CPACK_SOURCE_GENERATOR}") + message(STATUS "#---------------------------------------------#") endif() -message(STATUS "#---------------------------------------------#") - 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 @@ +set(APP_NAME @APP_NAME@) +set(APP_NAME_LC @APP_NAME_LC@) +set(APP_NAME_UC @APP_NAME_UC@) +set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) +set(APP_VERSION_MINOR @APP_VERSION_MINOR@) +if(NOT @APP_NAME_UC@_PREFIX) + set(@APP_NAME_UC@_PREFIX @APP_PREFIX@) +endif() +if(NOT @APP_NAME_UC@_INCLUDE_DIR) + set(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@) +endif() +if(NOT @APP_NAME_UC@_LIB_DIR) + set(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@) +endif() +if(NOT @APP_NAME_UC@_DATA_DIR) + set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@) +endif() +if(NOT WIN32) + set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") +endif() +list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake) + +string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@") +add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON) + +if(NOT CORE_SYSTEM_NAME) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(CORE_SYSTEM_NAME "osx") + else() + string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) + endif() +endif() + +include(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 @@ This files describes Kodi's CMake based buildsystem. CMake is a cross-platform tool for generating makefiles as well as project files used by IDEs. -The current version of the buildsystem is capable of building the main Kodi -executable (but no packaging or dependency management yet) for the following -platforms: +The current version of the buildsystem is capable of building and packaging +Kodi for the following platforms: -- Linux (GNU Makefiles) -- Windows (NMake Makefiles, Visual Studio 14 (2015)) -- OSX (GNU Makefiles, Xcode) +- Linux (GNU Makefiles, Ninja) +- Windows (NMake Makefiles, Visual Studio 14 (2015), Ninja) +- macOS and iOS (GNU Makefiles, Xcode, Ninja) - Android (GNU Makefiles) +- FreeBSD (GNU Makefiles) Before building Kodi with CMake, please ensure that you have the platform specific dependencies installed. @@ -44,12 +44,12 @@ are downloaded using `DownloadBuildDeps.bat` and `DownloadMingwBuildEnv.bat` and that the mingw libs (ffmpeg, libdvd and others) are built using `make-mingwlibs.bat`. -### OSX +### macOS -For OSX the required dependencies can be found in +For macOS the required dependencies can be found in [docs/README.osx](https://github.com/xbmc/xbmc/tree/master/docs/README.osx). -On OSX it is necessary to build the dependencies in `tools/depends` using +On macOS it is necessary to build the dependencies in `tools/depends` using `./bootstrap && ./configure --host= && make`. The other steps such as `make -C tools/depends/target/xbmc` and `make xcode_depends` are not needed as these steps are covered already by the CMake project. @@ -57,7 +57,7 @@ as these steps are covered already by the CMake project. ### Android The dependencies needed to compile for Android can be found in -[docs/README.osx](https://github.com/xbmc/xbmc/tree/master/docs/README.android) +[docs/README.android](https://github.com/xbmc/xbmc/tree/master/docs/README.android) . All described steps have to be executed (except 5.2 which is replaced by the respective CMake command below). @@ -89,6 +89,22 @@ cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) `CMAKE_BUILD_TYPE` defaults to `Release`. +#### Debian package generation +The 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`. +You should use CMake/CPack 3.6.0 or higher. Lower versions can generate the packages but package names will be mangled. + +The following optional variables (which can be passed to buildsystem when executing cmake with the -D`=` format) can be used to manipulate package type, name and version: + +- `DEBIAN_PACKAGE_TYPE` controls the name and version of generated packages. Accepted values are `stable`, `unstable` and `nightly` (default is `nightly`). +- `DEBIAN_PACKAGE_EPOCH` controls package epoch (default is `2`) +- `DEBIAN_PACKAGE_VERSION` controls package version (default is `0`) +- `DEBIAN_PACKAGE_REVISION` controls package revision (no default is set) + +Packages metadata can be changed simply by editing files present in the `cpack/deb` folder +A lot more variables are available (see cpack/CPackDebian.cmake file) but you shouldn't mess with them unless you know what you're doing. + +Generated packages can be found in /packages. + ### Raspberry Pi with GNU Makefiles ``` @@ -96,23 +112,28 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/tools/depends/target/Toolchain.cmake /project/cmake/ -cmake --build . # or: nmake -kodi.exe +cmake -G "Visual Studio 14" /project/cmake/ +cmake --build . --config "Debug" # or: Build solution with Visual Studio +Debug\kodi.exe ``` -### Windows with Visual Studio project files +#### Windows installer generation + +The script [project/Win32BuildSetup](https://github.com/xbmc/xbmc/blob/master/project/Win32BuildSetup/BuildSetup.bat) +builds an installable package for Windows. + +### Windows with NMake Makefiles ``` -cmake -G "Visual Studio 14" /project/cmake/ -cmake --build . --config "Debug" # or: Build solution with Visual Studio -set KODI_HOME="%CD%" && Debug\kodi.exe +cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release /project/cmake/ +cmake --build . # or: nmake +kodi.exe ``` -### OSX with GNU Makefiles +### macOS with GNU Makefiles ``` cmake -DCMAKE_TOOLCHAIN_FILE=/tools/depends/target/Toolchain.cmake /project/cmake/ @@ -120,12 +141,28 @@ cmake --build . -- VERBOSE=1 -j$(sysctl -n hw.ncpu) # or: make VERBOSE=1 -j$(sy ./kodi.bin ``` -### OSX with Xcode project files +### macOS with Xcode project files ``` cmake -DCMAKE_TOOLCHAIN_FILE=/tools/depends/target/Toolchain.cmake -G "Xcode" /project/cmake/ cmake --build . --config "Release" -- -verbose -jobs $(sysctl -n hw.ncpu) # or: Build solution with Xcode -KODI_HOME=$(pwd) ./Release/kodi.bin +./Release/kodi.bin +``` + +#### macOS installer generation + +Afterwards an installable DMG for macOS can be built with the following command: + +``` +cmake --build . --config "Release" --target "dmg" # or: make dmg +``` + +#### iOS package generation + +Consequently an installable DEB for iOS can be built with the following command: + +``` +make deb ``` ### Android with GNU Makefiles @@ -135,11 +172,107 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/tools/depends/target/Toolchain.cmake =/build -DKODI_BUILD_DIR= +make +``` + +It is recommended to specify the directories as absolute paths. If relative +paths are used, they are considered relative to the build directory in which +`cmake` was executed (aka the current working working directory). + +Both methods work only for already existing addons. See this +[forum thread](http://forum.kodi.tv/showthread.php?tid=219166&pid=1934922#pid1934922) +and [addons/README.md](https://github.com/xbmc/xbmc/blob/master/project/cmake/addons/README.md) +for addon development and detailed documentation about the addon build system. + +## Sanitizers + +Clang and GCC support different kinds of Sanitizers. To enable a Sanitizer call CMake with the +option `-DECM_ENABLE_SANITIZERS=’san1;san2;...'`. For more information about enabling the +Sanitizers read the documentation in +[modules/extra/ECMEnableSanitizers.cmake](https://github.com/xbmc/xbmc/tree/master/project/cmake/modules/extra/ECMEnableSanitizers.cmake). + +It is also recommended to read the sections about the Sanitizers in the [Clang +documentation](http://clang.llvm.org/docs/). ## Debugging the build 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 @@ +cmake_minimum_required(VERSION 3.1) project(kodi-addons) -if(WIN32) - # there seems to be a bug in the CMake generator implementation in CMake 2.8.x releases for WIN32 - cmake_minimum_required(VERSION 3.0) -else() - cmake_minimum_required(VERSION 2.8) -endif() - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) option(ADDON_TARBALL_CACHING "Cache downloaded addon source tarballs?" ON) @@ -31,14 +25,17 @@ endif() include(ExternalProject) ### setup all the necessary paths -if(NOT APP_ROOT AND NOT XBMCROOT) - set(APP_ROOT ${PROJECT_SOURCE_DIR}/../../..) -elseif(NOT APP_ROOT) - file(TO_CMAKE_PATH "${XBMCROOT}" APP_ROOT) +if(APP_ROOT) + set(CORE_SOURCE_DIR ${APP_ROOT}) + unset(APP_ROOT) + message(WARNING "APP_ROOT is deprecated. Please use CORE_SOURCE_DIR instead.") +endif() +if(NOT CORE_SOURCE_DIR) + set(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../..) else() - file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) + file(TO_CMAKE_PATH "${CORE_SOURCE_DIR}" CORE_SOURCE_DIR) endif() -get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) +get_filename_component(CORE_SOURCE_DIR "${CORE_SOURCE_DIR}" ABSOLUTE) if(NOT BUILD_DIR) set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") @@ -47,29 +44,29 @@ else() endif() get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) -if(NOT DEPENDS_PATH) - set(DEPENDS_PATH "${BUILD_DIR}/depends") +if(NOT ADDON_DEPENDS_PATH) + set(ADDON_DEPENDS_PATH "${BUILD_DIR}/depends") else() - file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) + file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH) endif() -get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) +get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) if(NOT PLATFORM_DIR) - set(PLATFORM_DIR ${APP_ROOT}/project/cmake/platform/${CORE_SYSTEM_NAME}) + set(PLATFORM_DIR ${CORE_SOURCE_DIR}/project/cmake/platform/${CORE_SYSTEM_NAME}) file(TO_CMAKE_PATH "${PLATFORM_DIR}" PLATFORM_DIR) endif() # make sure CMAKE_PREFIX_PATH is set if(NOT CMAKE_PREFIX_PATH) - set(CMAKE_PREFIX_PATH "${DEPENDS_PATH}") + set(CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}") else() file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) - list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}") + list(APPEND CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}") endif() # check for autoconf stuff to pass on if(AUTOCONF_FILES) - separate_arguments(AUTOCONF_FILES) + string(REPLACE " " ";" AUTOCONF_FILES ${AUTOCONF_FILES}) set(CROSS_AUTOCONF "yes") endif() @@ -80,8 +77,9 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX:PATH= - -DPACKAGE_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig - -DDEPENDS_PATH=${DEPENDS_PATH} + -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig + -DADDON_DEPENDS_PATH=${ADDON_DEPENDS_PATH} + -DOVERRIDE_PATHS=${OVERRIDE_PATHS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} @@ -108,13 +106,13 @@ if(PACKAGE_ZIP) endif() list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR}) - MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") + message(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") endif() if(CMAKE_TOOLCHAIN_FILE) list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) - MESSAGE(STATUS "Toolchain specified") - MESSAGE(STATUS ${BUILD_ARGS}) + message(STATUS "Toolchain specified") + message(STATUS ${BUILD_ARGS}) endif() if(NOT ADDONS_TO_BUILD) @@ -122,7 +120,7 @@ if(NOT ADDONS_TO_BUILD) else() string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") - separate_arguments(ADDONS_TO_BUILD) + string(REPLACE " " ";" ADDONS_TO_BUILD ${ADDONS_TO_BUILD}) endif() if(NOT ADDONS_DEFINITION_DIR) @@ -133,12 +131,14 @@ endif() get_filename_component(ADDONS_DEFINITION_DIR "${ADDONS_DEFINITION_DIR}" ABSOLUTE) if(ADDON_SRC_PREFIX) - get_filename_component(ADDON_SRC_PREFIX "${ADDON_SRC_PREFIX}" ABSOLUTE) + if(NOT IS_ABSOLUTE ${ADDON_SRC_PREFIX}) + get_filename_component(ADDON_SRC_PREFIX "${CMAKE_BINARY_DIR}/${ADDON_SRC_PREFIX}" ABSOLUTE) + endif() message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") endif() if(NOT APP_LIB_DIR) - set(APP_LIB_DIR "${DEPENDS_PATH}/lib/kodi") + set(APP_LIB_DIR "${ADDON_DEPENDS_PATH}/lib/kodi") else() file(TO_CMAKE_PATH "${APP_LIB_DIR}" APP_LIB_DIR) endif() @@ -155,7 +155,7 @@ if(EXISTS ${PLATFORM_DIR}/defines.txt) endif() # include check_target_platform() function -include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake) set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) if(NOT WIN32) @@ -164,21 +164,23 @@ if(NOT WIN32) if(NOT ${can_write} AND CMAKE_SYSTEM_NAME STREQUAL "Linux") set(NEED_SUDO TRUE) set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) - message(STATUS "NEED_SUDO: ${NEED_SUDO}") + list(APPEND BUILD_ARGS -DOVERRIDE_PATHS=ON) + message(STATUS "NEED_SUDO: ${NEED_SUDO} (no write permission for ${CMAKE_INSTALL_PREFIX})") endif() endif() ### prepare the build environment for the binary addons -# copy the prepare-env.cmake script to the depends path so that we can include it -file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${APP_LIB_DIR}) +# copy the PrepareEnv.cmake script to the depends path so that we can include it +file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake DESTINATION ${APP_LIB_DIR}) -# add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found +# add the location of PrepareEnv.cmake to CMAKE_MODULE_PATH so that it is found list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR}) -# include prepare-env.cmake which contains the logic to install the addon header bindings etc -include(prepare-env) +# include PrepareEnv.cmake which contains the logic to install the addon header bindings etc +include(PrepareEnv) ### add the depends subdirectory for any general dependencies +message(STATUS "\n-- ---- Preparing general dependencies ----") add_subdirectory(depends) # add a custom target "package-addons" which will package and install all addons @@ -198,12 +200,13 @@ if(NOT addons) file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) endif() - string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") + string(REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") # generate the bootstrap buildsystem execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) # execute the generated bootstrap buildsystem @@ -218,10 +221,14 @@ if(NOT addons) endif() endif() +# Track if at least one addon has been found. Everything else is likely an +# error either in ADDONS_TO_BUILD or in the directory configuration. +set(SUPPORTED_ADDON_FOUND FALSE) + foreach(addon ${addons}) if(NOT (addon MATCHES platforms.txt)) file(STRINGS ${addon} def) - separate_arguments(def) + string(REPLACE " " ";" def ${def}) list(GET def 0 id) set(ADDON_FOUND FALSE) @@ -236,17 +243,18 @@ foreach(addon ${addons}) endif() if(ADDON_FOUND) - get_filename_component(dir ${addon} PATH) + message(STATUS "\n-- ---- Configuring addon ${addon} ----") + set(SUPPORTED_ADDON_FOUND TRUE) + + get_filename_component(dir ${addon} DIRECTORY) # check if the addon has a platforms.txt set(platform_found FALSE) check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) - if (${platform_found}) + if(${platform_found}) # make sure the output directory is clean - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}") - file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/") - endif() + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/") # get the URL and revision of the addon list(LENGTH def deflength) @@ -324,9 +332,7 @@ foreach(addon ${addons}) endif() # remove any previously extracted version of the addon - if(EXISTS "${BUILD_DIR}/${id}") - file(REMOVE_RECURSE "${BUILD_DIR}/${id}") - endif() + file(REMOVE_RECURSE "${BUILD_DIR}/${id}") # extract the addon from the archive execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz @@ -365,7 +371,7 @@ foreach(addon ${addons}) set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) if(EXISTS ${${id}_DEPENDS_DIR}) - include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) + include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake) add_addon_depends(${id} ${${id}_DEPENDS_DIR}) if(${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "") message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}") @@ -401,16 +407,28 @@ foreach(addon ${addons}) endif() endif() endforeach() +message(STATUS "") if(NEED_SUDO) - add_custom_target(install - COMMAND ${CMAKE_COMMAND} -E echo "\n\n" - COMMAND ${CMAKE_COMMAND} -E echo "WARNING: sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n" + add_custom_target(sudo-install + COMMAND ${CMAKE_COMMAND} -E echo "sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n" COMMAND sudo ${CMAKE_COMMAND} -E copy_directory ${ADDON_INSTALL_DIR}/ ${CMAKE_INSTALL_PREFIX}/ - COMMAND sudo ${CMAKE_COMMAND} -E remove_directory ${ADDON_INSTALL_DIR}/ COMMAND sudo -k) + + foreach(_id ${ALL_ADDONS_BUILDING}) + add_dependencies(sudo-install ${_id}) + endforeach() + message(WARNING "sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}") + message(STATUS "\nplease type \"make sudo-install\"\n\n") +endif() + +if(NOT SUPPORTED_ADDON_FOUND) + message(FATAL_ERROR "${ADDONS_TO_BUILD} did not match any of the supported addons. \ + A list of supported addons can be viewed by building the 'supported_addons' target. \ + Addon definitions are loaded from ADDONS_DEFINITION_DIR (${ADDONS_DEFINITION_DIR}).") endif() # add custom target "supported_addons" that returns all addons that are supported on this platform string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}") -add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) \ No newline at end of file +add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) +add_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 - `ADDONS_DEFINITION_DIR` points to the directory containing the definitions for the addons to be built - `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. `` will be appended to this path automatically - `CMAKE_BUILD_TYPE` specifies the type of the build. This can be either *Debug* or *Release* (default is *Release*) -- `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 ``) +- `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 ``) - `CMAKE_TOOLCHAIN_FILE` can be used to pass a toolchain file into the add-on builds -- `DEPENDS_PATH` points to the directory containing the *include* and *lib* directories of the add-ons' dependencies. -- `APP_ROOT` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory) +- `ADDON_DEPENDS_PATH` points to the directory containing the *include* and *lib* directories of the add-ons' dependencies. +- `CORE_SOURCE_DIR` points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory) - `BUILD_DIR` points to the directory where the add-ons and their dependencies will be downloaded and built - `PACKAGE_ZIP=ON` means that the add-ons will be 'packaged' into a common folder, rather than being placed in `/lib/kodi/addons` and `/share/kodi/addons` - `PACKAGE_DIR` points to the directory where the ZIP archived add-ons will be stored after they have been packaged (defaults to `/zips`) - `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty) - `ADDON_TARBALL_CACHING` specifies whether downloaded add-on source tarballs should be cached or not (defaults to *ON*) +## Deprecated buildsystem variables +Buildsystem 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. +- `APP_ROOT` - Use `CORE_SOURCE_DIR` instead + ## Building The buildsystem makes some assumptions about the environment which must be met by whoever uses it: - 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 `` (in *include* and *lib* sub-directories) @@ -55,7 +59,7 @@ In case of additional options the call might look like this: cmake `` [-G ``] \ -DCMAKE_BUILD_TYPE=Release \ - -DAPP_ROOT="``" \ + -DCORE_SOURCE_DIR="``" \ -DARCH_DEFINES="-DTARGET_LINUX" \ - -DDEPENDS_PATH=`` \ + -DADDON_DEPENDS_PATH=`` \ -DCMAKE_INSTALL_PREFIX="` -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} - -P ${PROJECT_SOURCE_DIR}/bootstrap.cmake + -P ${PROJECT_SOURCE_DIR}/Bootstrap.cmake ) endfunction() @@ -61,7 +60,7 @@ set(REPOSITORY_TO_BUILD_FOUND OFF) file(GLOB repos repositories/*.txt) foreach(repo ${repos}) file(STRINGS ${repo} repo_definition) - separate_arguments(repo_definition) + string(REPLACE " " ";" repo_definition ${repo_definition}) list(GET repo_definition 0 repo_id) list(FIND REPOSITORY_TO_BUILD ${repo_id} idx) diff --git a/project/cmake/addons/bootstrap/bootstrap.cmake b/project/cmake/addons/bootstrap/bootstrap.cmake deleted file mode 100644 index 25e8aa2..0000000 --- a/project/cmake/addons/bootstrap/bootstrap.cmake +++ /dev/null @@ -1,40 +0,0 @@ -list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) - -# make sure that the installation location has been specified -if(NOT CMAKE_INSTALL_PREFIX) - message(FATAL_ERROR "CMAKE_INSTALL_PREFIX has not been specified") -endif() - -# figure out which addons to bootstrap (defaults to all) -if(NOT ADDONS_TO_BUILD) - set(ADDONS_TO_BUILD "all") -else() - string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) - message(STATUS "Bootstrapping following addons: ${ADDONS_TO_BUILD}") - separate_arguments(ADDONS_TO_BUILD) -endif() - -# find all addon definitions and go through them -file(GLOB_RECURSE ADDON_DEFINITIONS ${PROJECT_SOURCE_DIR}/*.txt) -foreach(ADDON_DEFINITION_FILE ${ADDON_DEFINITIONS}) - # ignore platforms.txt - if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt)) - # read the addon definition file - file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION) - separate_arguments(ADDON_DEFINITION) - - # extract the addon definition's identifier - list(GET ADDON_DEFINITION 0 ADDON_ID) - - # check if the addon definition should be built - list(FIND ADDONS_TO_BUILD ${ADDON_ID} ADDONS_TO_BUILD_IDX) - if(ADDONS_TO_BUILD_IDX GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") - # get the path to the addon definition directory - get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} PATH) - - # install the addon definition - message(STATUS "Bootstrapping ${ADDON_ID} addon...") - file(INSTALL ${ADDON_DEFINITION_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - endif() -endforeach() 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 @@ +cmake_minimum_required(VERSION 3.1) project(kodi-addons-depends) -cmake_minimum_required(VERSION 2.8) - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) if(NOT CMAKE_BUILD_TYPE) @@ -14,13 +13,13 @@ endif() include(ExternalProject) -if(NOT DEPENDS_PATH) - set(DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) +if(NOT ADDON_DEPENDS_PATH) + set(ADDON_DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) else() - file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) + file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH) endif() -get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) -list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_PATH}) +get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) +list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH}) if(NOT BUILD_DIR) set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") @@ -30,7 +29,7 @@ endif() get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) ## use add_addon_depends to handle the cmake based dependencies -include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake) add_addon_depends(depends "${PROJECT_SOURCE_DIR}") ## 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: builds. * CORE_SYSTEM_NAME is the name of the platform (e.g. "linux" or "android") in lower-case (defaults to lowercase(CMAKE_SYSTEM_NAME)). - * APP_ROOT points to the root directory of the project (default is the + * CORE_SOURCE_DIR points to the root directory of the project (default is the absolute representation of ../../.. starting from this directory). - * DEPENDS_PATH points to the directory where the built dependencies + * ADDON_DEPENDS_PATH points to the directory where the built dependencies (their include and library file) will be installed to. * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines (defaults to empty). @@ -56,6 +56,6 @@ In case of additional options the call might look like this cmake [-G ] \ -DCMAKE_BUILD_TYPE=Release \ - -DAPP_ROOT="" \ + -DCORE_SOURCE_DIR="" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DCMAKE_INSTALL_PREFIX="_FILE_NAME is a 3.6.0 addition +# warn if detected version is lower +if(CMAKE_VERSION VERSION_LESS 3.6) + message(WARNING "DEB Generator: CMake/CPack 3.6 or higher is needed to produce correctly named packages.") +endif() + +# distro codename +if(NOT DISTRO_CODENAME) + if(NOT LSB_RELEASE_CMD) + message(WARNING "DEB Generator: Can't find lsb_release in your path. Setting DISTRO_CODENAME to unknown.") + set(DISTRO_CODENAME unknown) + else() + execute_process(COMMAND ${LSB_RELEASE_CMD} -cs + OUTPUT_VARIABLE DISTRO_CODENAME + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() +endif() + +# package version +if(DEBIAN_PACKAGE_VERSION) + set(DISTRO_CODENAME ${DEBIAN_PACKAGE_VERSION}${DISTRO_CODENAME}) +else() + set(DISTRO_CODENAME 0${DISTRO_CODENAME}) +endif() + +# package revision +if(DEBIAN_PACKAGE_REVISION) + set(DISTRO_CODENAME ${DISTRO_CODENAME}${DEBIAN_PACKAGE_REVISION}) +endif() + +# package type +if(DEBIAN_PACKAGE_TYPE STREQUAL stable) + set(RELEASE_IDENTIFIER final) +elseif(DEBIAN_PACKAGE_TYPE STREQUAL unstable) + set(RELEASE_IDENTIFIER ${APP_VERSION_TAG_LC}) +else() + core_find_git_rev(RELEASE_IDENTIFIER) +endif() + +# package name +string(TIMESTAMP PACKAGE_TIMESTAMP "%Y%m%d.%H%M" UTC) +set(PACKAGE_NAME_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${RELEASE_IDENTIFIER}-${DISTRO_CODENAME}) +unset(RELEASE_IDENTIFIER) + +# package version +if(DEBIAN_PACKAGE_EPOCH) + set(CPACK_DEBIAN_PACKAGE_VERSION ${DEBIAN_PACKAGE_EPOCH}:${PACKAGE_NAME_VERSION}) +else() + set(CPACK_DEBIAN_PACKAGE_VERSION 2:${PACKAGE_NAME_VERSION}) +endif() + +# architecture +if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) + if(NOT DPKG_CMD) + message(WARNING "DEB Generator: Can't find dpkg in your path. Setting CPACK_DEBIAN_PACKAGE_ARCHITECTURE to i386.") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) + endif() + execute_process(COMMAND "${DPKG_CMD}" --print-architecture + OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +# package maintainer +if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) + userstamp() + set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PACKAGE_MAINTAINER}) + unset(PACKAGE_MAINTAINER) +endif() + +# package description common to all packages +if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) + file(STRINGS ${PROJECT_SOURCE_DIR}/cpack/deb/package-description.txt DESC_LINES) + foreach(LINE IN LISTS DESC_LINES) + set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION} ${LINE}\n") + endforeach() +endif() + +# package homepage +if(NOT CPACK_DEBIAN_PACKAGE_HOMEPAGE) + set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${APP_WEBSITE}) +endif() + +# generate a Debian compliant changelog +set(CHANGELOG_HEADER "${APP_NAME_LC} (${CPACK_DEBIAN_PACKAGE_VERSION}) ${DISTRO_CODENAME}\; urgency=high") +rfc2822stamp() +# two spaces between maintainer and timestamp is NOT a mistake +set(CHANGELOG_FOOTER " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${RFC2822_TIMESTAMP}") + +if(GIT_FOUND AND GZIP_CMD AND EXISTS ${CORE_SOURCE_DIR}/.git) + execute_process(COMMAND ${GIT_EXECUTABLE} log --no-merges --pretty=format:"%n [%an]%n * %s" --since="last month" + OUTPUT_VARIABLE CHANGELOG + WORKING_DIRECTORY ${CORE_SOURCE_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE) + string(REPLACE "\"" "" CHANGELOG ${CHANGELOG}) + file(WRITE ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian ${CHANGELOG_HEADER}\n${CHANGELOG}\n\n${CHANGELOG_FOOTER}) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian) + unset(CHANGELOG_HEADER) + unset(CHANGELOG_FOOTER) + unset(RFC2822_TIMESTAMP) +else() + message(WARNING "DEB Generator: Can't find git and/or gzip in your path. DEB packages will be missing changelog.Debian.gz.") +endif() + +# Generate NEWS.Debian +configure_file(${PROJECT_SOURCE_DIR}/cpack/deb/NEWS.Debian + ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian @ONLY) +if(GZIP_CMD) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian) +else() + message(WARNING "DEB Generator: Can't find gzip in your path. DEB packages will be missing NEWS.Debian.") +endif() + +# Generate man pages +configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1 COPYONLY) +configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1 COPYONLY) +configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-standalone.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1 COPYONLY) +if(ENABLE_EVENTCLIENTS) + configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-ps3remote.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1 COPYONLY) + configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-send.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1 COPYONLY) + configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-wiiremote.1 + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1 COPYONLY) +endif() + +if(GZIP_CMD) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1) + if(ENABLE_EVENTCLIENTS) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1) + execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1) + endif() +else() + message(WARNING "DEB Generator: Can't find gzip in your path. Several DEB packages will be missing man pages.") +endif() + +install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1.gz + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1.gz + ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1.gz + DESTINATION share/man/man1 + COMPONENT kodi) +if(ENABLE_EVENTCLIENTS) +install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1.gz + DESTINATION share/man/man1 + COMPONENT kodi-eventclients-ps3) +install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1.gz + DESTINATION share/man/man1 + COMPONENT kodi-eventclients-xbmc-send) +install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1.gz + DESTINATION share/man/man1 + COMPONENT kodi-eventclients-wiiremote) +endif() + +# configure package metadata files +file(GLOB DEBIAN_PACKAGE_FILES ${PROJECT_SOURCE_DIR}/cpack/deb/packages/*.txt.in) +foreach(file ${DEBIAN_PACKAGE_FILES}) + get_filename_component(package ${file} NAME_WE) + # filter eventclients so we don't have to support two more deps + # (libbluetooth-dev and libcwiid-dev) just because of wii-remote + string(SUBSTRING ${package} 0 17 PACKAGE_FILTER) + if(NOT ENABLE_EVENTCLIENTS AND PACKAGE_FILTER STREQUAL kodi-eventclients) + message(STATUS "DEB Generator: ${package} matches ${PACKAGE_FILTER}, skipping.") + # do nothing + else() + configure_file(${file} + ${CPACK_PACKAGE_DIRECTORY}/deb/${package}.txt @ONLY) + list(APPEND DEBIAN_PACKAGES ${package}) + endif() +endforeach() +unset(DEBIAN_PACKAGE_FILES) + +# generate packages +include(CMakeParseArguments) +foreach(file ${DEBIAN_PACKAGES}) + core_file_read_filtered(DEBIAN_METADATA ${CPACK_PACKAGE_DIRECTORY}/deb/${file}.txt) + string(REPLACE " " ";" DEBIAN_METADATA "${DEBIAN_METADATA}") + cmake_parse_arguments(DEB + "" + "PACKAGE_NAME;PACKAGE_ARCHITECTURE;PACKAGE_SECTION;PACKAGE_PRIORITY;PACKAGE_SHLIBDEPS" + "PACKAGE_DEPENDS;PACKAGE_RECOMMENDS;PACKAGE_SUGGESTS;PACKAGE_BREAKS;PACKAGE_REPLACES;PACKAGE_PROVIDES;PACKAGE_DESCRIPTION_HEADER;PACKAGE_DESCRIPTION_FOOTER" + ${DEBIAN_METADATA}) + string(REPLACE ";" " " DEB_PACKAGE_DEPENDS "${DEB_PACKAGE_DEPENDS}") + string(REPLACE ";" " " DEB_PACKAGE_RECOMMENDS "${DEB_PACKAGE_RECOMMENDS}") + string(REPLACE ";" " " DEB_PACKAGE_SUGGESTS "${DEB_PACKAGE_SUGGESTS}") + string(REPLACE ";" " " DEB_PACKAGE_BREAKS "${DEB_PACKAGE_BREAKS}") + string(REPLACE ";" " " DEB_PACKAGE_REPLACES "${DEB_PACKAGE_REPLACES}") + string(REPLACE ";" " " DEB_PACKAGE_PROVIDES "${DEB_PACKAGE_PROVIDES}") + string(REPLACE ";" " " DEB_PACKAGE_DESCRIPTION_HEADER "${DEB_PACKAGE_DESCRIPTION_HEADER}") + string(REPLACE ";" " " DEB_PACKAGE_DESCRIPTION_FOOTER "${DEB_PACKAGE_DESCRIPTION_FOOTER}") + + string(TOUPPER ${file} COMPONENT) + + if(NOT DEB_PACKAGE_ARCHITECTURE) + message(STATUS "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE is empty. Setting to ${CPACK_SYSTEM_NAME}.") + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE ${CPACK_SYSTEM_NAME}) + else() + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_ARCHITECTURE ${DEB_PACKAGE_ARCHITECTURE}) + endif() + + if(DEB_PACKAGE_NAME) + if(DEB_PACKAGE_ARCHITECTURE) + set(CPACK_DEBIAN_${COMPONENT}_FILE_NAME ${DEB_PACKAGE_NAME}_${PACKAGE_NAME_VERSION}_${DEB_PACKAGE_ARCHITECTURE}.deb) + else() + set(CPACK_DEBIAN_${COMPONENT}_FILE_NAME ${DEB_PACKAGE_NAME}_${PACKAGE_NAME_VERSION}_${CPACK_SYSTEM_NAME}.deb) + endif() + else() + message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_FILE_NAME is not set.") + endif() + + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SOURCE ${APP_NAME_LC}) + + if(DEB_PACKAGE_NAME) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_NAME ${DEB_PACKAGE_NAME}) + else() + message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_NAME is not set.") + endif() + + if(DEB_PACKAGE_SECTION) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SECTION ${DEB_PACKAGE_SECTION}) + else() + message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_SECTION is not set.") + endif() + + if(DEB_PACKAGE_PRIORITY) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_PRIORITY ${DEB_PACKAGE_PRIORITY}) + else() + message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_DEBIAN_${COMPONENT}_PACKAGE_PRIORITY is not set.") + endif() + + if(DEB_PACKAGE_SHLIBDEPS) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SHLIBDEPS ON) + else() + if(DEB_PACKAGE_DEPENDS) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_DEPENDS "${DEB_PACKAGE_DEPENDS}") + endif() + endif() + + if(DEB_PACKAGE_RECOMMENDS) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_RECOMMENDS "${DEB_PACKAGE_RECOMMENDS}") + endif() + + if(DEB_PACKAGE_SUGGESTS) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_SUGGESTS "${DEB_PACKAGE_SUGGESTS}") + endif() + + if(DEB_PACKAGE_BREAKS) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_BREAKS "${DEB_PACKAGE_BREAKS}") + endif() + + if(DEB_PACKAGE_REPLACES) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_REPLACES "${DEB_PACKAGE_REPLACES}") + endif() + + if(DEB_PACKAGE_PROVIDES) + set(CPACK_DEBIAN_${COMPONENT}_PACKAGE_PROVIDES "${DEB_PACKAGE_PROVIDES}") + endif() + + if(NOT DEB_PACKAGE_DESCRIPTION_HEADER OR NOT DEB_PACKAGE_DESCRIPTION_FOOTER) + message(FATAL_ERROR "DEB Generator: Mandatory variable CPACK_COMPONENT_${COMPONENT}_DESCRIPTION is not set.") + else() + set(CPACK_COMPONENT_${COMPONENT}_DESCRIPTION "\ +${DEB_PACKAGE_DESCRIPTION_HEADER}\n\ +${CPACK_DEBIAN_PACKAGE_DESCRIPTION} \ +${DEB_PACKAGE_DESCRIPTION_FOOTER}") + endif() + + install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian.gz + ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian.gz + ${PROJECT_SOURCE_DIR}/cpack/deb/copyright + DESTINATION share/doc/${file} + COMPONENT ${file}) + + # kodi package exclusive files + if(CPACK_DEBIAN_KODI_PACKAGE_NAME) + set(CPACK_DEBIAN_KODI_PACKAGE_CONTROL_EXTRA + "${PROJECT_SOURCE_DIR}/cpack/deb/postinst;${PROJECT_SOURCE_DIR}/cpack/deb/postrm") + install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/lintian/overrides/kodi + DESTINATION share/lintian/overrides + COMPONENT kodi) + install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/menu/kodi + DESTINATION share/menu + COMPONENT kodi) + endif() +endforeach() +unset(DEBIAN_PACKAGES) + +### source package generation specific variables +# source generator +set(CPACK_SOURCE_GENERATOR TGZ) + +# source package name +set(CPACK_SOURCE_PACKAGE_FILE_NAME ${APP_NAME_LC}_${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${GIT_HASH}.orig) + +# source dir +set(CMAKE_SOURCE_DIR ${CORE_SOURCE_DIR}) + +# ignore files for source package +set(CPACK_SOURCE_IGNORE_FILES + "/build/" + "/debian/" + "/.git/" + ".gitignore" + "yml$" + "~$") + +# unset variables +unset(PACKAGE_TIMESTAMP) +unset(DISTRO_CODENAME) + +# reference docs +# https://cmake.org/cmake/help/latest/module/CPack.html +# https://cmake.org/cmake/help/latest/module/CPackDeb.html +# https://cmake.org/cmake/help/latest/module/CPackComponent.html +include(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 @@ +@CPACK_PACKAGE_NAME@ (@CPACK_DEBIAN_PACKAGE_VERSION@) @DISTRO_CODENAME@; urgency=high + * Kodi Krypton (v17.0) will have an awesome new default skin, Estuary. + However the vast improvements are deep in the bowels of Kodi core code. + . + Since the beginning of XBMC back in the days while it was running on + the XBOX there was something like DVDPlayer. As the name probably + implies it was used to playback DVD discs/files. During the years this + DVDPlayer was improved and patched up to stay within modern day + standards of video playback expectancy. However it became clear that + for the future a major overhaul and rewrite was needed to keep up and + be future proof. As such the developers who did the AudioEngine in v12 + picked up this job and have now transformed it into VideoPlayer. + . + Together with some platform developers they ripped out the old + DVDPlayer code, chopped it into pieces, put it in the blender, picked + the needed pieces and put it back in without breaking the rest of Kodi. + This certainly wasn’t an easy job as DVDPlayer was like the bottom + block of a Jenga tower that needed to be replaced while still being + entangled throughout the whole tower. It had it’s tentacles in parts + of the code where it shouldn’t have been in the first place. Over a + year ago work started on getting this untangled and made ready to + be replaced by the new implementation, VideoPlayer. + + -- h.udo 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 @@ +Kodi is downloaded from http://kodi.tv/. +Orig tarballs are generated from the script located at +https://github.com/Kodi/Kodi/tree/master/project/cmake. The +orig tarball is generated using the sources in https://github.com/Kodi/Kodi. + +Main Contact: "Team-Kodi" + +Upstream Authors: + + Andreas Setterlind [Gamester17] + Staffan Lindberg [pike] + Arne Morten Kvarving [cptspiff] + Anoop Menon [d4rk] + Joakim Plate [elupus] + Jonathan Marshall [jmarshall] + Tobias Arrskog [Topfs2] + Roee Vulkan [vulkanr] + Winfried Soltys [WiSo] + Yuval Tal [yuvalt] + John W Vanderbeck [agathorn] + Trent Nelson [AlTheKiller] + Andres Mejia [ceros] + Gunnar Norin [blittan] + Dean Ross Parry [C-Quel] + Sylvain Rebaud [c0diq] + Martin van Beurden [chadoe] + Scott Davilla [davilla] + Stephan Diederich [MaestroDD] + Benjamin Bertrand [Beenje] + Benjamin Dickgiesser [DonJ] + [GeminiServer] + Christian Granqvist [Granqvist] + Dave [kraqh3d] + Luigi Capriotti [l.capriotti] + Sean [malloc] + Kyle Hill [monkeyman] + [MrC] + [nad] + [nuka1195] + Vincent Blackwell-Price [Voinage] + Robert Parris [rwparris2] + Sigurdur H. Olafsson [sho] + Alasdair Campbell [Alcoheca] + Georgy Yunaev [oldnemesis] + Chris [phi2039] + Bob [bobo1on1] + David Allonby [motd2k] + Robert Rudd [Rudd] + Eric G [Tslayer] + Amund Scharning [tut-ankh-amon] + Matthias Kortstiege [VDRfan] + Daniel Mehrwald [AreaScout] + Oumar Aziz Outtara [wattazoum] + Chris Haley [CHI3f] + [Jezz_X] + [Smokehead] + Darren [Bizzeh] + Marc [Bobbin007] + Richard [Butcher] + Jan-Willem [Darkie] + Chris Branson [forza] + [Kreet] + [Ysbox] + Erwin Beckers [Frodo] + Albert Griscti-Soler [RUNTiME] + Phil Burr [d7o3g4q] (a.k.a. Duo Egaq) + Mathias Mahling [chokemaniac] + +Credits: + +Kodi - Cross-platform Media Center + + + Copyright © 2005-2016 Team Kodi http://kodi.tv + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Generic classes for raster images + + Copyright © 2000, Juan Soulie + + Permission to use, copy, modify, distribute and sell this software or any + part thereof and/or its documentation for any purpose is granted without fee + provided that the above copyright notice and this permission notice appear + in all copies. + + This software is provided "as is" without express or implied warranty of + any kind. The author shall have no liability with respect to the + infringement of copyrights or patents that any modification to the content + of this file or this file itself may incur. + +The FreeType Project + + + Copyright © 1996-2006, by David Turner, Robert Wilhelm, and Werner Lemberg + + This file is part of the FreeType project, and may only be used, + modified, and distributed under the terms of the FreeType project + license, LICENSE.TXT. By continuing to use, modify, or distribute + this file you indicate that you have read the license and + understand and accept it fully. + + A full copy of the FreeType License (FTL) is provided under section + "Licenses". + +TinyXML - simple, small, C++ XML Parser + + + Copyright © 2000-2006 Lee Thomason (www.grinninglizard.com) + Copyright © 2005 Tyge Lovset + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +CString Class in guilib/StdString.h + + Copyright © 2002 Joseph M. O'Leary + + This code is 100% free. Use it anywhere you want. Rewrite it, restructure + it, whatever. If you can write software that makes money off of it, good for + you. I kinda like capitalism. Please don't blame me if it causes your $30 + billion dollar satellite explode in orbit. If you redistribute it in any + form, I'd appreciate it if you would leave this notice here. + +Mach-O library symbol mapping Ruby Scripts + + Copyright © 2008 Elan Feingold (elan at bluemandrill dot com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Wiimote C Library + + + Copyright © Michael Laforest < para > + < thepara (--AT--) g m a i l [--DOT--] com > + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Wiiuse Class for Kodi + + Copyright © 2009 by Cory Fields + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Apple Remote Control Wrapper Classes + + Copyright © 2006 Martin Kahr martinkahr.com. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +Class to Display events received from the Apple Infrared Remote. + + Copyright © 2006-2008 Amit Singh. All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +ISO C9x compliant stdint.h and inttypes.h for Microsoft Visual Studio + + Copyright © 2006 Alexander Chemeris + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cURL - library and command line tool for transferring files with URL syntax + + + Copyright © 1998 - 2006, Daniel Stenberg, , et al. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not + be used in advertising or otherwise to promote the sale, use or other + dealings in this Software without prior written authorization of the + copyright holder. + +RegExp.h + + Copyright © 1986, 1993, 1995 by University of Toronto. + + Permission is granted to anyone to use this software for any + purpose on any computer system, and to redistribute it in any way, + subject to the following restrictions: + + 1. The author is not responsible for the consequences of use of + this software, no matter how awful, even if they arise + from defects in it. + + 2. The origin of this software must not be misrepresented, either + by explicit claim or by omission. + + 3. Altered versions must be plainly marked as such, and must not + be misrepresented (by explicit claim or omission) as being + the original software. + + 4. This notice must not be removed or altered. + +GNU gettext - internationalization aids + + + Copyright © 1988, 1989, 1992, 1993, 1995 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +DBUSServer Class + + + Copyright © 2009 Azur Digital Networks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Really Slick X Screensavers + + + Copyright © 2002-2006 Michael Chapman + Copyright © 2002 Terence M. Welsh + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +SDLMain.h + + Copyright © Darrell Walisser + Copyright © Max Horn + + Feel free to customize this file to suit your needs. + +XKGeneral.h - General Utility and Helper function Class' Header + + Copyright © TEAM ASSEMBLY www.team-assembly.com + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Goom 2k4 + + + Copyright © 2000-2004, Jean-Christophe Hoelt + Copyright © 2000-2004, Guillaume Borios + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + iTunes Visualizer Plug-In SDK files included in Goom 2k4 are under the + following license. + + Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + + This Apple software is supplied to you by Apple Computer, Inc. in + consideration of your agreement to the following terms, and your use, + installation, modification or redistribution of this Apple software + constitutes acceptance of these terms. If you do not agree with these terms, + please do not use, install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive license, + under Apple's intellectual property rights in this Apple Software (the + "Apple Software"), to use, reproduce, modify and distribute the Apple + Software; provided that no license is granted herein under any patents that + may be infringed by your modifications, derivative works or by other works + in which the Apple Software may be incorporated. No names, trademarks, + service marks or logos of Apple Computer, Inc. may be used to endorse or + promote products derived from the Apple Software without specific prior + written permission from Apple. Except as expressly stated herein, no other + rights or licenses, express or implied, are granted by Apple and nothing + herein grants any license under any patents except claims of Apple patents + that cover this Apple Software as originally provided by Apple, and only to + the extent necessary to use and distribute this Apple Software as originally + provided by Apple. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + COMBINATION WITH ANY PRODUCT. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION + AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER + THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR + OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +XAnalyser, frequence spectrum analyser for X Window + + + Copyright © 1998 Arvin Schnell + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +XMMS - Cross-platform multimedia player + + + Copyright © 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson + and 4Front Technologies + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Pthreads-win32 - POSIX Threads Library for Win32 + + + Copyright © 1998 John E. Bossom + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program. If not, see . + +projectM - OpenGL based advanced music visualization program + + + Copyright © 2003-2007 projectM Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +GLEW - The OpenGL Extension Wrangler Library + + + Copyright © 2002-2008, Milan Ikits + Copyright © 2002-2008, Marcelo E. Magallon + Copyright © 2002, Lev Povalahev + Copyright © 1999-2007 Brian Paul + Copyright © 2007 The Khronos Group Inc. + All Rights Reserved. + + Falls under three licenses, which are the Modified BSD License, the Mesa 3-D + License (MIT License), and the Khronos License (MIT License). + + Modified BSD License + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. + + Mesa 3-D License (MIT License) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Khronos License (MIT License) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +OpenDAAP + + + Copyright © 2004 Forza (Chris Barnett) + Copyright © the authors of libOpenDAAP + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +zlib - A Massively Spiffy Yet Delicately Unobtrusive Compression Library + + + Copyright © 1995-2002 Jean-loup Gailly and Mark Adler. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +iso9660.h + + Copyright © The Joker / Avalaunch team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Neptune Portable C++ Runtime Library + + + Copyright © 2001-2006 Gilles Boccon-Gibod + Copyright © 2002-2008, Axiomatic Systems, LLC. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY AXIOMATIC SYSTEMS ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL AXIOMATIC SYSTEMS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +MMST implementation taken from the xine-mms plugin made by Major MMS +(http://geocities.com/majormms/). + + Copyright © 2005-2008 Team Kodi + Copyright © 2002 Abhijeet Phatak + Copyright © 2002 the xine project + Copyright © 2000-2001 major mms + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Ogg Bitstream Library + + + Copyright © 1994-2002 Xiph.Org Foundation http://www.xiph.org/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + This software is provided by the copyright holders and contributors “as is” + and any express or implied warranties, including, but not limited to, the + implied warranties of merchantability and fitness for a particular purpose + are disclaimed. In no event shall the foundation or contributors be liable + for any direct, indirect, incidental, special, exemplary, or consequential + damages (including, but not limited to, procurement of substitute goods or + services; loss of use, data, or profits; or business interruption) however + caused and on any theory of liability, whether in contract, strict + liability, or tort (including negligence or otherwise) arising in any way + out of the use of this software, even if advised of the possibility of such + damage. + +The Vorbis General Audio Compression Codec + + + Copyright © 2002, Xiph.org Foundation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + This software is provided by the copyright holders and contributors “as is” + and any express or implied warranties, including, but not limited to, the + implied warranties of merchantability and fitness for a particular purpose + are disclaimed. In no event shall the foundation or contributors be liable + for any direct, indirect, incidental, special, exemplary, or consequential + damages (including, but not limited to, procurement of substitute goods or + services; loss of use, data, or profits; or business interruption) however + caused and on any theory of liability, whether in contract, strict + liability, or tort (including negligence or otherwise) arising in any way + out of the use of this software, even if advised of the possibility of such + damage. + +LAME Ain't an Mp3 Encoder + + + Copyright © 1999 Mark Taylor + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +GNU libmicrohttpd + + + (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing + authors) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +libmodplug + + + Copyright 2002-2003 Kenton Varda , + Olivier Lapicque , + Colin DeVilbiss , + Markus Fick , + Adam Goode + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +Python Programming Language + + + Copyright © 2001-2008 Python Software Foundation. All rights reserved. + Copyright © 2000 BeOpen.com. All rights reserved. + Copyright © 1995-2001 Corporation for National Research Initiatives. All + rights reserved. + Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved. + + Python is distributed under the Python Software Foundation License + version 2. A copy of the license may be retrieved from + http://www.python.org/psf/license/ and is repeated below under the section + "License: PSF License for Python 2.4". + +libopendaap - library which enables applications to discover, and connect to, +iTunes music shares. + + + Copyright © 2004 David Hammerton. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +libsamplerate - audio rate conversion library + + + Copyright © 2002-2008 Erik de Castro Lopo + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +MediaMVP Media Center + + + Copyright © 2004-2006, Eric Lund, Jon Gettler, Sergio Slobodrian + http://www.mvpmc.org/ + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +MySQL + + + Copyright © 2000-2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libid3tag - ID3 tag manipulation library + + + Copyright © 2000-2004 Underbit Technologies, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Simple DirectMedia Layer + + + Copyright © 1997-2006 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +libfribidi - Free Implementation of the Unicode BiDi algorithm + + + Copyright © 1999,2000 Dov Grobgeld + Copyright © 2001,2002 Behdad Esfahbod + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +CDRip - library that provides methods for extracting data from audio CDs + + + Copyright © 1999 - 2002 Albert L. Faber + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Platinum - UPnP library + + + Copyright © 2004-2008, Plutinosoft, LLC. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +SQLite - library that implements a self-contained, serverless, +zero-configuration, transactional SQL database engine. + + + Copyright © 2004, Leo Seib, Hannover + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +CxImage - C++ image processing and conversion library + + + Copyright © 2001 - 2008, Davide Pizzolato + + Original CImage and CImageIterator implementation are: + Copyright © 1995, Alejandro Aguilar Sierra + (asierra(at)servidor(dot)unam(dot)mx) + + Covered code is provided under this license on an "as is" basis, without + warranty of any kind, either expressed or implied, including, without + limitation, warranties that the covered code is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the covered code is with you. + Should any covered code prove defective in any respect, you (not the initial + developer or any other contributor) assume the cost of any necessary + servicing, repair or correction. This disclaimer of warranty constitutes an + essential part of this license. No use of any covered code is authorized + hereunder except under this disclaimer. + + Permission is hereby granted to use, copy, modify, and distribute this + source code, or portions hereof, for any purpose, including commercial + applications, freely and without fee, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + + Portions of CxImage are under different copyright and under different + licenses. + + JasPer + Copyright © 2001-2006 Michael David Adams + Copyright © 1999-2000 Image Power, Inc. + Copyright © 1999-2000 The University of British Columbia + All Rights Reserved. + + Permission is hereby granted, free of charge, to any person (the + "User") obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + 1. The above copyright notices and this permission notice (which + includes the disclaimer below) shall be included in all copies or + substantial portions of the Software. + + 2. The name of a copyright holder shall not be used to endorse or + promote products derived from the Software without specific prior + written permission. + + THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER + THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS + "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO + EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL + INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE + PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE + THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. + EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS + BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL + PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS + GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL + SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, + AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL + SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH + THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, + PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH + RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY + EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. + + JBIG + Copyright © Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + MNG + Copyright © 2000-2007 Gerard Juyn (gerard@libmng.com) + + For the purposes of this copyright and license, "Contributing Authors" + is defined as the following set of individuals: + + Gerard Juyn + Glenn Randers-Pehrson + + The MNG Library is supplied "AS IS". The Contributing Authors + disclaim all warranties, expressed or implied, including, without + limitation, the warranties of merchantability and of fitness for any + purpose. The Contributing Authors assume no liability for direct, + indirect, incidental, special, exemplary, or consequential damages, + which may result from the use of the MNG Library, even if advised of + the possibility of such damage. + + Permission is hereby granted to use, copy, modify, and distribute this + source code, or portions hereof, for any purpose, without fee, subject + to the following restrictions: + + 1. The origin of this source code must not be misrepresented; + you must not claim that you wrote the original software. + + 2. Altered versions must be plainly marked as such and must not be + misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any source + or altered source distribution. + + The Contributing Authors specifically permit, without fee, and + encourage the use of this source code as a component to supporting + MNG and JNG file format in commercial products. If you use this + source code in a product, acknowledgment would be highly appreciated. + + JPEG + Copyright © 1994-1998, Thomas G. Lane. + + JPEG code is under the Independent JPEG Group License which can be found at + http://dev.w3.org/cvsweb/Amaya/libjpeg/Attic/README?rev=1.2 and is repeated + under the section "License: IJG License". + + TIFF + Copyright © 1988-1997 Sam Leffler + Copyright © 1991-1997 Silicon Graphics, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + + PNG + Copyright © 1998, 1999 Glenn Randers-Pehrson + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Dave Coffin's raw photo decoder + Copyright © 1997-2009 by Dave Coffin, dcoffin a cybercom o net + + Covered code is provided under this license on an "as is" basis, without + warranty of any kind, either expressed or implied, including, without + limitation, warranties that the covered code is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the covered code is with you. + Should any covered code prove defective in any respect, you (not the initial + developer or any other contributor) assume the cost of any necessary + servicing, repair or correction. This disclaimer of warranty constitutes an + essential part of this license. No use of any covered code is authorized + hereunder except under this disclaimer. + + No license is required to download and use libdcr. However, + to lawfully redistribute libdcr, you must either (a) offer, at + no extra charge, full source code for all executable files + containing RESTRICTED functions, (b) distribute this code under + the GPL Version 2 or later, (c) remove all RESTRICTED functions, + re-implement them, or copy them from an earlier, unrestricted + revision of dcraw.c, or (d) purchase a license from the author + of dcraw.c. + +PortAudio - portable cross-platform Audio API + + + Copyright © 1999-2002 Ross Bencina and Phil Burk + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + +Audioscrobbler - The Social Music Technology Playground + + + Copyright © 2003 Russell Garrett (russ-scrobbler@garrett.co.uk) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Samba - Opening Windows to a Wider World + + + Copyright © Andrew Tridgell 1998 + Copyright © Richard Sharpe 2000 + Copyright © John Terpsra 2000 + Copyright © Tom Jansen (Ninja ISD) 2002 + Copyright © Derrell Lipman 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +PCRE - Perl Compatible Regular Expressions + + + Copyright © 1997-2007 University of Cambridge + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +HDHomeRun - Networked Digital Tuner + + + Copyright © 2006-2008 Silicondust Engineering Ltd. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see + . + + As a special exception to the GNU Lesser General Public License, + you may link, statically or dynamically, an application with a + publicly distributed version of the Library to produce an + executable file containing portions of the Library, and + distribute that executable file under terms of your choice, + without any of the additional requirements listed in clause 4 of + the GNU Lesser General Public License. + + By "a publicly distributed version of the Library", we mean + either the unmodified Library as distributed by Silicondust, or a + modified version of the Library that is distributed under the + conditions defined in the GNU Lesser General Public License. + +LibASS - portable library for SSA/ASS subtitles rendering + + + Copyright © 2006 Evgeniy Stepanov + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libRTV - ReplayTV library + + Copyright © 2002 John Todd Larason + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libiconv - iconv() implementation + + + Copyright © 1999-2003 Free Software Foundation, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program. If not, see . + +Boost C++ Libraries + + + Copyright © 2001, 2002 Peter Dimov and Multi Media Ltd. + Copyright © 2007 Peter Dimov + + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +HTS Tvheadend - Combined DVB receiver, Digital Video Recorder and Showtime +streaming server for Linux. + + + Copyright © 2008 Andreas Öman + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +GNU Compact Disc Input and Control Library + + + Copyright © 2001 Herbert Valerio Riedel + Copyright © 2003, 2004, 2005 Rocky Bernstein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +SNESAPU - SNES APU emulator library + + + Copyright © 2001-2006 Alpha-II + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +Musepack Decoder Library + + + Copyright © 2005, The Musepack Development Team. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyrig + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the The Musepack Development Team nor the + names of its contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FLAC - Free Lossless Audio Codec + + Copyright © 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Gens APU from Gens + + + Copyright © 2002 by Stéphane Dallongeville + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +vgmstream - library for playback of various video game audio formats + + + Copyright © 2008-2009 Adam Gashlin, Fastelbja, Ronny Elfert + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +nosefart - NES sound format player + + + Copyright © 1998-2000 Matthew Conte (matt@conte.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +MAD - MPEG Audio Decoder + + + Copyright © 2000-2004 Underbit Technologies, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +SID Player Music Library V2 + + + Copyright © Michael Schwendt + Copyright © 2000 by Simon White + Copyright © 2001-2002 by Jarno Paananen + Copyright © 2004 Dag Lem + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Xbox ADPCM audio codec + + + Copyright © Luigi Auriemma + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +ST-Sound - general "Nostalgic" Computer Sound Emulator + + + Copyright © 1995-1999 Arnaud Carré ( http://leonard.oxg.free.fr ) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +TiMidity++ - software synthesizer + + + Copyright © 1999-2002 Masanao Izumo + Copyright © 1995 Tuukka Toivonen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +FFmpeg - complete, cross-platform solution to record, convert and stream audio +and video + + + Copyright © Fabrice Bellard + Copyright © Alex Beregszaszi + Copyright © BERO + Copyright © Mario Brito + Copyright © Ronald Bultje + Copyright © Tim Ferguson + Copyright © Brian Foley + Copyright © Arpad Gereoffy + Copyright © Philip Gladstone + Copyright © Vladimir Gneushev + Copyright © Wolfgang Hesseler + Copyright © Falk Hueffner + Copyright © Zdenek Kabelac + Copyright © Robin Kay + Copyright © Todd Kirby + Copyright © Nick Kurshev + Copyright © Mike Melanson + Copyright © Michael Niedermayer + Copyright © François Revol + Copyright © Roman Shaposhnik + Copyright © Dieter Shirley + Copyright © Juan J. Sierralta + Copyright © Ewald Snel + Copyright © Leon van Stuivenberg + Copyright © Roberto Togni + Copyright © Lionel Ulmer + + Falls under two licenses, the LGPL-2.1 and GPL-2. + + LGPL-2.1 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + GPL-2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +nuttcp - TCP/UDP network testing tool + + + Copyright © 1995-1999 WIDE Project. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the project nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +libdvdnav and libdvdread - libraries to read DVDs and navigate DVD menus + + + Copyright © 2001-2004 Rich Wareham + Copyright © 2000, 2001, 2002 H�kan Hjort + Copyright © 1998, 1999 Eric Smith + Copyright © 2001, 2002 Billy Biggs + Copyright © 2000, 2001 Martin Norb�ck + Copyright © 2000, 2001 Bj�rn Englund + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libdca - free library for decoding DTS Coherent Acoustics streams + + + Copyright © 2004 Gildas Bazin + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libspucc - library that's part of the Xine project + + + Copyright © 2000-2008 the xine project + Copyright © Christian Vogler cvogler@gradient.cis.upenn.edu - December 2001 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libmpeg2 - a free MPEG-2 video stream decoder + + + Copyright © 2000-2004 Michel Lespinasse + Copyright © 1999-2000 Aaron Holtzman + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libdvdcss - library designed for accessing encrypted DVDs + + + Copyright © 1999-2001 VideoLAN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Sample frequency change classes + + Copyright © Spoon (www.dbpoweramp.com) March 2002 dbpoweramp@dbpoweramp.com + + The code is based on original SSRC by Naoki Shibata + . + +Kodi-xrandr.c + + Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. + Copyright © 2002 Hewlett Packard Company, Inc. + Copyright © 2006 Intel Corporation + + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and + that the name of the copyright holders not be used in advertising or + publicity pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no representations + about the suitability of this software for any purpose. It is provided "as + is" without express or implied warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + +Kodi/Crc32.cpp and Kodi/Crc32.h + + Copyright (C) 2005-2009 Team Kodi + http://kodi.tv + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Portion of this code was taken from efone. + efone - Distributed internet phone system. + + (c) 1999,2000 Krzysztof Dabrowski + (c) 1999,2000 ElysiuM deeZine + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. + + based on implementation by Finn Yannick Jacobs + +guilib/AnimatedGif.cpp and guilib/AnimatedGif.h + + Copyright (c) 2000, Juan Soulie + + Permission to use, copy, modify, distribute and sell this software or any + part thereof and/or its documentation for any purpose is granted without fee + provided that the above copyright notice and this permission notice appear + in all copies. + + This software is provided "as is" without express or implied warranty of + any kind. The author shall have no liability with respect to the + infringement of copyrights or patents that any modification to the content + of this file or this file itself may incur. + +json-cpp - lightweight data-interchange format + + + Author is Baptiste Lepilleur + + The json-cpp library and this documentation are in Public Domain. + +Crystal HD + + + Copyright(c) 2006-2009 Broadcom Corporation. + + The Crystal HD library is free software: you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, version 2.1 of the License. + + The Crystal HD library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License + along with this header. If not, see . + + The Crystal HD driver is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2 of the License. + + The Crystal HD driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this driver. If not, see . + +OpenSSH + + + Copyright (c) 1995 Tatu Ylonen , Espoo, Finland + All rights reserved. + + See the section 'License: OpenSSH' for full license terms. + +Enca - Extremely Naive Charset Analyser + + + Copyright (C) 2000-2003 David Necas (Yeti) + Copyright (C) 2009 Michal Cihar + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +C-Pluff - a plug-in framework for C + + + Copyright 2007 Johannes Lehtinen + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + C-Pluff uses data structure implementations from Kazlib library. + + KazLib copyright and license + ---------------------------- + + Hash Table Data Type + List Abstract Data Type + Copyright (C) 1997 Kaz Kylheku + + Free Software License: + + All rights are reserved by the author, with the following exceptions: + Permission is granted to freely reproduce and distribute this software, + possibly in exchange for a fee, provided that this copyright notice appears + intact. Permission is also granted to adapt this software to produce + derivative works, as long as the modified versions carry this copyright + notice and additional notices stating that the work has been modified. + This source code may be translated into executable form and incorporated + into proprietary software; there is no requirement for such software to + contain a copyright notice related to this source. + +J2ME Event Client + + Copyright (c) 2008 topfs2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +OSXRemote Client + + Created by Stephan Diederich. + Copyright 2008 University Heidelberg. All rights reserved. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +HIDRemote Classes used by OSXRemote Client + + Copyright (c) 2007-2009 IOSPIRIT GmbH (http://www.iospirit.com/) + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of IOSPIRIT GmbH nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +Implementation of POSIX directory browsing functions and types for Win32. + + Copyright Kevlin Henney, 1997, 2003. All rights reserved. + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose is hereby granted without fee, provided + that this copyright and permissions notice appear in all copies and + derivatives. + + This software is supplied "as is" without express or implied warranty. + + But that said, if there are any problems please get in touch. + +Bitstream Vera Fonts + + Copyright (C) 2003 Bitstream, Inc. + All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of the fonts accompanying this license ("Fonts") and associated + documentation files (the "Font Software"), to reproduce and distribute + the Font Software, including without limitation the rights to use, copy, + merge, publish, distribute, and/or sell copies of the Font Software, and + to permit persons to whom the Font Software is furnished to do so, + subject to the following conditions: + + The above copyright and trademark notices and this permission notice + shall be included in all copies of one or more of the Font Software + typefaces. + + The Font Software may be modified, altered, or added to, and in + particular the designs of glyphs or characters in the Fonts may be + modified and additional glyphs or characters may be added to the Fonts, + only if the fonts are renamed to names not containing either the words + "Bitstream" or the word "Vera". + + This License becomes null and void to the extent applicable to Fonts or + Font Software that has been modified and is distributed under the + "Bitstream Vera" names. + + The Font Software may be sold as part of a larger software package but + no copy of one or more of the Font Software typefaces may be sold by + itself. + + THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL + BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, + OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT + SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. + + Except as contained in this notice, the names of Gnome, the Gnome + Foundation, and Bitstream Inc., shall not be used in advertising or + otherwise to promote the sale, use or other dealings in this Font + Software without prior written authorization from the Gnome Foundation + or Bitstream Inc., respectively. For further information, contact: + . + +DejaVu Fonts + + Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) + Bitstream Vera Fonts Copyright + ------------------------------ + Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is + a trademark of Bitstream, Inc. + Permission is hereby granted, free of charge, to any person obtaining a copy + of the fonts accompanying this license ("Fonts") and associated + documentation files (the "Font Software"), to reproduce and distribute the + Font Software, including without limitation the rights to use, copy, merge, + publish, distribute, and/or sell copies of the Font Software, and to permit + persons to whom the Font Software is furnished to do so, subject to the + following conditions: + The above copyright and trademark notices and this permission notice shall + be included in all copies of one or more of the Font Software typefaces. + The Font Software may be modified, altered, or added to, and in particular + the designs of glyphs or characters in the Fonts may be modified and + additional glyphs or characters may be added to the Fonts, only if the fonts + are renamed to names not containing either the words "Bitstream" or the word + "Vera". + This License becomes null and void to the extent applicable to Fonts or Font + Software that has been modified and is distributed under the "Bitstream + Vera" names. + The Font Software may be sold as part of a larger software package but no + copy of one or more of the Font Software typefaces may be sold by itself. + THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, + TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME + FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING + ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE + FONT SOFTWARE. + Except as contained in this notice, the names of Gnome, the Gnome + Foundation, and Bitstream Inc., shall not be used in advertising or + otherwise to promote the sale, use or other dealings in this Font Software + without prior written authorization from the Gnome Foundation or Bitstream + Inc., respectively. For further information, contact: fonts at gnome dot + org. + Arev Fonts Copyright + ------------------------------ + Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + Permission is hereby granted, free of charge, to any person obtaining + a copy of the fonts accompanying this license ("Fonts") and + associated documentation files (the "Font Software"), to reproduce + and distribute the modifications to the Bitstream Vera Font Software, + including without limitation the rights to use, copy, merge, publish, + distribute, and/or sell copies of the Font Software, and to permit + persons to whom the Font Software is furnished to do so, subject to + the following conditions: + The above copyright and trademark notices and this permission notice + shall be included in all copies of one or more of the Font Software + typefaces. + The Font Software may be modified, altered, or added to, and in + particular the designs of glyphs or characters in the Fonts may be + modified and additional glyphs or characters may be added to the + Fonts, only if the fonts are renamed to names not containing either + the words "Tavmjong Bah" or the word "Arev". + This License becomes null and void to the extent applicable to Fonts + or Font Software that has been modified and is distributed under the + "Tavmjong Bah Arev" names. + The Font Software may be sold as part of a larger software package but + no copy of one or more of the Font Software typefaces may be sold by + itself. + THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL + TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL + DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM + OTHER DEALINGS IN THE FONT SOFTWARE. + Except as contained in this notice, the name of Tavmjong Bah shall not + be used in advertising or otherwise to promote the sale, use or other + dealings in this Font Software without prior written authorization + from Tavmjong Bah. For further information, contact: tavmjong @ free + +SlingboxLib - Library to communicate with Slingbox devices + + + Copyright (C) 2010-2011 Stonyx + + This library is free software. You can redistribute it and/or modify it + under the terms of the GNU General Public License Version 2 (or at your + option any later version) as published by The Free Software Foundation. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +ASAP (Another Slight Atari Player) + + + Copyright (C) 2005-2009 Piotr Fusik + + ASAP is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + ASAP is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +CMyth - C library for communicating with MythTv server + + + Copyright (C) 2004-2006, Eric Lund, Jon Gettler + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +libapetag - Library for manipulating APE tags. + + + Copyright (c) 2002 Artur Polaczynski (Ar't) All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + +libbluray - Blu-ray disc playback support library + + Copyright (C) 2010, hpi1 + Copyright (C) 2010, fraxinas + Copyright (C) 2010, John Stebbins + Copyright (C) 2010, Joakim + Copyright (C) 2010, Obliter0n + Copyright (C) 2010, William Hahne + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library. If not, see . + +libexif - library to parse EXIF files + + Copyright (C) 2001-2009, Lutz Müller + Copyright (C) 2004-2009, Jan Patera + Copyright (C) 2004, Joerg Hoh + Copyright (C) 2005-2006, Hubert Figuiere + Copyright (C) 2002-2005, Hans Ulrich Niedermann + Copyright (C) 2007-2010, Dan Fandrich + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library. If not, see . + +libnfs - NFS client library + + Copyright (C) 2010-2011 Ronnie Sahlberg + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library. If not, see . + +librtmp - toolkit for RTMP streams + + Copyright (C) 2009 Andrej Stepanchuk + Copyright (C) 2009-2010 Howard Chu + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +libsquish - Open source DXT compression library + + Copyright (C) 2006 Simon Brown + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +LZO Library - LZO real-time data compression library + + Copyright (C) 1996-1997 Markus Franz Xaver Johannes Oberhumer + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Licenses: + +License: GPL + +A copy of the GPL can be found on Debian systems at +/usr/share/common-licenses/GPL. + +License: LGPL + +A copy of the LGPL can be found on Debian systems at +/usr/share/common-licenses/LGPL. + +License: FTL + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + + +--- end of FTL --- + +License: PSF License for Python 2.4 + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.2 2.1.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes + 2.2.3 2.2.2 2003 PSF yes + 2.3 2.2.2 2002-2003 PSF yes + 2.3.1 2.3 2002-2003 PSF yes + 2.3.2 2.3.1 2002-2003 PSF yes + 2.3.3 2.3.2 2002-2003 PSF yes + 2.3.4 2.3.3 2004 PSF yes + 2.3.5 2.3.4 2005 PSF yes + 2.4 2.3 2004 PSF yes + 2.4.1 2.4 2005 PSF yes + 2.4.2 2.4.1 2005 PSF yes + 2.4.3 2.4.2 2006 PSF yes + 2.4.4 2.4.3 2006 PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PSF LICENSE AGREEMENT FOR PYTHON 2.4 +------------------------------------ + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using Python 2.4 software in source or binary form and its +associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 2.4 +alone or in any derivative version, provided, however, that PSF's +License Agreement and PSF's notice of copyright, i.e., "Copyright (c) +2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved" +are retained in Python 2.4 alone or in any derivative version prepared +by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 2.4 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 2.4. + +4. PSF is making Python 2.4 available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.4 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +2.4 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.4, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python 2.4, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +-- End of PSF License for Python 2.4 -- + +License: IJG License + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, +sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. +ansi2knr.c is NOT covered by the above copyright and conditions, but instead +by the usual distribution terms of the Free Software Foundation; principally, +that you must include source code if you redistribute it. (See the file +ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part +of any program generated from the IJG code, this does not limit you more than +the foregoing paragraphs do. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltconfig, ltmain.sh). Another support script, install-sh, is copyright +by M.I.T. but is also freely distributable. + +It appears that the arithmetic coding option of the JPEG spec is covered by +patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot +legally be used without obtaining one or more licenses. For this reason, +support for arithmetic coding has been removed from the free JPEG software. +(Since arithmetic coding provides only a marginal gain over the unpatented +Huffman mode, it is unlikely that very many implementations will support it.) +So far as we are aware, there are no patent restrictions on the remaining +code. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +-- End of IJG License -- + +License: OpenSSH + +This file is part of the OpenSSH software. + +The licences which components of this software fall under are as +follows. First, we will summarize and say that all components +are under a BSD licence, or a licence more free than that. + +OpenSSH contains no GPL code. + +1) + * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland + * All rights reserved + * + * As far as I am concerned, the code I have written for this software + * can be used freely for any purpose. Any derived versions of this + * software must be clearly marked as such, and if the derived work is + * incompatible with the protocol description in the RFC file, it must be + * called by a name other than "ssh" or "Secure Shell". + + [Tatu continues] + * However, I am not implying to give any licenses to any patents or + * copyrights held by third parties, and the software includes parts that + * are not under my direct control. As far as I know, all included + * source code is used in accordance with the relevant license agreements + * and can be used freely for any purpose (the GNU license being the most + * restrictive); see below for details. + + [However, none of that term is relevant at this point in time. All of + these restrictively licenced software components which he talks about + have been removed from OpenSSH, i.e., + + - RSA is no longer included, found in the OpenSSL library + - IDEA is no longer included, its use is deprecated + - DES is now external, in the OpenSSL library + - GMP is no longer used, and instead we call BN code from OpenSSL + - Zlib is now external, in a library + - The make-ssh-known-hosts script is no longer included + - TSS has been removed + - MD5 is now external, in the OpenSSL library + - RC4 support has been replaced with ARC4 support from OpenSSL + - Blowfish is now external, in the OpenSSL library + + [The licence continues] + + Note that any information and cryptographic algorithms used in this + software are publicly available on the Internet and at any major + bookstore, scientific library, and patent office worldwide. More + information can be found e.g. at "http://www.cs.hut.fi/crypto". + + The legal status of this program is some combination of all these + permissions and restrictions. Use only at your own responsibility. + You will be responsible for any legal consequences yourself; I am not + making any claims whether possessing or using this is legal or not in + your country, and I am not taking any responsibility on your behalf. + + + NO WARRANTY + + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + +2) + The 32-bit CRC compensation attack detector in deattack.c was + contributed by CORE SDI S.A. under a BSD-style license. + + * Cryptographic attack detector for ssh - source code + * + * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina. + * + * All rights reserved. Redistribution and use in source and binary + * forms, with or without modification, are permitted provided that + * this copyright notice is retained. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR + * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS + * SOFTWARE. + * + * Ariel Futoransky + * + +3) + ssh-keyscan was contributed by David Mazieres under a BSD-style + license. + + * Copyright 1995, 1996 by David Mazieres . + * + * Modification and redistribution in source and binary forms is + * permitted provided that due credit is given to the author and the + * OpenBSD project by leaving this copyright notice intact. + +4) + The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers + and Paulo Barreto is in the public domain and distributed + with the following license: + + * @version 3.0 (December 2000) + * + * Optimised ANSI C code for the Rijndael cipher (now AES) + * + * @author Vincent Rijmen + * @author Antoon Bosselaers + * @author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +5) + One component of the ssh source code is under a 3-clause BSD license, + held by the University of California, since we pulled these parts from + original Berkeley code. + + * Copyright (c) 1983, 1990, 1992, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + +6) + Remaining components of the software are provided under a standard + 2-term BSD licence with the following names as copyright holders: + + Markus Friedl + Theo de Raadt + Niels Provos + Dug Song + Aaron Campbell + Damien Miller + Kevin Steves + Daniel Kouril + Wesley Griffin + Per Allansson + Nils Nordman + Simon Wilkinson + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-- 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 @@ +?package(kodi):needs="X11" section="Applications/Video" \ + 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 @@ +Kodi, formerly known as XBMC Media Center, is an award winning free and open +source software media-player and entertainment hub for all your digital media. +Kodi is available for Linux, Mac OS X (Leopard, Tiger and Apple TV) and +Microsoft Windows, as well as the original Xbox game console. Created in 2003 +by a group of like minded programmers, Kodi is a non-profit project run and +developed by volunteers located around the world. More than 50 software +developers have contributed to Kodi, and 100-plus translators have worked to +expand its reach, making it available in more than 30 languages. +. +While Kodi functions very well as a standard media player application for your +computer, it has been designed to be the perfect companion for your HTPC. +Supporting an almost endless range of remote controls, and combined with its +beautiful interface and powerful skinning engine, Kodi feels very natural to +use from the couch and is the ideal solution for your home theater. Once +installed, your computer will become a fully functional multimedia jukebox. +. \ 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 @@ +# kodi-addon-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-addon-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS +PACKAGE_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 +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-addon-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (general add-on dev package) +PACKAGE_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 @@ +# kodi-audio-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-audio-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-audio-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (audio add-ons dev package) +PACKAGE_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 @@ +# kodi-bin debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-bin +PACKAGE_ARCHITECTURE +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_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) +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS xbmc-bin (<< 2:14.0~git20141019), xbmc-common +PACKAGE_REPLACES xbmc-bin (<< 2:14.0~git20141019), xbmc-common +PACKAGE_PROVIDES @APP_NAME_LC@-bin, @APP_NAME_LC@-common, xbmc-bin, xbmc-common +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (binary data package) +PACKAGE_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 @@ +# kodi-eventclients-common debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-common +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-eventclients-common +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (event client common package) +PACKAGE_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 @@ +# kodi-eventclients-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@) +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-eventclients-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (event client dev package) +PACKAGE_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 @@ +# kodi-eventclients-ps3 debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-ps3 +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@), python-bluez | python-lightblue +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-eventclients-ps3 +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (PS3 event client package) +PACKAGE_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 @@ +# kodi-eventclients-wiiremote debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-wiiremote +PACKAGE_ARCHITECTURE +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_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) +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-eventclients-wiiremote +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (Wii Remote event client package) +PACKAGE_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 @@ +# kodi-eventclients-xbmc-send debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-eventclients-xbmc-send +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-eventclients-common (= @CPACK_DEBIAN_PACKAGE_VERSION@) +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-eventclients-xbmc-send +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (@APP_NAME@-send event client package) +PACKAGE_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 @@ +# kodi-inputstream-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-inputstream-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-inputstream-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (inputstream add-ons dev package) +PACKAGE_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 @@ +# kodi-peripheral-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-peripheral-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (peripheral add-ons dev package) +PACKAGE_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 @@ +# kodi-pvr-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-pvr-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-pvr-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (PVR add-ons dev package) +PACKAGE_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 @@ +# kodi-screensaver-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-screensaver-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-screensaver-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (screensaver add-ons dev package) +PACKAGE_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 @@ +# kodi-tools-texturepacker debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-tools-texturepacker +PACKAGE_ARCHITECTURE +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (skin development - TexturePacker tool) +PACKAGE_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 @@ +# kodi-visualization-dev debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@-visualization-dev +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION libdevel +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_DEPENDS @APP_NAME_LC@-addon-dev +PACKAGE_RECOMMENDS +PACKAGE_SUGGESTS +PACKAGE_BREAKS +PACKAGE_REPLACES +PACKAGE_PROVIDES xbmc-visualization-dev +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (visualization add-ons dev package) +PACKAGE_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 @@ +# kodi debian package metadata +# +# Setting PACKAGE_SHLIBDEPS to 'ON' will cause CPack to ignore PACKAGE_DEPENDS +# content and use dpkg-shlibdeps to automatically generate the package dependency +# list. Only useful for packages that contain binaries. +# +# PACKAGE_ARCHITECTURE should be set to 'all' only if package contains +# architecture agnostic data. CPack will set proper architecture (amd64/i386/etc) +# based on build options. +# +# Remaining settings are (hopefully) self-explanatory. + +PACKAGE_NAME @APP_NAME_LC@ +PACKAGE_ARCHITECTURE all +PACKAGE_SECTION video +PACKAGE_PRIORITY optional +PACKAGE_SHLIBDEPS +PACKAGE_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 +PACKAGE_RECOMMENDS libvdpau1, libva-intel-vaapi-driver, libva1 +PACKAGE_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 +PACKAGE_BREAKS xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone +PACKAGE_REPLACES xbmc (<< 2:14.0~git20141019), xbmc-data, xbmc-standalone +PACKAGE_PROVIDES @APP_NAME_LC@-data, @APP_NAME_LC@-skin-estuary, @APP_NAME_LC@-standalone, xbmc, xbmc-data, xbmc-standalone +PACKAGE_DESCRIPTION_HEADER @APP_NAME@ Media Center (arch-independent data package) +PACKAGE_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 @@ +#!/bin/sh +set -e +if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then + update-menus +fi 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 @@ +#!/bin/sh +set -e +if [ -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 @@ -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h -xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h -xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h -xbmc/cores/AudioEngine/Utils/AEChannelData.h -xbmc/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 @@ -project/cmake/scripts/common/addon-helpers.cmake -project/cmake/scripts/common/addoptions.cmake -project/cmake/scripts/common/archsetup.cmake -project/cmake/scripts/common/checkcommits.cmake -project/cmake/scripts/common/check_target_platform.cmake -project/cmake/scripts/common/generateversionedfiles.cmake -project/cmake/scripts/common/generatorsetup.cmake -project/cmake/scripts/common/handle-depends.cmake -project/cmake/scripts/common/macros.cmake -project/cmake/scripts/common/managestring.cmake -project/cmake/scripts/common/pathsetup.cmake -project/cmake/scripts/common/prepare-env.cmake -project/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 @@ addons/audioencoder.xbmc.builtin.aac/* +addons/audioencoder.xbmc.builtin.wav/* addons/audioencoder.xbmc.builtin.wma/* addons/game.controller.default/* addons/kodi.adsp/* @@ -31,15 +32,10 @@ addons/screensaver.xbmc.builtin.dim/* addons/screensaver.xbmc.builtin.black/* addons/script.module.pil/* addons/script.module.pysqlite/* -addons/audioencoder.xbmc.builtin.aac/* -addons/audioencoder.xbmc.builtin.wav/* -addons/audioencoder.xbmc.builtin.wma/* addons/resource.language.en_gb/* -addons/resource.uisounds.confluence/* +addons/resource.uisounds.kodi/* addons/resource.images.weathericons.default/* addons/service.xbmc.versioncheck/* -addons/skin.estuary/* -addons/skin.estouchy/* addons/metadata.local/* addons/metadata.album.universal/* addons/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 @@ -tools/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 @@ +LICENSE.gpl +privacy-policy.txt +xbmc/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 @@ +tools/darwin/runtime/preflight +tools/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 @@ +LICENSE.gpl +privacy-policy.txt +xbmc/platform/darwin/Credits.html +tools/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 @@ +tools/darwin/runtime/preflight +tools/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 @@ -system/*.dll -system/airplay/*.dll -system/cdrip/*.dll -system/players/dvdplayer/*.dll -system/players/paplayer/*.dll -system/players/VideoPlayer/*.dll +system/*.dll . +project/Win32BuildSetup/dependencies/python27.dll . \ No newline at end of file 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 @@ -SET(APP_NAME @APP_NAME@) -SET(APP_NAME_LC @APP_NAME_LC@) -SET(APP_NAME_UC @APP_NAME_UC@) -SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) -SET(APP_VERSION_MINOR @APP_VERSION_MINOR@) -IF(NOT @APP_NAME_UC@_PREFIX) - SET(@APP_NAME_UC@_PREFIX @APP_PREFIX@) -ENDIF() -IF(NOT @APP_NAME_UC@_INCLUDE_DIR) - SET(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@) -ENDIF() -IF(NOT @APP_NAME_UC@_LIB_DIR) - SET(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@) -ENDIF() -IF(NOT WIN32) - SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") -ENDIF() -LIST(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@) -ADD_DEFINITIONS(@ARCH_DEFINES@ -DBUILD_KODI_ADDON) - -if(NOT CORE_SYSTEM_NAME) - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(CORE_SYSTEM_NAME "osx") - else() - string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) - endif() -endif() - -include(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 @@ -# - Try to find ASS -# Once done this will define +#.rst: +# FindASS +# ------- +# Finds the ASS library # -# ASS_FOUND - system has libass -# ASS_INCLUDE_DIRS - the libass include directory -# ASS_LIBRARIES - The libass libraries +# This will will define the following variables:: +# +# ASS_FOUND - system has ASS +# ASS_INCLUDE_DIRS - the ASS include directory +# ASS_LIBRARIES - the ASS libraries +# +# and the following imported targets:: +# +# ASS::ASS - The ASS library if(PKG_CONFIG_FOUND) - pkg_check_modules (ASS libass) -else() - find_path(ASS_INCLUDE_DIRS ass/ass.h) - find_library(ASS_LIBRARIES NAMES ass libass) + pkg_check_modules(PC_ASS libass QUIET) endif() +find_path(ASS_INCLUDE_DIR NAMES ass/ass.h + PATHS ${PC_ASS_INCLUDEDIR}) +find_library(ASS_LIBRARY NAMES ass libass + PATHS ${PC_ASS_LIBDIR}) + +set(ASS_VERSION ${PC_ASS_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ASS DEFAULT_MSG ASS_INCLUDE_DIRS ASS_LIBRARIES) +find_package_handle_standard_args(ASS + REQUIRED_VARS ASS_LIBRARY ASS_INCLUDE_DIR + VERSION_VAR ASS_VERSION) + +if(ASS_FOUND) + set(ASS_LIBRARIES ${ASS_LIBRARY}) + set(ASS_INCLUDE_DIRS ${ASS_INCLUDE_DIR}) + + if(NOT TARGET ASS::ASS) + add_library(ASS::ASS UNKNOWN IMPORTED) + set_target_properties(ASS::ASS PROPERTIES + IMPORTED_LOCATION "${ASS_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${ASS_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(ASS_INCLUDE_DIRS ASS_LIBRARIES) +mark_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 @@ -# - Try to find ALSA -# Once done this will define +#.rst: +# FindAlsa +# -------- +# Finds the Alsa library # -# ALSA_FOUND - system has libALSA -# ALSA_INCLUDE_DIRS - the libALSA include directory -# ALSA_LIBRARIES - The libALSA libraries +# This will will define the following variables:: +# +# ALSA_FOUND - system has Alsa +# ALSA_INCLUDE_DIRS - the Alsa include directory +# ALSA_LIBRARIES - the Alsa libraries +# ALSA_DEFINITIONS - the Alsa compile definitions +# +# and the following imported targets:: +# +# ALSA::ALSA - The Alsa library if(PKG_CONFIG_FOUND) - pkg_check_modules (ALSA alsa) -else() - find_path(ALSA_INCLUDE_DIRS asoundlib.h PATH_SUFFIXES alsa) - find_library(ALSA_LIBRARIES asound) + pkg_check_modules(PC_ALSA alsa QUIET) endif() +find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h + PATHS ${PC_ALSA_INCLUDEDIR}) +find_library(ALSA_LIBRARY NAMES asound + PATHS ${PC_ALSA_LIBDIR}) + +set(ALSA_VERSION ${PC_ALSA_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Alsa DEFAULT_MSG ALSA_INCLUDE_DIRS ALSA_LIBRARIES) +find_package_handle_standard_args(ALSA + REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR + VERSION_VAR ALSA_VERSION) + +if(ALSA_FOUND) + set(ALSA_INCLUDE_DIRS "") # Don't want these added as 'timer.h' is a dangerous file + set(ALSA_LIBRARIES ${ALSA_LIBRARY}) + set(ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1) + + if(NOT TARGET ALSA::ALSA) + add_library(ALSA::ALSA UNKNOWN IMPORTED) + set_target_properties(ALSA::ALSA PROPERTIES + IMPORTED_LOCATION "${ALSA_LIBRARY}" + INTERFACE_COMPILE_DEFINITIONS "${ALSA_DEFINITIONS}") + endif() +endif() -set(ALSA_INCLUDE_DIRS "") # Dont want these added as 'timer.h' is a dangerous file -mark_as_advanced(ALSA_INCLUDE_DIRS ALSA_LIBRARIES) -list(APPEND ALSA_DEFINITIONS -DHAVE_ALSA=1 -DUSE_ALSA=1) +mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY) 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 @@ -# - Try to find avahi -# Once done this will define +#.rst: +# FindAvahi +# --------- +# Finds the avahi library +# +# This will will define the following variables:: # # AVAHI_FOUND - system has avahi # AVAHI_INCLUDE_DIRS - the avahi include directory -# AVAHI_LIBRARIES - The avahi libraries +# AVAHI_LIBRARIES - the avahi libraries +# AVAHI_DEFINITIONS - the avahi definitions +# +# and the following imported targets:: +# +# Avahi::Avahi - The avahi library if(PKG_CONFIG_FOUND) - pkg_check_modules (AVAHI avahi-client) - list(APPEND AVAHI_INCLUDE_DIRS ${AVAHI_INCLUDEDIR}) -else() - find_path(AVAHI_CLIENT_INCLUDE_DIRS avahi-client/client.h) - find_path(AVAHI_COMMON_INCLUDE_DIRS avahi-common/defs.h) - find_library(AVAHI_COMMON_LIBRARIES avahi-common) - find_library(AVAHI_CLIENT_LIBRARIES avahi-common) - set(AVAHI_INCLUDE_DIRS ${AVAHI_CLIENT_INCLUDE_DIRS} - ${AVAHI_COMMON_INCLUDE_DIRS}) - set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARIES} - ${AVAHI_COMMON_LIBRARIES}) + pkg_check_modules(PC_AVAHI avahi-client QUIET) endif() +find_path(AVAHI_CLIENT_INCLUDE_DIR NAMES avahi-client/client.h + PATHS ${PC_AVAHI_INCLUDEDIR}) +find_path(AVAHI_COMMON_INCLUDE_DIR NAMES avahi-common/defs.h + PATHS ${PC_AVAHI_INCLUDEDIR}) +find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client + PATHS ${PC_AVAHI_LIBDIR}) +find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common + PATHS ${PC_AVAHI_LIBDIR}) + +set(AVAHI_VERSION ${PC_AVAHI_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Avahi DEFAULT_MSG AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES) +find_package_handle_standard_args(Avahi + REQUIRED_VARS AVAHI_CLIENT_LIBRARY AVAHI_COMMON_LIBRARY + AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR + VERSION_VAR AVAHI_VERSION) + +if(AVAHI_FOUND) + set(AVAHI_INCLUDE_DIRS ${AVAHI_CLIENT_INCLUDE_DIR} + ${AVAHI_COMMON_INCLUDE_DIR}) + set(AVAHI_LIBRARIES ${AVAHI_CLIENT_LIBRARY} + ${AVAHI_COMMON_LIBRARY}) + set(AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_CLIENT=1 -DHAVE_LIBAVAHI_COMMON=1) + + if(NOT TARGET Avahi::Avahi) + add_library(Avahi::Avahi UNKNOWN IMPORTED) + set_target_properties(Avahi::Avahi PROPERTIES + IMPORTED_LOCATION "${AVAHI_CLIENT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_CLIENT_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_CLIENT=1) + endif() + if(NOT TARGET Avahi::AvahiCommon) + add_library(Avahi::AvahiCommon UNKNOWN IMPORTED) + set_target_properties(Avahi::AvahiCommon PROPERTIES + IMPORTED_LOCATION "${AVAHI_COMMON_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${AVAHI_COMMON_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBAVAHI_COMMON=1 + INTERFACE_LINK_LIBRARIES Avahi::Avahi) + endif() +endif() -mark_as_advanced(AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES) -list(APPEND AVAHI_DEFINITIONS -DHAVE_LIBAVAHI_COMMON=1 -DHAVE_LIBAVAHI_CLIENT=1) +mark_as_advanced(AVAHI_CLIENT_INCLUDE_DIR AVAHI_COMMON_INCLUDE_DIR + 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 @@ +#.rst: +# FindBluetooth +# --------- +# Finds the Bluetooth library +# +# This will will define the following variables:: +# +# BLUETOOTH_FOUND - system has Bluetooth +# BLUETOOTH_INCLUDE_DIRS - the Bluetooth include directory +# BLUETOOTH_LIBRARIES - the Bluetooth libraries +# +# and the following imported targets:: +# +# Bluetooth::Bluetooth - The Bluetooth library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_BLUETOOTH bluetooth QUIET) +endif() + +find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h + PATHS ${PC_BLUETOOTH_INCLUDEDIR}) +find_library(BLUETOOTH_LIBRARY NAMES bluetooth + PATHS ${PC_BLUETOOTH_LIBDIR}) + +set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Bluetooth + REQUIRED_VARS BLUETOOTH_LIBRARY BLUETOOTH_INCLUDE_DIR + VERSION_VAR ${BLUETOOTH_VERSION}) + +if(BLUETOOTH_FOUND) + set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR}) + set(BLUETOOTH_LIBRARIES ${BLUETOOTH_LIBRARY}) + + if(NOT TARGET Bluetooth::Bluetooth) + add_library(Bluetooth::Bluetooth UNKNOWN IMPORTED) + set_target_properties(Bluetooth::Bluetooth PROPERTIES + IMPORTED_LOCATION "${BLUETOOTH_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${BLUETOOTH_INCLUDE_DIR}") + endif() +endif() + +mark_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 @@ # Bluray::Bluray - The libblueray library if(PKG_CONFIG_FOUND) - pkg_check_modules(BLURAY libbluray>=0.7.0) - set(BLURAY_VERSION ${PC_BLURAY_VERSION}) + pkg_check_modules(PC_BLURAY libbluray>=0.7.0 QUIET) +endif() + +find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h + PATHS ${PC_BLURAY_INCLUDEDIR}) + +set(BLURAY_VERSION ${PC_BLURAY_VERSION}) + +include(FindPackageHandleStandardArgs) +if(NOT WIN32) + find_library(BLURAY_LIBRARY NAMES bluray + PATHS ${PC_BLURAY_LIBDIR}) + + find_package_handle_standard_args(Bluray + REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR + VERSION_VAR BLURAY_VERSION) else() - find_path(BLURAY_INCLUDE_DIR libbluray/bluray.h - PATHS ${PC_BLURAY_INCLUDEDIR}) - - include(FindPackageHandleStandardArgs) - if(NOT WIN32) - find_library(BLURAY_LIBRARY NAMES bluray - PATHS ${PC_BLURAY_LIBDIR}) - - find_package_handle_standard_args(BLURAY - REQUIRED_VARS BLURAY_LIBRARY BLURAY_INCLUDE_DIR - VERSION_VAR BLURAY_VERSION) - else() - # Dynamically loaded DLL - find_package_handle_standard_args(BLURAY - REQUIRED_VARS BLURAY_INCLUDE_DIR - VERSION_VAR BLURAY_VERSION) - endif() + # Dynamically loaded DLL + find_package_handle_standard_args(Bluray + REQUIRED_VARS BLURAY_INCLUDE_DIR + VERSION_VAR BLURAY_VERSION) endif() if(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 @@ -find_program(CCACHE_FOUND ccache) -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif(CCACHE_FOUND) +#.rst: +# FindCCache +# ---------- +# Finds ccache and sets it up as compiler wrapper. +# This should ideally be called before the call to project(). +# +# See: https://crascit.com/2016/04/09/using-ccache-with-cmake/ + +find_program(CCACHE_PROGRAM ccache) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CCACHE REQUIRED_VARS CCACHE_PROGRAM) + +if(CCACHE_FOUND) + # Supports Unix Makefiles and Ninja + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}") +endif() 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 @@ # CEC::CEC - The libCEC library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_CEC libCEC>=3.0.0 QUIET) + pkg_check_modules(PC_CEC libcec QUIET) endif() -find_path(CEC_INCLUDE_DIR libCEC/CEC.h +find_path(CEC_INCLUDE_DIR NAMES libcec/cec.h libCEC/CEC.h PATHS ${PC_CEC_INCLUDEDIR}) -set(CEC_VERSION ${PC_CEC_VERSION}) +if(PC_CEC_VERSION) + set(CEC_VERSION ${PC_CEC_VERSION}) +elseif(CEC_INCLUDE_DIR AND EXISTS "${CEC_INCLUDE_DIR}/libcec/version.h") + file(STRINGS "${CEC_INCLUDE_DIR}/libcec/version.h" cec_version_str REGEX "^[\t ]+LIBCEC_VERSION_TO_UINT\\(.*\\)") + string(REGEX REPLACE "^[\t ]+LIBCEC_VERSION_TO_UINT\\(([0-9]+), ([0-9]+), ([0-9]+)\\)" "\\1.\\2.\\3" CEC_VERSION "${cec_version_str}") + unset(cec_version_str) +endif() + +if(NOT CEC_FIND_VERSION) + set(CEC_FIND_VERSION 4.0.0) +endif() include(FindPackageHandleStandardArgs) if(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 @@ +#.rst: +# FindCWiid +# --------- +# Finds the CWiid library +# +# This will will define the following variables:: +# +# CWIID_FOUND - system has CWiid +# CWIID_INCLUDE_DIRS - the CWiid include directory +# CWIID_LIBRARIES - the CWiid libraries +# +# and the following imported targets:: +# +# CWiid::CWiid - The CWiid library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_CWIID cwiid QUIET) +endif() + +find_path(CWIID_INCLUDE_DIR NAMES cwiid.h + PATHS ${PC_CWIID_INCLUDEDIR}) +find_library(CWIID_LIBRARY NAMES cwiid + PATHS ${PC_CWIID_LIBDIR}) + +set(CWIID_VERSION ${PC_CWIID_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CWIID + REQUIRED_VARS CWIID_LIBRARY CWIID_INCLUDE_DIR + VERSION_VAR CWIID_VERSION) + +if(CWIID_FOUND) + set(CWIID_INCLUDE_DIRS ${CWIID_INCLUDE_DIR}) + set(CWIID_LIBRARIES ${CWIID_LIBRARY}) + + if(NOT TARGET CWiid::CWiid) + add_library(CWiid::CWiid UNKNOWN IMPORTED) + set_target_properties(CWiid::CWiid PROPERTIES + IMPORTED_LOCATION "${CWIID_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CWIID_INCLUDE_DIR}") + endif() +endif() + +mark_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() if(CXX_FLAG_CXX0X) add_options (CXX ALL_BUILDS "-std=c++0x") set(CXX_STD11_FLAGS "-std=c++0x") - endif(CXX_FLAG_CXX0X) -endif(CXX_FLAG_CXX11) + endif() +endif() include(FindPackageHandleStandardArgs) find_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 @@ -# - Try to find cdio -# Once done this will define +#.rst: +# FindCdio +# -------- +# Finds the cdio library # -# CDIO_FOUND - system has libcdio -# CDIO_INCLUDE_DIRS - the libcdio include directory -# CDIO_LIBRARIES - The libcdio libraries +# This will will define the following variables:: +# +# CDIO_FOUND - system has cdio +# CDIO_INCLUDE_DIRS - the cdio include directory +# CDIO_LIBRARIES - the cdio libraries +# +# and the following imported targets:: +# +# CDIO::CDIO - The cdio library if(PKG_CONFIG_FOUND) - pkg_check_modules (CDIO libcdio libiso9660) - list(APPEND CDIO_INCLUDE_DIRS ${CDIO_libcdio_INCLUDEDIR} ${CDIO_libiso9660_INCLUDEDIR}) -endif() -if(NOT CDIO_FOUND) - find_path(CDIO_INCLUDE_DIRS cdio/cdio.h) - find_library(MODPLUG_LIBRARIES NAMES cdio) + pkg_check_modules(PC_CDIO libcdio libiso9660 QUIET) endif() +find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h + PATHS ${PC_CDIO_libcdio_INCLUDEDIR} + ${PC_CDIO_libiso9660_INCLUDEDIR}) +find_library(CDIO_LIBRARY NAMES cdio + PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR}) + +set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Cdio DEFAULT_MSG CDIO_INCLUDE_DIRS CDIO_LIBRARIES) +find_package_handle_standard_args(CDIO + REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR + VERSION_VAR CDIO_VERSION) + +if(CDIO_FOUND) + set(CDIO_LIBRARIES ${CDIO_LIBRARY}) + set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR}) + + if(NOT TARGET CDIO::CDIO) + add_library(CDIO::CDIO UNKNOWN IMPORTED) + set_target_properties(CDIO::CDIO PROPERTIES + IMPORTED_LOCATION "${CDIO_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CDIO_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(CDIO_INCLUDE_DIRS CDIO_LIBRARIES) +mark_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 @@ if(NOT WIN32) string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") - get_filename_component(expat_dir ${EXPAT_LIBRARY} PATH) + get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) set(ldflags "-L${expat_dir}") ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff BUILD_IN_SOURCE 1 PREFIX ${CORE_BUILD_DIR}/cpluff - PATCH_COMMAND rm -f config.status - UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CORE_SOURCE_DIR}/lib/cpluff/configure --disable-nls --enable-static --disable-shared --with-pic --prefix= + --libdir=/lib --host=${ARCH} CFLAGS=${defines} - LDFLAGS=${ldflags} - BUILD_COMMAND make V=1) + LDFLAGS=${ldflags}) + ExternalProject_Add_Step(libcpluff autoreconf + DEPENDEES download update patch + DEPENDERS configure + COMMAND rm -f config.status + COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif + WORKING_DIRECTORY ) + set(ldflags "${ldflags};-lexpat") core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a system/libcpluff libcpluff extras "${ldflags}") - set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) + set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) + set(CPLUFF_FOUND 1) + mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) else() - ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff - PREFIX ${CORE_BUILD_DIR}/cpluff - CONFIGURE_COMMAND "" - # TODO: Building the project directly from lib/cpluff/libcpluff/win32/cpluff.vcxproj - # fails becaue it imports XBMC.defaults.props - BUILD_COMMAND msbuild ${CORE_SOURCE_DIR}/project/VS2010Express/XBMC\ for\ Windows.sln - /t:cpluff /p:Configuration=${CORE_BUILD_CONFIG} - INSTALL_COMMAND "") -endif() + find_path(CPLUFF_INCLUDE_DIR cpluff.h) -set(CPLUFF_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/include) -set(CPLUFF_FOUND 1) -mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(CPLUFF + REQUIRED_VARS CPLUFF_INCLUDE_DIR) + + if(CPLUFF_FOUND) + set(CPLUFF_INCLUDE_DIRS ${CPLUFF_INCLUDE_DIR}) + endif() + mark_as_advanced(CPLUFF_INCLUDE_DIRS CPLUFF_FOUND) + + add_custom_target(libcpluff) +endif() +set_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) list(GET CGUID_VER 0 CGUID_VER) string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER) + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(CROSSGUID_URL) + get_filename_component(CROSSGUID_URL "${CROSSGUID_URL}" ABSOLUTE) + else() + set(CROSSGUID_URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}") + endif() + + set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) + set(CROSSGUID_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) externalproject_add(crossguid - URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz + URL ${CROSSGUID_URL} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download PREFIX ${CORE_BUILD_DIR}/crossguid CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} @@ -18,17 +32,19 @@ if(ENABLE_INTERNAL_CROSSGUID) && ${CMAKE_COMMAND} -E copy ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake - ) - - set(CROSSGUID_FOUND 1) - set(CROSSGUID_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) - set(CROSSGUID_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) + + BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) + set_target_properties(crossguid PROPERTIES FOLDER "External Projects") include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(CROSSGUID DEFAULT_MSG CROSSGUID_INCLUDE_DIRS CROSSGUID_LIBRARIES) - mark_as_advanced(CROSSGUID_INCLUDE_DIRS CROSSGUID_LIBRARIES CROSSGUID_DEFINITIONS CROSSGUID_FOUND) + find_package_handle_standard_args(CrossGuid + REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR + VERSION_VAR CGUID_VER) + + set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) + set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) else() - find_path(CROSSGUID_INCLUDE_DIR guid.h) + find_path(CROSSGUID_INCLUDE_DIR NAMES guid.h) find_library(CROSSGUID_LIBRARY_RELEASE NAMES crossguid) find_library(CROSSGUID_LIBRARY_DEBUG NAMES crossguidd) @@ -37,12 +53,15 @@ else() select_library_configurations(CROSSGUID) include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(CROSSGUID + find_package_handle_standard_args(CrossGuid REQUIRED_VARS CROSSGUID_LIBRARY CROSSGUID_INCLUDE_DIR) if(CROSSGUID_FOUND) set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) set(CROSSGUID_INCLUDE_DIRS ${CROSSGUID_INCLUDE_DIR}) + + add_custom_target(crossguid) + set_target_properties(crossguid PROPERTIES FOLDER "External Projects") endif() mark_as_advanced(CROSSGUID_INCLUDE_DIR CROSSGUID_LIBRARY) endif() 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 @@ -# - Try to find CURL -# Once done this will define +#.rst: +# FindCurl +# -------- +# Finds the Curl library # -# CURL_FOUND - system has libcurl -# CURL_INCLUDE_DIRS - the libcurl include directory -# CURL_LIBRARIES - The libcurl libraries +# This will will define the following variables:: +# +# CURL_FOUND - system has Curl +# CURL_INCLUDE_DIRS - the Curl include directory +# CURL_LIBRARIES - the Curl libraries +# CURL_DEFINITIONS - the Curl definitions +# +# and the following imported targets:: +# +# Curl::Curl - The Curl library if(PKG_CONFIG_FOUND) - pkg_check_modules (CURL libcurl) - list(APPEND CURL_INCLUDE_DIRS ${CURL_INCLUDEDIR}) -else() - find_path(CURL_INCLUDE_DIRS curl/curl.h) - find_library(CURL_LIBRARIES NAMES curl libcurl) + pkg_check_modules(PC_CURL libcurl QUIET) endif() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Curl DEFAULT_MSG CURL_INCLUDE_DIRS CURL_LIBRARIES) -mark_as_advanced(CURL_INCLUDE_DIRS CURL_LIBRARIES) +find_path(CURL_INCLUDE_DIR NAMES curl/curl.h + PATHS ${PC_CURL_INCLUDEDIR}) +find_library(CURL_LIBRARY NAMES curl libcurl + PATHS ${PC_CURL_LIBDIR}) + +set(CURL_VERSION ${PC_CURL_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Curl + REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR + VERSION_VAR CURL_VERSION) if(CURL_FOUND) - if(NOT CURL_LIBRARY_DIRS AND CURL_LIBDIR) - set(CURL_LIBRARY_DIRS ${CURL_LIBDIR}) + set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) + set(CURL_LIBRARIES ${CURL_LIBRARY}) + + # Check whether OpenSSL inside libcurl is static. + if(UNIX) + if(NOT DEFINED HAS_CURL_STATIC) + get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} DIRECTORY) + find_soname(CURL REQUIRED) + + if(APPLE) + set(libchecker nm) + set(searchpattern "T [_]?CRYPTO_set_locking_call") + else() + set(libchecker readelf -s) + set(searchpattern "CRYPTO_set_locking_call") + endif() + execute_process( + COMMAND ${libchecker} ${CURL_LIBRARY_DIR}/${CURL_SONAME} + COMMAND grep -Eq ${searchpattern} + RESULT_VARIABLE HAS_CURL_STATIC) + unset(libchecker) + unset(searchpattern) + if(HAS_CURL_STATIC EQUAL 0) + set(HAS_CURL_STATIC TRUE) + else() + set(HAS_CURL_STATIC FALSE) + endif() + set(HAS_CURL_STATIC ${HAS_CURL_STATIC} CACHE INTERNAL + "OpenSSL is statically linked into Curl") + message(STATUS "OpenSSL is statically linked into Curl: ${HAS_CURL_STATIC}") + endif() endif() - find_soname(CURL) + if(HAS_CURL_STATIC) + set(CURL_DEFINITIONS -DHAS_CURL_STATIC=1) + endif() - if(EXISTS "${CURL_LIBRARY_DIRS}/${CURL_SONAME}") - execute_process(COMMAND readelf -s ${CURL_LIBRARY_DIRS}/${CURL_SONAME} COMMAND grep CRYPTO_set_locking_call OUTPUT_VARIABLE HAS_CURL_STATIC) - else() - message(FATAL_ERROR "curl library not found") + if(NOT TARGET Curl::Curl) + add_library(Curl::Curl UNKNOWN IMPORTED) + set_target_properties(Curl::Curl PROPERTIES + IMPORTED_LOCATION "${CURL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") + if(HAS_CURL_STATIC) + set_target_properties(Curl::Curl PROPERTIES + INTERFACE_COMPILE_DEFINITIONS HAS_CURL_STATIC=1) + endif() endif() endif() -if(HAS_CURL_STATIC) - mark_as_advanced(HAS_CURL_STATIC) - list(APPEND CURL_DEFINITIONS -DHAS_CURL_STATIC=1) -endif() +mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY) 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 @@ -# - Builds D3DX11Effects as external project +# - Finds D3DX11 dependencies # Once done this will define # -# D3DX11EFFECTS_FOUND - system has D3DX11Effects -# D3DX11EFFECTS_INCLUDE_DIRS - the D3DX11Effects include directories # D3DCOMPILER_DLL - Path to the Direct3D Compiler - -include(ExternalProject) -ExternalProject_Add(d3dx11effects - SOURCE_DIR ${CORE_SOURCE_DIR}/lib/win32/Effects11 - PREFIX ${CORE_BUILD_DIR}/Effects11 - CONFIGURE_COMMAND "" - BUILD_COMMAND msbuild ${CORE_SOURCE_DIR}/lib/win32/Effects11/Effects11_2013.sln - /t:Effects11 /p:Configuration=${CORE_BUILD_CONFIG} - INSTALL_COMMAND "") - -set(D3DX11EFFECTS_FOUND 1) -set(D3DX11EFFECTS_INCLUDE_DIRS ${CORE_SOURCE_DIR}/lib/win32/Effects11/inc) - -set(D3DX11EFFECTS_LIBRARY_RELEASE ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Release/Effects11.lib) -set(D3DX11EFFECTS_LIBRARY_DEBUG ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Debug/Effects11.lib) -include(SelectLibraryConfigurations) -select_library_configurations(D3DX11EFFECTS) - -mark_as_advanced(D3DX11EFFECTS_FOUND) +# FXC - Path to the DirectX Effects Compiler (FXC) find_file(D3DCOMPILER_DLL NAMES d3dcompiler_47.dll d3dcompiler_46.dll @@ -36,6 +16,7 @@ if(NOT D3DCOMPILER_DLL) message(WARNING "Could NOT find Direct3D Compiler") endif() mark_as_advanced(D3DCOMPILER_DLL) +copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .) find_program(FXC fxc 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 @@ +#.rst: +# FindDBUS +# ------- +# Finds the DBUS library +# +# This will will define the following variables:: +# +# DBUS_FOUND - system has DBUS +# DBUS_INCLUDE_DIRS - the DBUS include directory +# DBUS_LIBRARIES - the DBUS libraries +# DBUS_DEFINITIONS - the DBUS definitions +# +# and the following imported targets:: +# +# DBus::DBus - The DBUS library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_DBUS dbus-1 QUIET) +endif() + +find_path(DBUS_INCLUDE_DIR NAMES dbus/dbus.h + PATH_SUFFIXES dbus-1.0 + PATHS ${PC_DBUS_INCLUDE_DIR}) +find_path(DBUS_ARCH_INCLUDE_DIR NAMES dbus/dbus-arch-deps.h + PATH_SUFFIXES dbus-1.0/include + PATHS ${PC_DBUS_LIBDIR} + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}) +find_library(DBUS_LIBRARY NAMES dbus-1 + PATHS ${PC_DBUS_LIBDIR}) + +set(DBUS_VERSION ${PC_DBUS_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(DBus + REQUIRED_VARS DBUS_LIBRARY DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR + VERSION_VAR DBUS_VERSION) + +if(DBUS_FOUND) + set(DBUS_LIBRARIES ${DBUS_LIBRARY}) + set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) + set(DBUS_DEFINITIONS -DHAVE_DBUS=1) + + if(NOT TARGET DBus::DBus) + add_library(DBus::DBus UNKNOWN IMPORTED) + set_target_properties(DBus::DBus PROPERTIES + IMPORTED_LOCATION "${DBUS_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_DBUS=1) + endif() +endif() + +mark_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 @@ -# - Try to find dbus -# Once done this will define -# -# DBUS_FOUND - system has libdbus -# DBUS_INCLUDE_DIRS - the libdbus include directory -# DBUS_LIBRARIES - The libdbus libraries - -if(PKG_CONFIG_FOUND) - pkg_check_modules (DBUS dbus-1) -endif() - -if(DBUS_FOUND) - find_path(DBUS_INCLUDE_DIRS dbus/dbus.h PATH_SUFFIXES dbus-1.0) - find_library(DBUS_LIBRARIES dbus-1.0) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Dbus DEFAULT_MSG DBUS_INCLUDE_DIRS DBUS_LIBRARIES) - -list(APPEND DBUS_DEFINITIONS -DHAVE_DBUS=1) -mark_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() string(REGEX MATCH "^arm" TARGET_ARCH_ARM "${CMAKE_SYSTEM_PROCESSOR}") if(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) return() -endif(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) +endif() find_path(EMBEDDED_FOUND NAMES include/linux/imxfb.h include/bcm_host.h PATHS /opt/vc) - 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) if(FFMPEG_PATH) message(WARNING "Internal FFmpeg enabled, but FFMPEG_PATH given, ignoring") endif() + + # allow user to override the download URL with a local tarball + # needed for offline build envs + if(FFMPEG_URL) + get_filename_component(FFMPEG_URL "${FFMPEG_URL}" ABSOLUTE) + else() + set(FFMPEG_URL ${FFMPEG_BASE_URL}/${FFMPEG_VER}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "FFMPEG_URL: ${FFMPEG_URL}") + endif() + if(CMAKE_CROSSCOMPILING) set(CROSS_ARGS -DDEPENDS_PATH=${DEPENDS_PATH} -DPKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE} @@ -28,7 +40,9 @@ if(ENABLE_INTERNAL_FFMPEG) endif() externalproject_add(ffmpeg - URL ${FFMPEG_BASE_URL}/${FFMPEG_VER}.tar.gz + URL ${FFMPEG_URL} + DOWNLOAD_NAME ffmpeg-${FFMPEG_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download PREFIX ${CORE_BUILD_DIR}/ffmpeg CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} @@ -44,7 +58,7 @@ if(ENABLE_INTERNAL_FFMPEG) file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper "#!/bin/bash -if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}-test* ]] +if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] then avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat` @@ -53,8 +67,7 @@ then swscale=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswscale` swresample=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libswresample` gnutls=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors gnutls` - vorbisenc=`PKG_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig/ ${PKG_CONFIG_EXECUTABLE} --libs-only-l --static --silence-errors vorbisenc` - $@ $avcodec $avformat $avcodec $avfilter $swscale $swresample -lpostproc $gnutls $vorbisenc + $@ $avcodec $avformat $avcodec $avfilter $swscale $swresample -lpostproc $gnutls else $@ fi") @@ -62,6 +75,7 @@ fi") DESTINATION ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) set(FFMPEG_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper -o " PARENT_SCOPE) + set(FFMPEG_CREATE_SHARED_LIBRARY "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper -o " PARENT_SCOPE) set(FFMPEG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" -DUSE_STATIC_FFMPEG=1) @@ -72,10 +86,11 @@ else() endif() set(FFMPEG_PKGS libavcodec>=56.26.100 libavfilter>=5.11.100 libavformat>=56.25.101 libavutil>=54.20.100 libswscale>=3.1.101 libswresample>=1.1.100 libpostproc>=53.3.100) - if(PKG_CONFIG_FOUND) + if(PKG_CONFIG_FOUND AND NOT WIN32) pkg_check_modules (FFMPEG ${FFMPEG_PKGS}) string(REGEX REPLACE "framework;" "framework " FFMPEG_LDFLAGS "${FFMPEG_LDFLAGS}") set(FFMPEG_LIBRARIES ${FFMPEG_LDFLAGS}) + add_custom_target(ffmpeg) else() find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h PATH_SUFFIXES ffmpeg) find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec) @@ -94,5 +109,6 @@ else() set(FFMPEG_FOUND 1) list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\") endif() +set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects") mark_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 @@ -# - Try to find freetype -# Once done this will define +#.rst: +# FindFreetype +# ------------ +# Finds the FreeType library # -# FREETYPE_FOUND - system has freetype -# FREETYPE_INCLUDE_DIRS - the freetype include directory -# FREETYPE_LIBRARIES - The freetype libraries +# This will will define the following variables:: +# +# FREETYPE_FOUND - system has FreeType +# FREETYPE_INCLUDE_DIRS - the FreeType include directory +# FREETYPE_LIBRARIES - the FreeType libraries +# +# and the following imported targets:: +# +# FreeType::FreeType - The FreeType library if(PKG_CONFIG_FOUND) - pkg_check_modules (FREETYPE freetype2) -else() - find_path(FREETYPE_INCLUDE_DIRS freetype/freetype.h) - find_library(FREETYPE_LIBRARIES NAMES freetype freetype246MT) + pkg_check_modules(PC_FREETYPE freetype2 QUIET) endif() +find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h freetype.h + PATHS ${PC_FREETYPE_INCLUDEDIR} + ${PC_FREETYPE_INCLUDE_DIRS}) +find_library(FREETYPE_LIBRARY NAMES freetype freetype246MT + PATHS ${PC_FREETYPE_LIBDIR}) + +set(FREETYPE_VERSION ${PC_FREETYPE_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FreeType DEFAULT_MSG FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) +find_package_handle_standard_args(FreeType + REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR + VERSION_VAR FREETYPE_VERSION) + +if(FREETYPE_FOUND) + set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY}) + set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR}) + + if(NOT TARGET FreeType::FreeType) + add_library(FreeType::FreeType UNKNOWN IMPORTED) + set_target_properties(FreeType::FreeType PROPERTIES + IMPORTED_LOCATION "${FREETYPE_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(FREETYPE_INCLUDE_DIRS FREETYPE_LIBRARIES) +mark_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 @@ -# - Try to find Fribidi -# Once done this will define +#.rst: +# FindFribidi +# ----------- +# Finds the GNU FriBidi library # -# FRIBIDI_FOUND - system has fribidi -# FRIBIDI_INCLUDE_DIRS - the fribidi include directory -# FRIBIDI_LIBRARIES - The fribidi libraries +# This will will define the following variables:: +# +# FRIBIDI_FOUND - system has FriBidi +# FRIBIDI_INCLUDE_DIRS - the FriBidi include directory +# FRIBIDI_LIBRARIES - the FriBidi libraries +# +# and the following imported targets:: +# +# FriBidi::FriBidi - The FriBidi library if(PKG_CONFIG_FOUND) - pkg_check_modules (FRIBIDI fribidi) -else() - find_path(FRIBIDI_INCLUDE_DIRS fribidi/fribidi.h) - find_library(FRIBIDI_LIBRARIES NAMES fribidi libfribidi) + pkg_check_modules(PC_FRIBIDI fribidi QUIET) endif() +find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h + PATHS ${PC_FRIBIDI_INCLUDEDIR}) +find_library(FRIBIDI_LIBRARY NAMES fribidi libfribidi + PATHS ${PC_FRIBIDI_LIBDIR}) + +set(FRIBIDI_VERSION ${PC_FRIBIDI_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIRS FRIBIDI_LIBRARIES) +find_package_handle_standard_args(FriBidi + REQUIRED_VARS FRIBIDI_LIBRARY FRIBIDI_INCLUDE_DIR + VERSION_VAR FRIBIDI_VERSION) + +if(FRIBIDI_FOUND) + set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY}) + set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR}) + + if(NOT TARGET FriBidi::FriBidi) + add_library(FriBidi::FriBidi UNKNOWN IMPORTED) + set_target_properties(FriBidi::FriBidi PROPERTIES + IMPORTED_LOCATION "${FRIBIDI_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(FRIBIDI_INCLUDE_DIRS FRIBIDI_LIBRARIES) +mark_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) add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL) set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") + set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES FOLDER Tools) else() add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) + set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) endif() endif() 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 @@ +#.rst: +# FindLibDRM +# ---------- +# Finds the LibDRM library +# +# This will will define the following variables:: +# +# LIBDRM_FOUND - system has LibDRM +# LIBDRM_INCLUDE_DIRS - the LibDRM include directory +# LIBDRM_LIBRARIES - the LibDRM libraries +# +# and the following imported targets:: +# +# LibDRM::LibDRM - The LibDRM library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIBDRM libdrm QUIET) +endif() + +find_path(LIBDRM_INCLUDE_DIR NAMES drm.h + PATH_SUFFIXES libdrm drm + PATHS ${PC_LIBDRM_INCLUDEDIR}) +find_library(LIBDRM_LIBRARY NAMES drm + PATHS ${PC_LIBDRM_LIBDIR}) + +set(LIBDRM_VERSION ${PC_LIBDRM_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibDRM + REQUIRED_VARS LIBDRM_LIBRARY LIBDRM_INCLUDE_DIR + VERSION_VAR LIBDRM_VERSION) + +if(LIBDRM_FOUND) + set(LIBDRM_LIBRARIES ${LIBDRM_LIBRARY}) + set(LIBDRM_INCLUDE_DIRS ${LIBDRM_INCLUDE_DIR}) + + if(NOT TARGET LIBDRM::LIBDRM) + add_library(LIBDRM::LIBDRM UNKNOWN IMPORTED) + set_target_properties(LIBDRM::LIBDRM PROPERTIES + IMPORTED_LOCATION "${LIBDRM_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBDRM_INCLUDE_DIR}") + endif() +endif() + +mark_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 @@ -set(dvdlibs libdvdread libdvdnav) -if(ENABLE_DVDCSS) - list(APPEND dvdlibs libdvdcss) -endif() - if(NOT WIN32) - foreach(dvdlib ${dvdlibs}) - file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) - file(STRINGS ${VERSION_FILE} VER) - string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}") - list(GET ${dvdlib}_VER 0 ${dvdlib}_VER) - string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER) - string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}") - list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL) - string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL) - endforeach() - - set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") if(CMAKE_CROSSCOMPILING) - set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}") - endif() + set(_dvdlibs dvdread dvdnav) + set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY) + if(ENABLE_DVDCSS) + list(APPEND _dvdlibs libdvdcss) + list(APPEND _handlevars DVDCSS_LIBRARY) + endif() + + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_DVD ${_dvdlibs} QUIET) + endif() + + find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS}) + find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR}) + find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR}) + if(ENABLE_DVDCSS) + find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR}) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LIBDVD REQUIRED_VARS ${_handlevars}) + if(LIBDVD_FOUND) + add_library(dvdnav UNKNOWN IMPORTED) + set_target_properties(dvdnav PROPERTIES + FOLDER "External Projects" + IMPORTED_LOCATION "${DVDNAV_LIBRARY}") + + add_library(dvdread UNKNOWN IMPORTED) + set_target_properties(dvdread PROPERTIES + FOLDER "External Projects" + IMPORTED_LOCATION "${DVDREAD_LIBRARY}") + add_library(dvdcss UNKNOWN IMPORTED) + set_target_properties(dvdcss PROPERTIES + FOLDER "External Projects" + IMPORTED_LOCATION "${DVDCSS_LIBRARY}") - if(APPLE) + set(_linklibs ${DVDREAD_LIBRARY}) + if(ENABLE_DVDCSS) + list(APPEND _linklibs ${DVDCSS_LIBRARY}) + endif() + core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_linklibs}") + set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY}) + mark_as_advanced(LIBDVD_INCLUDE_DIRS LIBDVD_LIBRARIES) + endif() + else() + set(dvdlibs libdvdread libdvdnav) + if(ENABLE_DVDCSS) + list(APPEND dvdlibs libdvdcss) + endif() + foreach(dvdlib ${dvdlibs}) + file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) + file(STRINGS ${VERSION_FILE} VER) + string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}") + list(GET ${dvdlib}_VER 0 ${dvdlib}_VER) + string(SUBSTRING "${${dvdlib}_VER}" 8 -1 ${dvdlib}_VER) + string(REGEX MATCH "BASE_URL=([^ ]*)" ${dvdlib}_BASE_URL "${VER}") + list(GET ${dvdlib}_BASE_URL 0 ${dvdlib}_BASE_URL) + string(SUBSTRING "${${dvdlib}_BASE_URL}" 9 -1 ${dvdlib}_BASE_URL) + string(TOUPPER ${dvdlib} DVDLIB) + + # allow user to override the download URL with a local tarball + # needed for offline build envs + # allow upper and lowercase var name + if(${dvdlib}_URL) + set(${DVDLIB}_URL ${${dvdlib}_URL}) + endif() + if(${DVDLIB}_URL) + get_filename_component(${DVDLIB}_URL "${${DVDLIB}_URL}" ABSOLUTE) + else() + set(${DVDLIB}_URL ${${dvdlib}_BASE_URL}/archive/${${dvdlib}_VER}.tar.gz) + endif() + if(VERBOSE) + message(STATUS "${DVDLIB}_URL: ${${DVDLIB}_URL}") + endif() + endforeach() + + set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") + if(CMAKE_CROSSCOMPILING) + set(EXTRA_FLAGS "CC=${CMAKE_C_COMPILER}") + endif() + + if(APPLE) set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") - endif() + endif() + + set(HOST_ARCH ${ARCH}) + if(CORE_SYSTEM_NAME STREQUAL android) + if(ARCH STREQUAL arm) + set(HOST_ARCH arm-linux-androideabi) + elseif(ARCH STREQUAL aarch64) + set(HOST_ARCH aarch64-linux-android) + elseif(ARCH STREQUAL i486-linux) + set(HOST_ARCH i686-linux-android) + endif() + endif() - if(ENABLE_DVDCSS) - ExternalProject_ADD(dvdcss URL ${libdvdcss_BASE_URL}/archive/${libdvdcss_VER}.tar.gz + if(ENABLE_DVDCSS) + set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) + ExternalProject_Add(dvdcss URL ${LIBDVDCSS_URL} + DOWNLOAD_NAME libdvdcss-${libdvdcss_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/libdvd + CONFIGURE_COMMAND ac_cv_path_GIT= /configure + --target=${HOST_ARCH} + --host=${HOST_ARCH} + --disable-doc + --enable-static + --disable-shared + --with-pic + --prefix= + --libdir=/lib + "${EXTRA_FLAGS}" + "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" + "LDFLAGS=${CMAKE_LD_FLAGS}" + BUILD_BYPRODUCTS ${DVDCSS_LIBRARY}) + ExternalProject_Add_Step(dvdcss autoreconf + DEPENDEES download update patch + DEPENDERS configure + COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif + WORKING_DIRECTORY ) + + set_target_properties(dvdcss PROPERTIES FOLDER "External Projects") + endif() + + set(DVDREAD_CFLAGS "-D_XBMC") + if(ENABLE_DVDCSS) + set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") + endif() + + set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) + ExternalProject_Add(dvdread URL ${LIBDVDREAD_URL} + DOWNLOAD_NAME libdvdread-${libdvdread_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download + PREFIX ${CORE_BUILD_DIR}/libdvd + CONFIGURE_COMMAND ac_cv_path_GIT= /configure + --target=${HOST_ARCH} + --host=${HOST_ARCH} + --enable-static + --disable-shared + --with-pic + --prefix= + --libdir=/lib + "${EXTRA_FLAGS}" + "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" + "LDFLAGS=${CMAKE_LD_FLAGS}" + BUILD_BYPRODUCTS ${DVDREAD_LIBRARY}) + ExternalProject_Add_Step(dvdread autoreconf + DEPENDEES download update patch + DEPENDERS configure + COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif + WORKING_DIRECTORY ) + if(ENABLE_DVDCSS) + add_dependencies(dvdread dvdcss) + endif() + + set_target_properties(dvdread PROPERTIES FOLDER "External Projects") + + if(ENABLE_DVDCSS) + set(DVDNAV_LIBS -ldvdcss) + endif() + + set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a) + ExternalProject_Add(dvdnav URL ${LIBDVDNAV_URL} + DOWNLOAD_NAME libdvdnav-${libdvdnav_VER}.tar.gz + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/download PREFIX ${CORE_BUILD_DIR}/libdvd - UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif CONFIGURE_COMMAND ac_cv_path_GIT= /configure - --target=${ARCH} - --host=${ARCH} - --disable-doc - --enable-static - --disable-shared - --with-pic - --prefix= - "${EXTRA_FLAGS}" - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" - "LDFLAGS=${CMAKE_LD_FLAGS}") - - core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a - system/players/VideoPlayer/libdvdcss dvdcss) - endif() + --target=${HOST_ARCH} + --host=${HOST_ARCH} + --enable-static + --disable-shared + --with-pic + --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd + --libdir=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib + "${EXTRA_FLAGS}" + "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib" + "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" + "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" + "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la" + "LIBS=${DVDNAV_LIBS}" + BUILD_BYPRODUCTS ${DVDNAV_LIBRARY}) + ExternalProject_Add_Step(dvdnav autoreconf + DEPENDEES download update patch + DEPENDERS configure + COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif + WORKING_DIRECTORY ) + add_dependencies(dvdnav dvdread) + set_target_properties(dvdnav PROPERTIES FOLDER "External Projects") - set(DVDREAD_CFLAGS "-D_XBMC") - if(ENABLE_DVDCSS) - set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") - endif(ENABLE_DVDCSS) - - ExternalProject_ADD(dvdread URL ${libdvdread_BASE_URL}/archive/${libdvdread_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/libdvd - UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif - CONFIGURE_COMMAND ac_cv_path_GIT= /configure - --target=${ARCH} - --host=${ARCH} - --enable-static - --disable-shared - --with-pic - --prefix= - "${EXTRA_FLAGS}" - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" - "LDFLAGS=${CMAKE_LD_FLAGS}") - if(ENABLE_DVDCSS) - add_dependencies(dvdread dvdcss) - endif() + set(_dvdlibs ${DVDREAD_LIBRARY} ${DVDCSS_LIBRARY}) + # link a shared dvdnav library that includes the whole archives of dvdread and dvdcss as well + # the quotes around _dvdlibs are on purpose, since we want to pass a list to the function that will be unpacked automatically + core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav archives "${_dvdlibs}") - core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a - system/players/VideoPlayer/libdvdread dvdread) - - if(ENABLE_DVDCSS) - set(DVDNAV_LIBS -ldvdcss) - endif(ENABLE_DVDCSS) - - ExternalProject_ADD(dvdnav URL ${libdvdnav_BASE_URL}/archive/${libdvdnav_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/libdvd - UPDATE_COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif - CONFIGURE_COMMAND ac_cv_path_GIT= /configure - --target=${ARCH} - --host=${ARCH} - --enable-static - --disable-shared - --with-pic - --prefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd - "${EXTRA_FLAGS}" - "LDFLAGS=${CMAKE_LD_FLAGS} -L${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib" - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" - "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" - "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la" - "LIBS=${DVDNAV_LIBS}") - add_dependencies(dvdnav dvdread) - core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a - system/players/VideoPlayer/libdvdnav dvdnav) - - set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) - set(LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) - if(ENABLE_DVDCSS) - list(APPEND LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) - endif() - set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE) - set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE) + set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) + set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY}) + if(ENABLE_DVDCSS) + list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY}) + endif() + set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE) + set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE) + endif() else() # Dynamically loaded on Windows find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CORE_SOURCE_DIR}/lib/libdvd/include) @@ -110,6 +210,9 @@ else() if(LIBDVD_FOUND) set(LIBDVD_INCLUDE_DIRS ${LIBDVD_INCLUDE_DIR}) + + add_custom_target(dvdnav) + set_target_properties(dvdnav PROPERTIES FOLDER "External Projects") endif() 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 @@ -# - Try to find Libsmbclient - -if(PKGCONFIG_FOUND) - pkg_check_modules(LIBSMBCLIENT smbclient) - set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) -endif() - -if (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) - # in cache already - set(LIBSMBCLIENT_FOUND TRUE) -else (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) - find_path(LIBSMBCLIENT_INCLUDE_DIR - NAMES - libsmbclient.h - PATHS - /usr/include - /usr/local/include - /opt/local/include - /sw/include - ) - - find_library(SMBCLIENT_LIBRARY - NAMES - smbclient - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /sw/lib - ) - - if (SMBCLIENT_LIBRARY) - set(SMBCLIENT_FOUND TRUE) - endif (SMBCLIENT_LIBRARY) - - set(LIBSMBCLIENT_INCLUDE_DIRS - ${LIBSMBCLIENT_INCLUDE_DIR} - ) - - if (SMBCLIENT_FOUND) - set(LIBSMBCLIENT_LIBRARIES - ${LIBSMBCLIENT_LIBRARIES} - ${SMBCLIENT_LIBRARY} - ) - endif (SMBCLIENT_FOUND) - - if (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES) - set(LIBSMBCLIENT_FOUND TRUE) - endif (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES) - - if (LIBSMBCLIENT_FOUND) - if (NOT Libsmbclient_FIND_QUIETLY) - message(STATUS "Found Libsmbclient: ${LIBSMBCLIENT_LIBRARIES}") - endif (NOT Libsmbclient_FIND_QUIETLY) - else (LIBSMBCLIENT_FOUND) - if (Libsmbclient_FIND_REQUIRED) - message(FATAL_ERROR "Could not find Libsmbclient") - endif (Libsmbclient_FIND_REQUIRED) - endif (LIBSMBCLIENT_FOUND) - set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) - - # show the LIBSMBCLIENT_INCLUDE_DIRS and LIBSMBCLIENT_LIBRARIES variables only in the advanced view - mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIRS LIBSMBCLIENT_LIBRARIES LIBSMBCLIENT_DEFINITIONS) - -endif (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 @@ +#.rst: +# FindLibXml2 +# ----------- +# +# Try to find the LibXml2 xml processing library +# +# Once done this will define +# +# :: +# +# LIBXML2_FOUND - System has LibXml2 +# LIBXML2_INCLUDE_DIR - The LibXml2 include directory +# LIBXML2_LIBRARIES - The libraries needed to use LibXml2 +# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 +# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2 +# LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8) + +#============================================================================= +# Copyright 2006-2009 Kitware, Inc. +# Copyright 2006 Alexander Neundorf +# Copyright 2016 Team Kodi +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# use pkg-config to get the directories and then use these values +# in the find_path() and find_library() calls +find_package(PkgConfig QUIET) +PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0) +set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) + +find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h + HINTS + ${PC_LIBXML_INCLUDEDIR} + ${PC_LIBXML_INCLUDE_DIRS} + PATH_SUFFIXES libxml2 + ) + +find_library(LIBXML2_LIBRARY NAMES xml2 libxml2 + HINTS + ${PC_LIBXML_LIBDIR} + ${PC_LIBXML_LIBRARY_DIRS} + ) + +find_program(LIBXML2_XMLLINT_EXECUTABLE xmllint) +# for backwards compat. with KDE 4.0.x: +set(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}") + +# Make sure to use static flags if apropriate +if(PC_LIBXML_FOUND) + if(${LIBXML2_LIBRARY} MATCHES ".+\.a$" AND PC_LIBXML_STATIC_LDFLAGS) + set(LIBXML2_LIBRARY ${LIBXML2_LIBRARY} ${PC_LIBXML_STATIC_LDFLAGS}) + endif() +endif() + +if(PC_LIBXML_VERSION) + set(LIBXML2_VERSION_STRING ${PC_LIBXML_VERSION}) +elseif(LIBXML2_INCLUDE_DIR AND EXISTS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h") + file(STRINGS "${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h" libxml2_version_str + REGEX "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\".*\"") + string(REGEX REPLACE "^#define[\t ]+LIBXML_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1" + LIBXML2_VERSION_STRING "${libxml2_version_str}") + unset(libxml2_version_str) +endif() + + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 + REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR + VERSION_VAR LIBXML2_VERSION_STRING) + +if(LibXml2_FOUND) + set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY}) + set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) +endif() + +mark_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 @@ -# - Try to find Lzo2 -# Once done this will define +#.rst: +# FindLzo2 +# -------- +# Finds the Lzo2 library # -# Lzo2_FOUND - system has Lzo2 -# Lzo2_INCLUDE_DIR - the Lzo2 include directory -# Lzo2_LIBRARIES - Link these to use Lzo2 -# Lzo2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_ - -# Copyright (c) 2006, Alexander Neundorf, +# This will will define the following variables:: # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - +# LZO2_FOUND - system has Lzo2 +# LZO2_INCLUDE_DIRS - the Lzo2 include directory +# LZO2_LIBRARIES - the Lzo2 libraries +# +# and the following imported targets:: +# +# Lzo2::Lzo2 - The Lzo2 library -FIND_PATH(LZO2_INCLUDE_DIRS lzo1x.h PATH_SUFFIXES lzo) +find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h + PATH_SUFFIXES lzo) -FIND_LIBRARY(LZO2_LIBRARIES NAMES lzo2 liblzo2) +find_library(LZO2_LIBRARY NAMES lzo2 liblzo2) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Lzo2 DEFAULT_MSG LZO2_INCLUDE_DIRS LZO2_LIBRARIES) +find_package_handle_standard_args(Lzo2 + REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR) + +if(LZO2_FOUND) + set(LZO2_LIBRARIES ${LZO2_LIBRARY}) + set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR}) + + if(NOT TARGET Lzo2::Lzo2) + add_library(Lzo2::Lzo2 UNKNOWN IMPORTED) + set_target_properties(Lzo2::Lzo2 PROPERTIES + IMPORTED_LOCATION "${LZO2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}") + endif() +endif() -MARK_AS_ADVANCED(LZO2_INCLUDE_DIRS LZO2_LIBRARIES) +mark_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 @@ -IF (NOT WIN32) - include(FindPkgConfig) - if ( PKG_CONFIG_FOUND ) - - pkg_check_modules (MICROHTTPD libmicrohttpd>=0.4) - - set(MICROHTTPD_DEFINITIONS ${MICROHTTPD_CFLAGS_OTHER}) - endif(PKG_CONFIG_FOUND) -endif (NOT WIN32) - +#.rst: +# FindMicroHttpd +# -------------- +# Finds the MicroHttpd library # -# set defaults -if(NOT MICROHTTPD_FOUND) - SET(_microhttpd_HOME "/usr/local") - SET(_microhttpd_INCLUDE_SEARCH_DIRS - ${CMAKE_INCLUDE_PATH} - /usr/local/include - /usr/include - ) - - SET(_microhttpd_LIBRARIES_SEARCH_DIRS - ${CMAKE_LIBRARY_PATH} - /usr/local/lib - /usr/lib - ) - - ## - if( "${MICROHTTPD_HOME}" STREQUAL "") - if("" MATCHES "$ENV{MICROHTTPD_HOME}") - message(STATUS "MICROHTTPD_HOME env is not set, setting it to /usr/local") - set (MICROHTTPD_HOME ${_microhttpd_HOME}) - else("" MATCHES "$ENV{MICROHTTPD_HOME}") - set (MICROHTTPD_HOME "$ENV{MICROHTTPD_HOME}") - endif("" MATCHES "$ENV{MICROHTTPD_HOME}") - else( "${MICROHTTPD_HOME}" STREQUAL "") - message(STATUS "MICROHTTPD_HOME is not empty: \"${MICROHTTPD_HOME}\"") - endif( "${MICROHTTPD_HOME}" STREQUAL "") - ## - - message(STATUS "Looking for microhttpd in ${MICROHTTPD_HOME}") - - IF( NOT ${MICROHTTPD_HOME} STREQUAL "" ) - SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) - SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) - SET(_microhttpd_HOME ${MICROHTTPD_HOME}) - ENDIF( NOT ${MICROHTTPD_HOME} STREQUAL "" ) - - IF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" ) - SET(_microhttpd_INCLUDE_SEARCH_DIRS $ENV{MICROHTTPD_INCLUDEDIR} ${_microhttpd_INCLUDE_SEARCH_DIRS}) - ENDIF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" ) +# This will will define the following variables:: +# +# MICROHTTPD_FOUND - system has MicroHttpd +# MICROHTTPD_INCLUDE_DIRS - the MicroHttpd include directory +# MICROHTTPD_LIBRARIES - the MicroHttpd libraries +# MICROHTTPD_DEFINITIONS - the MicroHttpd definitions +# +# and the following imported targets:: +# +# MicroHttpd::MicroHttpd - The MicroHttpd library - IF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) - SET(_microhttpd_LIBRARIES_SEARCH_DIRS $ENV{MICROHTTPD_LIBRARYDIR} ${_microhttpd_LIBRARIES_SEARCH_DIRS}) - ENDIF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_MICROHTTPD libmicrohttpd>=0.4 QUIET) +endif() - IF( MICROHTTPD_HOME ) - SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) - SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) - SET(_microhttpd_HOME ${MICROHTTPD_HOME}) - ENDIF( MICROHTTPD_HOME ) +find_path(MICROHTTPD_INCLUDE_DIR NAMES microhttpd.h + PATHS ${PC_MICROHTTPD_INCLUDEDIR}) +find_library(MICROHTTPD_LIBRARY NAMES microhttpd libmicrohttpd + PATHS ${PC_MICROHTTPD_LIBDIR}) - # find the include files - FIND_PATH(MICROHTTPD_INCLUDE_DIRS microhttpd.h - HINTS - ${_microhttpd_INCLUDE_SEARCH_DIRS} - ${PC_MICROHTTPD_INCLUDEDIR} - ${PC_MICROHTTPD_INCLUDE_DIRS} - ${CMAKE_INCLUDE_PATH} - ) +set(MICROHTTPD_VERSION ${PC_MICROHTTPD_VERSION}) - # locate the library - IF(WIN32) - SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.lib) - ELSE(WIN32) - SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.a) - ENDIF(WIN32) - FIND_LIBRARY(MICROHTTPD_LIBRARIES NAMES ${MICROHTTPD_LIBRARY_NAMES} - HINTS - ${_microhttpd_LIBRARIES_SEARCH_DIRS} - ${PC_MICROHTTPD_LIBDIR} - ${PC_MICROHTTPD_LIBRARY_DIRS} - ) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MicroHttpd + REQUIRED_VARS MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR + VERSION_VAR MICROHTTPD_VERSION) - # if the include and the program are found then we have it - IF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) - SET(MICROHTTPD_FOUND "YES") - ENDIF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) +if(MICROHTTPD_FOUND) + set(MICROHTTPD_LIBRARIES ${MICROHTTPD_LIBRARY}) + set(MICROHTTPD_INCLUDE_DIRS ${MICROHTTPD_INCLUDE_DIR}) + set(MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) - if( NOT WIN32) + if(NOT WIN32) find_library(GCRYPT_LIBRARY gcrypt) find_library(GPGERROR_LIBRARY gpg-error) list(APPEND MICROHTTPD_LIBRARIES ${GCRYPT_LIBRARY} ${GPGERROR_LIBRARY}) + mark_as_advanced(GCRYPT_LIBRARY GPGERROR_LIBRARY) if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android) list(APPEND MICROHTTPD_LIBRARIES "-lrt") endif() - endif( NOT WIN32) + endif() endif() -list(APPEND MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) - -MARK_AS_ADVANCED( - MICROHTTPD_FOUND - MICROHTTPD_LIBRARIES - MICROHTTPD_DEFINITIONS - MICROHTTPD_INCLUDE_DIRS -) +mark_as_advanced(MICROHTTPD_LIBRARY MICROHTTPD_INCLUDE_DIR) 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 @@ # # MySqlClient::MySqlClient - The MySqlClient library +# Don't find system wide installed version on Windows +if(WIN32) + set(EXTRA_FIND_ARGS NO_SYSTEM_ENVIRONMENT_PATH) +else() + set(EXTRA_FIND_ARGS) +endif() + find_path(MYSQLCLIENT_INCLUDE_DIR mysql/mysql_time.h) find_library(MYSQLCLIENT_LIBRARY_RELEASE NAMES mysqlclient libmysql - PATH_SUFFIXES mysql) + PATH_SUFFIXES mysql + ${EXTRA_FIND_ARGS}) find_library(MYSQLCLIENT_LIBRARY_DEBUG NAMES mysqlclient libmysql - PATH_SUFFIXES mysql) + PATH_SUFFIXES mysql + ${EXTRA_FIND_ARGS}) + +if(MYSQLCLIENT_INCLUDE_DIR AND EXISTS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h") + file(STRINGS "${MYSQLCLIENT_INCLUDE_DIR}/mysql/mysql_version.h" mysql_version_str REGEX "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\".*\".*") + string(REGEX REPLACE "^#define[\t ]+LIBMYSQL_VERSION[\t ]+\"([^\"]+)\".*" "\\1" MYSQLCLIENT_VERSION_STRING "${mysql_version_str}") + unset(mysql_version_str) +endif() include(SelectLibraryConfigurations) select_library_configurations(MYSQLCLIENT) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MYSQLCLIENT - REQUIRED_VARS MYSQLCLIENT_LIBRARY MYSQLCLIENT_INCLUDE_DIR) +find_package_handle_standard_args(MySqlClient + REQUIRED_VARS MYSQLCLIENT_LIBRARY MYSQLCLIENT_INCLUDE_DIR + VERSION_VAR MYSQLCLIENT_VERSION_STRING) if(MYSQLCLIENT_FOUND) 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 @@ # NFS::NFS - The libnfs library if(PKG_CONFIG_FOUND) - pkg_check_modules(NFS libnfs QUIET) + pkg_check_modules(PC_NFS libnfs QUIET) endif() find_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 @@ find_package(EMBEDDED) if(PKG_CONFIG_FOUND AND NOT PLATFORM STREQUAL "raspberry-pi") - pkg_check_modules(PC_OPENGLES glesv2) + pkg_check_modules(PC_OPENGLES glesv2 QUIET) if(NOT OPENGLES_FOUND AND EMBEDDED_FOUND) set(CMAKE_PREFIX_PATH ${EMBEDDED_FOUND} ${CMAKE_PREFIX_PATH}) 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 @@ # OPENGL_DEFINITIONS - the OpenGl definitions if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_OPENGL gl glu) + pkg_check_modules(PC_OPENGL gl glu QUIET) endif() -if(NOT CORE_SYSTEM_NAME STREQUAL darwin) +if(NOT CORE_SYSTEM_NAME STREQUAL osx) find_path(OPENGL_INCLUDE_DIR GL/gl.h PATHS ${PC_OPENGL_gl_INCLUDEDIR}) 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 @@ -# Try to find the PulseAudio library +#.rst: +# FindPulseAudio +# -------------- +# Finds the PulseAudio library # -# Once done this will define: +# This will define the following variables:: # # PULSEAUDIO_FOUND - system has the PulseAudio library -# PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory -# PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio -# PULSEAUDIO_MAINLOOP_LIBRARY - the libraries needed to use PulsAudio Mailoop +# PULSEAUDIO_INCLUDE_DIRS - the PulseAudio include directory +# PULSEAUDIO_LIBRARIES - the libraries needed to use PulseAudio +# PULSEAUDIO_DEFINITIONS - the definitions needed to use PulseAudio # -# Copyright (c) 2008, Matthias Kretz, -# Copyright (c) 2009, Marcus Hufgard, +# and the following imported targets:: # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# PulseAudio::PulseAudio - The PulseAudio library -if (NOT PULSEAUDIO_MINIMUM_VERSION) - set(PULSEAUDIO_MINIMUM_VERSION "1.0.0") -endif (NOT PULSEAUDIO_MINIMUM_VERSION) - -if (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) - # Already in cache, be silent - set(PULSEAUDIO_FIND_QUIETLY TRUE) -endif (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) +if(NOT PulseAudio_FIND_VERSION) + set(PulseAudio_FIND_VERSION 2.0.0) +endif() -if (NOT WIN32) - include(FindPkgConfig) - pkg_check_modules(PC_PULSEAUDIO libpulse>=${PULSEAUDIO_MINIMUM_VERSION}) - pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib) -endif (NOT WIN32) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_PULSEAUDIO libpulse>=${PulseAudio_FIND_VERSION} QUIET) + pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib QUIET) +endif() -FIND_PATH(PULSEAUDIO_INCLUDE_DIRS pulse/pulseaudio.h - HINTS - ${PC_PULSEAUDIO_INCLUDEDIR} - ${PC_PULSEAUDIO_INCLUDE_DIRS} - ) +find_path(PULSEAUDIO_INCLUDE_DIR NAMES pulse/pulseaudio.h + PATHS ${PC_PULSEAUDIO_INCLUDEDIR} ${PC_PULSEAUDIO_INCLUDE_DIRS}) -FIND_LIBRARY(PULSEAUDIO_LIBRARY NAMES pulse libpulse - HINTS - ${PC_PULSEAUDIO_LIBDIR} - ${PC_PULSEAUDIO_LIBRARY_DIRS} - ) +find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse + PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) -FIND_LIBRARY(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib - HINTS - ${PC_PULSEAUDIO_LIBDIR} - ${PC_PULSEAUDIO_LIBRARY_DIRS} - ) +find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib + PATHS ${PC_PULSEAUDIO_LIBDIR} ${PC_PULSEAUDIO_LIBRARY_DIRS}) -if (NOT PULSEAUDIO_INCLUDE_DIRS OR NOT PULSEAUDIO_LIBRARY) - set(PULSEAUDIO_FOUND FALSE) -else() - set(PULSEAUDIO_FOUND TRUE) +if(PC_PULSEAUDIO_VERSION) + set(PULSEAUDIO_VERSION_STRING ${PC_PULSEAUDIO_VERSION}) +elseif(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h") + file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulseaudio_version_str REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\).*") + string(REGEX REPLACE "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]+)\"\\).*" "\\1" PULSEAUDIO_VERSION_STRING "${pulseaudio_version_str}") + unset(pulseaudio_version_str) endif() -if (PULSEAUDIO_FOUND) - if (NOT PULSEAUDIO_FIND_QUIETLY) - message(STATUS "Found PulseAudio: ${PULSEAUDIO_LIBRARY}") - if (PULSEAUDIO_MAINLOOP_LIBRARY) - message(STATUS "Found PulseAudio Mainloop: ${PULSEAUDIO_MAINLOOP_LIBRARY}") - else (PULSAUDIO_MAINLOOP_LIBRARY) - message(STATUS "Could NOT find PulseAudio Mainloop Library") - endif (PULSEAUDIO_MAINLOOP_LIBRARY) - endif (NOT PULSEAUDIO_FIND_QUIETLY) -else (PULSEAUDIO_FOUND) - message(STATUS "Could NOT find PulseAudio") -endif (PULSEAUDIO_FOUND) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PulseAudio + REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY PULSEAUDIO_INCLUDE_DIR + VERSION_VAR PULSEAUDIO_VERSION_STRING) -set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY}) +if(PULSEAUDIO_FOUND) + set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR}) + set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY} ${PULSEAUDIO_MAINLOOP_LIBRARY}) + set(PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1) -list(APPEND PULSEAUDIO_DEFINITIONS -DHAVE_LIBPULSE=1) + if(NOT TARGET PulseAudio::PulseAudioMainloop) + add_library(PulseAudio::PulseAudioMainloop UNKNOWN IMPORTED) + set_target_properties(PulseAudio::PulseAudioMainloop PROPERTIES + IMPORTED_LOCATION "${PULSEAUDIO_MAINLOOP_LIBRARY}") + endif() + if(NOT TARGET PulseAudio::PulseAudio) + add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED) + set_target_properties(PulseAudio::PulseAudio PROPERTIES + IMPORTED_LOCATION "${PULSEAUDIO_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PULSEAUDIO_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPULSE=1 + INTERFACE_LINK_LIBRARIES PulseAudio::PulseAudioMainloop) + endif() +endif() -mark_as_advanced(PULSEAUDIO_INCLUDE_DIRS PULSEAUDIO_LIBRARIES PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY) +mark_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 @@ # PYTHON_INCLUDE_DIRS - the python include directory # PYTHON_LIBRARIES - The python libraries -if(PKG_CONFIG_FOUND AND NOT CMAKE_CROSSCOMPILING) - pkg_check_modules (PYTHON python) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_PYTHON python >= 2.7 QUIET) endif() -if(NOT PYTHON_FOUND) - if(CMAKE_CROSSCOMPILING) - find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) - find_library(PYTHON_LIBRARY NAMES python2.6 python2.7) - find_path(PYTHON_INCLUDE_DIRS NAMES Python.h PATHS ${DEPENDS_PATH}/include/python2.6 ${DEPENDS_PATH}/include/python2.7) - set(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIRS} CACHE PATH "python include dir" FORCE) - - find_library(FFI_LIBRARY ffi) - find_library(EXPAT_LIBRARY expat) - find_library(INTL_LIBRARY intl) - - if(NOT CORE_SYSTEM_NAME STREQUAL android) - set(PYTHON_DEP_LIBRARIES -lpthread -ldl -lutil) - endif() - - set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${PYTHON_DEP_LIBRARIES} - CACHE INTERNAL "python libraries" FORCE) - else() - find_package(PythonLibs) +find_program(PYTHON_EXECUTABLE python ONLY_CMAKE_FIND_ROOT_PATH) +find_library(PYTHON_LIBRARY NAMES python2.7 PATHS ${PC_PYTHON_LIBDIR}) +find_path(PYTHON_INCLUDE_DIR NAMES Python.h PATHS ${PC_PYTHON_INCLUDE_DIRS} ${DEPENDS_PATH}/include/python2.7) + +if(CMAKE_CROSSCOMPILING) + find_library(FFI_LIBRARY ffi REQUIRED) + find_library(EXPAT_LIBRARY expat REQUIRED) + find_library(INTL_LIBRARY intl REQUIRED) + find_library(GMP_LIBRARY gmp REQUIRED) + + if(NOT CORE_SYSTEM_NAME STREQUAL android) + set(PYTHON_DEP_LIBRARIES -lpthread -ldl -lutil) endif() + + set(PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${FFI_LIBRARY} ${EXPAT_LIBRARY} ${INTL_LIBRARY} ${GMP_LIBRARY} ${PYTHON_DEP_LIBRARIES}) +else() + find_package(PythonLibs 2.7 REQUIRED) endif() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Python DEFAULT_MSG PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES) -if(CMAKE_SYSTEM_NAME STREQUAL Darwin) - find_library(FFI_LIBRARY ffi REQUIRED) - find_library(INTL_LIBRARY intl) - list(APPEND PYTHON_LIBRARIES ${FFI_LIBRARY} ${INTL_LIBRARY}) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PYTHON REQUIRED_VARS PYTHON_INCLUDE_DIR PYTHON_LIBRARY PYTHON_LIBRARIES) +if(PYTHON_FOUND) + set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR}) endif() -mark_as_advanced(PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES PYTHON_LDFLAGS) +mark_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 @@ -# - Try to find rtmp -# Once done this will define -# -# RTMP_FOUND - system has librtmp -# RTMP_INCLUDE_DIRS - the librtmp include directory -# RTMP_LIBRARIES - The librtmp libraries - -if(PKG_CONFIG_FOUND) - pkg_check_modules (RTMP librtmp) - list(APPEND RTMP_INCLUDE_DIRS ${RTMP_INCLUDEDIR}) -else() - find_path(RTMP_INCLUDE_DIRS librtmp/rtmp.h) - find_library(RTMP_LIBRARIES rtmp) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(RTMP DEFAULT_MSG RTMP_INCLUDE_DIRS RTMP_LIBRARIES) - -list(APPEND RTMP_DEFINITIONS -DHAS_LIBRTMP=1) - -mark_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 @@ # Check if SSE instructions are available on the machine where # the project is compiled. +include(TestCXXAcceptsFlag) -IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) - - STRING(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) - IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") - ENDIF (SSE2_TRUE) - - # /proc/cpuinfo apparently omits sse3 :( - STRING(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE) - IF (NOT SSE3_TRUE) - STRING(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE) - ENDIF (NOT SSE3_TRUE) - - STRING(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE) - IF (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") - ELSE (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - ENDIF (SSE3_TRUE OR SSSE3_TRUE) - IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") - ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - ENDIF (SSSE3_TRUE) - - STRING(REGEX REPLACE "^.*(sse4_1).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse4_1" "${SSE_THERE}" SSE41_TRUE) - IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") - ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ENDIF (SSE41_TRUE) -ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE - CPUINFO) - - STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) - IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") - ENDIF (SSE2_TRUE) - - STRING(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE3" "${SSE_THERE}" SSE3_TRUE) - IF (SSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") - ELSE (SSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - ENDIF (SSE3_TRUE) - - STRING(REGEX REPLACE "^.*(SSSE3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSSE3" "${SSE_THERE}" SSSE3_TRUE) - IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") - ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - ENDIF (SSSE3_TRUE) - - STRING(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE4.1" "${SSE_THERE}" SSE41_TRUE) - IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") - ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ENDIF (SSE41_TRUE) -ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows") +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86") + exec_program(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) + + string(REGEX REPLACE "^.*(sse).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "sse" "${_SSE_THERE}" _SSE_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK) + + string(REGEX REPLACE "^.*(sse2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "sse2" "${_SSE_THERE}" _SSE2_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK) + + # /proc/cpuinfo apparently omits sse3 :( + string(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "sse3" "${_SSE_THERE}" _SSE3_TRUE) + if(NOT _SSE3_TRUE) + string(REGEX REPLACE "^.*(T2300).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "T2300" "${_SSE_THERE}" _SSE3_TRUE) + endif() + CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK) + + string(REGEX REPLACE "^.*(ssse3).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "ssse3" "${_SSE_THERE}" _SSSE3_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK) + + string(REGEX REPLACE "^.*(sse4_1).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "sse4_1" "${_SSE_THERE}" _SSE41_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK) + + string(REGEX REPLACE "^.*(sse4_2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "sse4_2" "${_SSE_THERE}" _SSE42_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK) + + string(REGEX REPLACE "^.*(avx).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "avx" "${_SSE_THERE}" _AVX_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK) + + string(REGEX REPLACE "^.*(avx2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) + endif() +elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") + if(NOT CPU MATCHES "arm") + exec_program("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO) + + string(REGEX REPLACE "^.*[^S](SSE).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSE" "${_SSE_THERE}" _SSE_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK) + + string(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSE2" "${_SSE_THERE}" _SSE2_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK) + + string(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSE3" "${_SSE_THERE}" _SSE3_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK) + + string(REGEX REPLACE "^.*(SSSE3).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSSE3" "${_SSE_THERE}" _SSSE3_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK) + + string(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSE4.1" "${_SSE_THERE}" _SSE41_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK) + + string(REGEX REPLACE "^.*(SSE4.2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "SSE4.2" "${_SSE_THERE}" _SSE42_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK) + + string(REGEX REPLACE "^.*(AVX).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "AVX" "${_SSE_THERE}" _AVX_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK) + + string(REGEX REPLACE "^.*(AVX2).*$" "\\1" _SSE_THERE ${CPUINFO}) + string(COMPARE EQUAL "AVX2" "${_SSE_THERE}" _AVX2_TRUE) + CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) + endif() +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") # TODO - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") -ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") -ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") - -if(NOT SSE2_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.") -endif(NOT SSE2_FOUND) -if(NOT SSE3_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE3 on this machine.") -endif(NOT SSE3_FOUND) -if(NOT SSSE3_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSSE3 on this machine.") -endif(NOT SSSE3_FOUND) -if(NOT SSE4_1_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE4.1 on this machine.") -endif(NOT SSE4_1_FOUND) - -mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND) + set(_SSE_TRUE true) + set(_SSE_OK true) + set(_SSE2_TRUE true) + set(_SSE2_OK true) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SSE + REQUIRED_VARS _SSE_TRUE _SSE_OK + FAIL_MESSAGE "Could not find hardware support for SSE") +find_package_handle_standard_args(SSE2 + REQUIRED_VARS _SSE2_TRUE _SSE2_OK + FAIL_MESSAGE "Could not find hardware support for SSE2") +find_package_handle_standard_args(SSE3 + REQUIRED_VARS _SSE3_TRUE _SSE3_OK + FAIL_MESSAGE "Could not find hardware support for SSE3") +find_package_handle_standard_args(SSSE3 + REQUIRED_VARS _SSSE3_TRUE _SSSE3_OK + FAIL_MESSAGE "Could not find hardware support for SSSE3") +find_package_handle_standard_args(SSE4_1 + REQUIRED_VARS _SSE41_TRUE _SSE41_OK + FAIL_MESSAGE "Could not find hardware support for SSE4.1") +find_package_handle_standard_args(SSE4_2 + REQUIRED_VARS _SSE42_TRUE _SSE42_OK + FAIL_MESSAGE "Could not find hardware support for SSE4.2") +find_package_handle_standard_args(AVX + REQUIRED_VARS _AVX_TRUE _AVX_OK + FAIL_MESSAGE "Could not find hardware support for AVX") +find_package_handle_standard_args(AVX2 + REQUIRED_VARS _AVX2_TRUE _AVX2_OK + FAIL_MESSAGE "Could not find hardware support for AVX2") + +mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND SSE4_2_FOUND AVX_FOUND AVX2_FOUND) + +unset(_SSE_THERE) +unset(_SSE_TRUE) +unset(_SSE_OK) +unset(_SSE_OK CACHE) +unset(_SSE2_TRUE) +unset(_SSE2_OK) +unset(_SSE2_OK CACHE) +unset(_SSE3_TRUE) +unset(_SSE3_OK) +unset(_SSE3_OK CACHE) +unset(_SSSE3_TRUE) +unset(_SSSE3_OK) +unset(_SSSE3_OK CACHE) +unset(_SSE4_1_TRUE) +unset(_SSE41_OK) +unset(_SSE41_OK CACHE) +unset(_SSE4_2_TRUE) +unset(_SSE42_OK) +unset(_SSE42_OK CACHE) +unset(_AVX_TRUE) +unset(_AVX_OK) +unset(_AVX_OK CACHE) +unset(_AVX2_TRUE) +unset(_AVX2_OK) +unset(_AVX2_OK CACHE) 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 @@ -# - Try to find libssh -# Once done this will define +#.rst: +# FindSSH +# ------- +# Finds the SSH library # -# SSH_FOUND - system has libssh -# SSH_INCLUDE_DIRS - the libssh include directory -# SSH_LIBRARIES - The libssh libraries +# This will will define the following variables:: +# +# SSH_FOUND - system has SSH +# SSH_INCLUDE_DIRS - the SSH include directory +# SSH_LIBRARIES - the SSH libraries +# SSH_DEFINITIONS - the SSH definitions +# +# and the following imported targets:: +# +# SSH::SSH - The SSH library if(PKG_CONFIG_FOUND) - pkg_check_modules (SSH libssh) - list(APPEND SSH_INCLUDE_DIRS /usr/include) -else() - find_path(SSH_INCLUDE_DIRS libssh/libssh.h) - find_library(SSH_LIBRARIES ssh) + pkg_check_modules(PC_SSH libssh QUIET) endif() +find_path(SSH_INCLUDE_DIR NAMES libssh/libssh.h + PATHS ${PC_SSH_INCLUDEDIR}) +find_library(SSH_LIBRARY NAMES ssh + PATHS ${PC_SSH_LIBDIR}) + +set(SSH_VERSION ${PC_SSH_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SSH DEFAULT_MSG SSH_INCLUDE_DIRS SSH_LIBRARIES) +find_package_handle_standard_args(SSH + REQUIRED_VARS SSH_LIBRARY SSH_INCLUDE_DIR + VERSION_VAR SSH_VERSION) + +if(SSH_FOUND) + set(SSH_LIBRARIES ${SSH_LIBRARY}) + set(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR}) + set(SSH_DEFINITIONS -DHAVE_LIBSSH=1) -list(APPEND SSH_DEFINITIONS -DHAVE_LIBSSH=1) + if(NOT TARGET SSH::SSH) + add_library(SSH::SSH UNKNOWN IMPORTED) + set_target_properties(SSH::SSH PROPERTIES + IMPORTED_LOCATION "${SSH_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SSH_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSSH=1) + endif() +endif() -mark_as_advanced(SSH_INCLUDE_DIRS SSH_LIBRARIES SSH_DEFINITIONS) +mark_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 @@ -if(NOT SWIG_EXECUTABLE) - find_program(SWIG_EXECUTABLE NAMES swig2.0 swig PATH_SUFFIXES swig) -endif() +#.rst: +# FindSWIG +# -------- +# Finds the SWIG executable +# +# This will will define the following variables:: +# +# SWIG_FOUND - system has SWIG +# SWIG_EXECUTABLE - the SWIG executable + +find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig + PATH_SUFFIXES swig) if(SWIG_EXECUTABLE) execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib OUTPUT_VARIABLE SWIG_DIR ERROR_VARIABLE SWIG_swiglib_error RESULT_VARIABLE SWIG_swiglib_result) + execute_process(COMMAND ${SWIG_EXECUTABLE} -version + OUTPUT_VARIABLE SWIG_version_output + ERROR_VARIABLE SWIG_version_output + RESULT_VARIABLE SWIG_version_result) + string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" + SWIG_VERSION "${SWIG_version_output}") endif() - include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR - VERSION_VAR SWIG_VERSION ) +find_package_handle_standard_args(SWIG + REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR + 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) " HAVE_SHAIRPLAY_CALLBACK_CLS) endif() - find_package_handle_standard_args(SHAIRPLAY + find_package_handle_standard_args(Shairplay REQUIRED_VARS SHAIRPLAY_LIBRARY SHAIRPLAY_INCLUDE_DIR HAVE_SHAIRPLAY_CALLBACK_CLS) else() # Dynamically loaded DLL - find_package_handle_standard_args(SHAIRPLAY + find_package_handle_standard_args(Shairplay REQUIRED_VARS SHAIRPLAY_INCLUDE_DIR) endif() 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 @@ +#.rst: +# FindSmbClient +# ------------- +# Finds the SMB Client library +# +# This will will define the following variables:: +# +# SMBCLIENT_FOUND - system has SmbClient +# SMBCLIENT_INCLUDE_DIRS - the SmbClient include directory +# SMBCLIENT_LIBRARIES - the SmbClient libraries +# SMBCLIENT_DEFINITIONS - the SmbClient definitions +# +# and the following imported targets:: +# +# SmbClient::SmbClient - The SmbClient library + +if(PKGCONFIG_FOUND) + pkg_check_modules(PC_SMBCLIENT smbclient QUIET) +endif() + +find_path(SMBCLIENT_INCLUDE_DIR NAMES libsmbclient.h + PATHS ${PC_SMBCLIENT_INCLUDEDIR}) +find_library(SMBCLIENT_LIBRARY NAMES smbclient + PATHS ${PC_SMBCLIENT_LIBDIR}) + +set(SMBCLIENT_VERSION ${PC_SMBCLIENT_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SmbClient + REQUIRED_VARS SMBCLIENT_LIBRARY SMBCLIENT_INCLUDE_DIR + VERSION_VAR SMBCLIENT_VERSION) + +if(SMBCLIENT_FOUND) + set(SMBCLIENT_LIBRARIES ${SMBCLIENT_LIBRARY}) + set(SMBCLIENT_INCLUDE_DIRS ${SMBCLIENT_INCLUDE_DIR}) + set(SMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) + + if(NOT TARGET SmbClient::SmbClient) + add_library(SmbClient::SmbClient UNKNOWN IMPORTED) + set_target_properties(SmbClient::SmbClient PROPERTIES + IMPORTED_LOCATION "${SMBCLIENT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SMBCLIENT_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBSMBCLIENT=1) + endif() +endif() + +mark_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 @@ -# - Try to find SQLITE3 -# Once done this will define +#.rst: +# FindSqlite3 +# ----------- +# Finds the SQLite3 library # -# SQLITE3_FOUND - system has sqlite3 -# SQLITE3_INCLUDE_DIRS - the sqlite3 include directory -# SQLITE3_LIBRARIES - The sqlite3 libraries +# This will will define the following variables:: +# +# SQLITE3_FOUND - system has SQLite3 +# SQLITE3_INCLUDE_DIRS - the SQLite3 include directory +# SQLITE3_LIBRARIES - the SQLite3 libraries +# +# and the following imported targets:: +# +# SQLite3::SQLite3 - The SQLite3 library if(PKG_CONFIG_FOUND) - pkg_check_modules (SQLITE3 sqlite3) - list(APPEND SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDEDIR}) -else() - find_path(SQLITE3_INCLUDE_DIRS sqlite3.h) - find_library(SQLITE3_LIBRARIES sqlite3) + pkg_check_modules(PC_SQLITE3 sqlite3 QUIET) endif() +find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h + PATHS ${PC_SQLITE3_INCLUDEDIR}) +find_library(SQLITE3_LIBRARY NAMES sqlite3 + PATHS ${PC_SQLITE3_LIBDIR}) + +set(SQLITE3_VERSION ${PC_SQLITE3_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Sqlite3 DEFAULT_MSG SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) +find_package_handle_standard_args(Sqlite3 + REQUIRED_VARS SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR + VERSION_VAR SQLITE3_VERSION) + +if(SQLITE3_FOUND) + set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR}) + set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) + + if(NOT TARGET SQLite3::SQLite3) + add_library(SQLite3::SQLite3 UNKNOWN IMPORTED) + set_target_properties(SQLite3::SQLite3 PROPERTIES + IMPORTED_LOCATION "${SQLITE3_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES) +mark_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 @@ # TagLib::TagLib - The TagLib library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_TAGLIB taglib>=1.8.0 QUIET) + pkg_check_modules(PC_TAGLIB taglib>=1.9.0 QUIET) endif() find_path(TAGLIB_INCLUDE_DIR taglib/tag.h @@ -29,7 +29,7 @@ include(SelectLibraryConfigurations) select_library_configurations(TAGLIB) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(TAGLIB +find_package_handle_standard_args(TagLib REQUIRED_VARS TAGLIB_LIBRARY TAGLIB_INCLUDE_DIR VERSION_VAR TAGLIB_VERSION) 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) select_library_configurations(TINYXML) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(TINYXML +find_package_handle_standard_args(TinyXML REQUIRED_VARS TINYXML_LIBRARY TINYXML_INCLUDE_DIR VERSION_VAR TINYXML_VERSION) 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 @@ +#.rst: +# FindUDEV +# ------- +# Finds the UDEV library +# +# This will will define the following variables:: +# +# UDEV_FOUND - system has UDEV +# UDEV_INCLUDE_DIRS - the UDEV include directory +# UDEV_LIBRARIES - the UDEV libraries +# UDEV_DEFINITIONS - the UDEV definitions +# +# and the following imported targets:: +# +# UDEV::UDEV - The UDEV library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_UDEV libudev QUIET) +endif() + +find_path(UDEV_INCLUDE_DIR NAMES libudev.h + PATHS ${PC_UDEV_INCLUDEDIR}) +find_library(UDEV_LIBRARY NAMES udev + PATHS ${PC_UDEV_LIBDIR}) + +set(UDEV_VERSION ${PC_UDEV_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UDEV + REQUIRED_VARS UDEV_LIBRARY UDEV_INCLUDE_DIR + VERSION_VAR UDEV_VERSION) + +if(UDEV_FOUND) + set(UDEV_LIBRARIES ${UDEV_LIBRARY}) + set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR}) + set(UDEV_DEFINITIONS -DHAVE_LIBUDEV=1) + + if(NOT TARGET UDEV::UDEV) + add_library(UDEV::UDEV UNKNOWN IMPORTED) + set_target_properties(UDEV::UDEV PROPERTIES + IMPORTED_LOCATION "${UDEV_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${UDEV_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBUDEV=1) + endif() +endif() + +mark_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 @@ -# - Try to find udev -# Once done this will define -# -# UDEV_FOUND - system has libudev -# UDEV_INCLUDE_DIRS - the libudev include directory -# UDEV_LIBRARIES - The libudev libraries - -if(PKG_CONFIG_FOUND) - pkg_check_modules (UDEV libudev) - list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDEDIR}) -endif() - -if(NOT UDEV_FOUND) - find_path(UDEV_INCLUDE_DIRS libudev.h) - find_library(UDEV_LIBRARIES udev) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIRS UDEV_LIBRARIES) - -mark_as_advanced(UDEV_INCLUDE_DIRS UDEV_LIBRARIES) -list(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 @@ # VAAPI_INCLUDE_DIRS - the VAAPI include directory # VAAPI_LIBRARIES - the VAAPI libraries # VAAPI_DEFINITIONS - the VAAPI definitions +# +# and the following imported targets:: +# +# VAAPI::VAAPI - The VAAPI library if(PKG_CONFIG_FOUND) pkg_check_modules(PC_VAAPI libva libva-x11 QUIET) @@ -42,6 +46,20 @@ if(VAAPI_FOUND) set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY}) set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) + + if(NOT TARGET VAAPI::VAAPI_X11) + add_library(VAAPI::VAAPI_X11 UNKNOWN IMPORTED) + set_target_properties(VAAPI::VAAPI_X11 PROPERTIES + IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}") + endif() + if(NOT TARGET VAAPI::VAAPI) + add_library(VAAPI::VAAPI UNKNOWN IMPORTED) + set_target_properties(VAAPI::VAAPI PROPERTIES + IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1 + INTERFACE_LINK_LIBRARIES VAAPI::VAAPI_X11) + endif() endif() mark_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 @@ # VDPAU_INCLUDE_DIRS - the VDPAU include directory # VDPAU_LIBRARIES - the VDPAU libraries # VDPAU_DEFINITIONS - the VDPAU definitions +# +# and the following imported targets:: +# +# VDPAU::VDPAU - The VDPAU library if(PKG_CONFIG_FOUND) pkg_check_modules(PC_VDPAU vdpau QUIET) @@ -19,14 +23,25 @@ find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h find_library(VDPAU_LIBRARY NAMES vdpau PATHS ${PC_VDPAU_LIBDIR}) +set(VDPAU_VERSION ${PC_VDPAU_VERSION}) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VDPAU - REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR) + REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR + VERSION_VAR VDPAU_VERSION) if(VDPAU_FOUND) set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR}) set(VDPAU_LIBRARIES ${VDPAU_LIBRARY}) set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1) + + if(NOT TARGET VDPAU::VDPAU) + add_library(VDPAU::VDPAU UNKNOWN IMPORTED) + set_target_properties(VDPAU::VDPAU PROPERTIES + IMPORTED_LOCATION "${VDPAU_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU=1) + endif() endif() mark_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 @@ -# - Try to find X11 -# Once done this will define +#.rst: +# FindX +# ----- +# Finds the X11 library # -# X11_FOUND - system has X11 -# X11_INCLUDE_DIRS - the X11 include directory -# X11_LIBRARIES - The X11 libraries +# This will will define the following variables:: +# +# X_FOUND - system has X11 +# X_INCLUDE_DIRS - the X11 include directory +# X_LIBRARIES - the X11 libraries +# X_DEFINITIONS - the X11 definitions +# +# and the following imported targets:: +# +# X::X - The X11 library +# X::Xext - The X11 extension library if(PKG_CONFIG_FOUND) - pkg_check_modules (X x11 xext libdrm egl) - list(APPEND X_INCLUDE_DIRS /usr/include) -else() - find_path(X_INCLUDE_DIRS X11/Xlib.h) - find_library(X_LIBRARIES X11) + pkg_check_modules(PC_X x11 xext QUIET) endif() +find_path(X_INCLUDE_DIR NAMES X11/Xlib.h + PATHS ${PC_X_x11_INCLUDEDIR}) +find_library(X_LIBRARY NAMES X11 + PATHS ${PC_X_x11_LIBDIR}) +find_library(X_EXT_LIBRARY NAMES Xext + PATHS ${PC_X_xext_LIBDIR}) + +set(X_VERSION ${PC_X_x11_VERSION}) + include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(X DEFAULT_MSG X_INCLUDE_DIRS X_LIBRARIES) +find_package_handle_standard_args(X + REQUIRED_VARS X_LIBRARY X_EXT_LIBRARY X_INCLUDE_DIR + VERSION_VAR X_VERSION) + +if(X_FOUND) + set(X_LIBRARIES ${X_LIBRARY} ${X_EXT_LIBRARY}) + set(X_INCLUDE_DIRS ${X_INCLUDE_DIR}) + set(X_DEFINITIONS -DHAVE_X11=1) -list(APPEND X_DEFINITIONS -DHAVE_X11=1) + if(NOT TARGET X::X) + add_library(X::X UNKNOWN IMPORTED) + set_target_properties(X::X PROPERTIES + IMPORTED_LOCATION "${X_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_X11=1) + endif() + if(NOT TARGET X::Xext) + add_library(X::Xext UNKNOWN IMPORTED) + set_target_properties(X::Xext PROPERTIES + IMPORTED_LOCATION "${X_EXT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${X_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES X::X) + endif() +endif() -mark_as_advanced(X_INCLUDE_DIRS X_LIBRARIES X_DEFINITIONS) +mark_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 @@ -# - Try to find xrandr -# Once done this will define +#.rst: +# FindXRandR +# ---------- +# Finds the XRandR library # -# XRANDR_FOUND - system has lixrandr -# XRANDR_INCLUDE_DIRS - the libxrandr include directory -# XRANDR_LIBRARIES - The libxrandr libraries +# This will will define the following variables:: +# +# XRANDR_FOUND - system has XRANDR +# XRANDR_INCLUDE_DIRS - the XRANDR include directory +# XRANDR_LIBRARIES - the XRANDR libraries +# XRANDR_DEFINITIONS - the XRANDR definitions +# +# and the following imported targets:: +# +# XRandR::XRandR - The XRANDR library if(PKG_CONFIG_FOUND) - pkg_check_modules (XRANDR xrandr) - list(APPEND XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDEDIR}) -else() - find_library(XRANDR_LIBRARIES Xrandr) + pkg_check_modules(PC_XRANDR xrandr QUIET) endif() -if(XRANDR_FOUND) +find_path(XRANDR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h + PATHS ${PC_XRANDR_INCLUDEDIR}) +find_library(XRANDR_LIBRARY NAMES Xrandr + PATHS ${PC_XRANDR_LIBDIR}) + +set(XRANDR_VERSION ${PC_XRANDR_VERSION}) + include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(XRandR DEFAULT_MSG XRANDR_INCLUDE_DIRS XRANDR_LIBRARIES) +find_package_handle_standard_args(XRandR + REQUIRED_VARS XRANDR_LIBRARY XRANDR_INCLUDE_DIR + VERSION_VAR XRANDR_VERSION) - list(APPEND XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1) +if(XRANDR_FOUND) + set(XRANDR_LIBRARIES ${XRANDR_LIBRARY}) + set(XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDE_DIR}) + set(XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1) - mark_as_advanced(XRANDR_INCLUDE_DIRS XRANDR_LIBRARIES XRANDR_DEFINITIONS) + if(NOT TARGET XRandR::XRandR) + add_library(XRandR::XRandR UNKNOWN IMPORTED) + set_target_properties(XRandR::XRandR PROPERTIES + IMPORTED_LOCATION "${XRANDR_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${XRANDR_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXRANDR=1) + endif() endif() + +mark_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 @@ +#.rst: +# FindXSLT +# -------- +# Finds the XSLT library +# +# This will will define the following variables:: +# +# XSLT_FOUND - system has XSLT +# XSLT_INCLUDE_DIRS - the XSLT include directory +# XSLT_LIBRARIES - the XSLT libraries +# XSLT_DEFINITIONS - the XSLT definitions +# +# and the following imported targets:: +# +# XSLT::XSLT - The XSLT library + +find_package(LibXml2 REQUIRED) + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_XSLT libxslt QUIET) +endif() + +find_path(XSLT_INCLUDE_DIR NAMES libxslt/xslt.h + PATHS ${PC_XSLT_INCLUDEDIR}) +find_library(XSLT_LIBRARY NAMES xslt libxslt + PATHS ${PC_XSLT_LIBDIR}) + +set(XSLT_VERSION ${PC_XSLT_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(XSLT + REQUIRED_VARS XSLT_LIBRARY XSLT_INCLUDE_DIR + VERSION_VAR XSLT_VERSION) + +if(XSLT_FOUND) + set(XSLT_LIBRARIES ${XSLT_LIBRARY} ${LIBXML2_LIBRARIES}) + set(XSLT_INCLUDE_DIRS ${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) + set(XSLT_DEFINITIONS -DHAVE_LIBXSLT=1) + + if(NOT TARGET XSLT::XSLT) + add_library(XSLT::XSLT UNKNOWN IMPORTED) + set_target_properties(XSLT::XSLT PROPERTIES + IMPORTED_LOCATION "${XSLT_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1 + ITERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}") + endif() +endif() + +mark_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 @@ -# - Try to find XSLT -# Once done this will define -# -# XSLT_FOUND - system has libxslt -# XSLT_INCLUDE_DIRS - the libxslt include directory -# XSLT_LIBRARIES - The libxslt libraries - -if(PKG_CONFIG_FOUND) - pkg_check_modules (XSLT libxslt) -else() - find_path(XSLT_INCLUDE_DIRS libxslt/xslt.h) - find_library(XSLT_LIBRARIES NAMES xslt libxslt) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Xslt DEFAULT_MSG XSLT_INCLUDE_DIRS XSLT_LIBRARIES) - -mark_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 @@ -# Base Io build system -# Written by Jeremy Tregunna +#.rst: +# FindYajl +# -------- +# Finds the Yajl library # -# Find libyajl -pkg_check_modules(YAJL yajl>=2.0) -if(YAJL_FOUND) - list(APPEND YAJL_DEFINITIONS -DYAJL_MAJOR=2) +# This will will define the following variables:: +# +# YAJL_FOUND - system has Yajl +# YAJL_INCLUDE_DIRS - Yajl include directory +# YAJL_LIBRARIES - the Yajl libraries +# +# and the following imported targets:: +# +# Yajl::Yajl - The Yajl library + +if(NOT Yajl_FIND_VERSION) + set(Yajl_FIND_VERSION 2.0.0) +endif() + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_YAJL yajl>=${Yajl_FIND_VERSION} QUIET) endif() -if(NOT YAJL_FOUND) - find_path(YAJL_INCLUDE_DIRS yajl/yajl_common.h) - find_library(YAJL_LIBRARIES NAMES yajl) +find_path(YAJL_INCLUDE_DIR NAMES yajl/yajl_common.h + PATHS ${PC_YAJL_INCLUDEDIR}) +find_library(YAJL_LIBRARY NAMES yajl + PATHS ${PC_YAJL_LIBDIR}) - file(STRINGS ${YAJL_INCLUDE_DIRS}/yajl/yajl_version.h version_header) - string(REGEX MATCH "YAJL_MAJOR ([0-9]+)" YAJL_VERSION_MAJOR ${version_header}) +if(PC_YAJL_VERSION) + set(YAJL_VERSION_STRING ${PC_YAJL_VERSION}) +elseif(YAJL_INCLUDE_DIR AND EXISTS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h") + file(STRINGS "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h" yajl_version_str REGEX "^[ \t]*#define[ \t]+YAJL_(MAJOR|MINOR|MICRO)") string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}") - if (YAJL_VERSION_MINOR LESS 2) - set(YAJL_INCLUDE_DIRS) - set(YALJ_LIBRARIES) - endif() - list(APPEND YAJL_DEFINITIONS -DYAJL_MAJOR=${YAJL_VERSION_MAJOR}) + + string(REGEX REPLACE ".*YAJL_MAJOR ([0-9]+).*" "\\1" yajl_major "${yajl_version_str}") + string(REGEX REPLACE ".*YAJL_MINOR ([0-9]+).*" "\\1" yajl_minor "${yajl_version_str}") + string(REGEX REPLACE ".*YAJL_MICRO ([0-9]+).*" "\\1" yajl_micro "${yajl_version_str}") + set(YAJL_VERSION_STRING "${yajl_major}.${yajl_minor}.${yajl_micro}") + unset(yajl_version_str) + unset(yajl_major) + unset(yajl_minor) + unset(yajl_micro) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Yajl DEFAULT_MSG YAJL_INCLUDE_DIRS YAJL_LIBRARIES) +find_package_handle_standard_args(Yajl + REQUIRED_VARS YAJL_LIBRARY YAJL_INCLUDE_DIR + VERSION_VAR YAJL_VERSION_STRING) + +if(YAJL_FOUND) + set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR}) + set(YAJL_LIBRARIES ${YAJL_LIBRARY}) + + if(NOT TARGET Yajl::Yajl) + add_library(Yajl::Yajl UNKNOWN IMPORTED) + set_target_properties(Yajl::Yajl PROPERTIES + IMPORTED_LOCATION "${YAJL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${YAJL_INCLUDE_DIR}") + endif() +endif() -mark_as_advanced(YAJL_INCLUDE_DIRS YAJL_LIBRARIES YAJL_DEFINITIONS) +mark_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 @@ +option(ENABLE_LDGOLD "Use GNU gold linker" ON) + +set(LDGOLD_FOUND FALSE) +if(ENABLE_LDGOLD) + execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) + if(LD_VERSION MATCHES "GNU gold") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") + set(LDGOLD_FOUND TRUE) + message(STATUS "Linker: GNU gold") + else() + message(WARNING "GNU gold linker is not available, falling back to default system linker") + endif() +else() + message(STATUS "Linker: Default system linker") +endif() + +set(DEFAULT_ENABLE_DEBUGFISSION FALSE) +if(CMAKE_BUILD_TYPE STREQUAL Debug OR + CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND + LDGOLD_FOUND) + set(DEFAULT_ENABLE_DEBUGFISSION TRUE) +endif() + +include(CMakeDependentOption) +cmake_dependent_option(ENABLE_DEBUGFISSION "Enable Debug Fission support" ON + "DEFAULT_ENABLE_DEBUGFISSION" OFF) + +set(DEBUGFISSION_FOUND FALSE) +if(ENABLE_DEBUGFISSION) + include(TestCXXAcceptsFlag) + check_cxx_accepts_flag(-gsplit-dwarf CXX_ACCEPTS_GSPLIT_DWARF) + if(CXX_ACCEPTS_GSPLIT_DWARF) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gsplit-dwarf") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gsplit-dwarf") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") + set(DEBUGFISSION_FOUND TRUE) + message(STATUS "Debug Fission enabled") + else() + message(WARNING "Debug Fission is not available") + endif() +endif() 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 @@ +#.rst: +# ECMEnableSanitizers +# ------------------- +# +# Enable compiler sanitizer flags. +# +# The following sanitizers are supported: +# +# - Address Sanitizer +# - Memory Sanitizer +# - Thread Sanitizer +# - Leak Sanitizer +# - Undefined Behaviour Sanitizer +# +# All of them are implemented in Clang, depending on your version, and +# there is an work in progress in GCC, where some of them are currently +# implemented. +# +# This module will check your current compiler version to see if it +# supports the sanitizers that you want to enable +# +# Usage +# ===== +# +# Simply add:: +# +# include(ECMEnableSanitizers) +# +# to your ``CMakeLists.txt``. Note that this module is included in +# KDECompilerSettings, so projects using that module do not need to also +# include this one. +# +# The sanitizers are not enabled by default. Instead, you must set +# ``ECM_ENABLE_SANITIZERS`` (either in your ``CMakeLists.txt`` or on the +# command line) to a semicolon-separated list of sanitizers you wish to enable. +# The options are: +# +# - address +# - memory +# - thread +# - leak +# - undefined +# +# The sanitizers "address", "memory" and "thread" are mutually exclusive. You +# cannot enable two of them in the same build. +# +# "leak" requires the "address" sanitizer. +# +# .. note:: +# +# To reduce the overhead induced by the instrumentation of the sanitizers, it +# is advised to enable compiler optimizations (``-O1`` or higher). +# +# Example +# ======= +# +# This is an example of usage:: +# +# mkdir build +# cd build +# cmake -DECM_ENABLE_SANITIZERS='address;leak;undefined' .. +# +# .. note:: +# +# Most of the sanitizers will require Clang. To enable it, use:: +# +# -DCMAKE_CXX_COMPILER=clang++ +# +# Since 1.3.0. + +#============================================================================= +# Copyright 2014 Mathieu Tarral +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file COPYING-CMAKE-SCRIPTS for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of extra-cmake-modules, substitute the full +# License text for the above reference.) + +# MACRO check_compiler_version +#----------------------------- +macro (check_compiler_version gcc_required_version clang_required_version) + if ( + ( + CMAKE_CXX_COMPILER_ID MATCHES "GNU" + AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_required_version} + ) + OR + ( + CMAKE_CXX_COMPILER_ID MATCHES "Clang" + AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${clang_required_version} + ) + ) + # error ! + message(FATAL_ERROR "You ask to enable the sanitizer ${CUR_SANITIZER}, + but your compiler ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION} + does not support it ! + You should use at least GCC ${gcc_required_version} or Clang ${clang_required_version} + (99.99 means not implemented yet)") + endif () +endmacro () + +# MACRO check_compiler_support +#------------------------------ +macro (enable_sanitizer_flags sanitize_option) + if (${sanitize_option} MATCHES "address") + check_compiler_version("4.8" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") + set(XSAN_LINKER_FLAGS "asan") + elseif (${sanitize_option} MATCHES "thread") + check_compiler_version("4.8" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=thread") + set(XSAN_LINKER_FLAGS "tsan") + elseif (${sanitize_option} MATCHES "memory") + check_compiler_version("99.99" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=memory") + elseif (${sanitize_option} MATCHES "leak") + check_compiler_version("4.9" "3.4") + set(XSAN_COMPILE_FLAGS "-fsanitize=leak") + set(XSAN_LINKER_FLAGS "lsan") + elseif (${sanitize_option} MATCHES "undefined") + check_compiler_version("4.9" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls") + else () + message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.") + endif () +endmacro () + +# for each element of the ECM_ENABLE_SANITIZERS list +foreach ( CUR_SANITIZER ${ECM_ENABLE_SANITIZERS} ) + # lowercase filter + string(TOLOWER ${CUR_SANITIZER} CUR_SANITIZER) + # check option and enable appropriate flags + enable_sanitizer_flags ( ${CUR_SANITIZER} ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" ) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + link_libraries(${XSAN_LINKER_FLAGS}) + endif() + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") + endif () +endforeach () diff --git a/project/cmake/scripts/android/ArchSetup.cmake b/project/cmake/scripts/android/ArchSetup.cmake new file mode 100644 index 0000000..281f94f --- /dev/null +++ b/project/cmake/scripts/android/ArchSetup.cmake @@ -0,0 +1,35 @@ +if(NOT CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md") +elseif(NOT SDK_PLATFORM) + message(FATAL_ERROR "Toolchain did not define SDK_PLATFORM. Possibly outdated depends.") +endif() + +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) +set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) +set(PLATFORM_DIR linux) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL armeabi-v7a) + set(ARCH arm) + set(NEON True) + elseif(CPU STREQUAL arm64-v8a) + set(ARCH aarch64) + elseif(CPU STREQUAL i686) + set(ARCH i486-linux) + set(NEON False) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() +endif() + +set(FFMPEG_OPTS --enable-cross-compile --cpu=cortex-a9 --arch=arm --target-os=linux --enable-neon + --disable-vdpau --cc=${CMAKE_C_COMPILER} --host-cc=${CMAKE_C_COMPILER} + --strip=${CMAKE_STRIP}) +set(ENABLE_SDL OFF CACHE BOOL "" FORCE) +set(ENABLE_X11 OFF CACHE BOOL "" FORCE) +set(ENABLE_AML OFF CACHE BOOL "" FORCE) +set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) + +list(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 @@ +# Android packaging + +find_program(AAPT_EXECUTABLE aapt PATHS ${SDK_BUILDTOOLS_PATH}) +if(NOT AAPT_EXECUTABLE) + message(FATAL_ERROR "Could NOT find aapt executable") +endif() +find_program(DX_EXECUTABLE dx PATHS ${SDK_BUILDTOOLS_PATH}) +if(NOT DX_EXECUTABLE) + message(FATAL_ERROR "Could NOT find dx executable") +endif() +find_program(ZIPALIGN_EXECUTABLE zipalign PATHS ${SDK_BUILDTOOLS_PATH}) +if(NOT ZIPALIGN_EXECUTABLE) + message(FATAL_ERROR "Could NOT find zipalign executable") +endif() + +# Configure files into packaging environment. +configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/Makefile.in + ${CMAKE_BINARY_DIR}/tools/android/packaging/Makefile @ONLY) +configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/apksign + ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY) +configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh + ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY) +file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include + "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n") + +set(package_files strings.xml + activity_main.xml + AndroidManifest.xml + src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java + src/org/xbmc/kodi/XBMCInputDeviceListener.java + src/org/xbmc/kodi/Main.java + src/org/xbmc/kodi/XBMCSettingsContentObserver.java + src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java + src/org/xbmc/kodi/XBMCVideoView.java + src/org/xbmc/kodi/Splash.java + src/org/xbmc/kodi/XBMCBroadcastReceiver.java) +foreach(file IN LISTS package_files) + configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in + ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/${file} @ONLY) +endforeach() + +# Copy files to the location expected by the Android packaging scripts. +add_custom_target(bundle + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/media + ${CMAKE_BINARY_DIR}/tools/android/packaging/media + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/res + ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7 + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC} + COMMAND ${CMAKE_COMMAND} -E copy $ + ${libdir}/${APP_NAME_LC}/$) +add_dependencies(bundle ${APP_NAME_LC}) + +# This function is used to prepare a prefix expected by the Android packaging +# scripts. It creates a bundle_files command that is added to the bundle target. +function(add_bundle_file file destination relative) + if(NOT TARGET bundle_files) + file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake) + add_custom_target(bundle_files COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake) + add_dependencies(bundle bundle_files) + endif() + + string(REPLACE "${relative}/" "" outfile ${file}) + get_filename_component(file ${file} REALPATH) + get_filename_component(outdir ${outfile} DIRECTORY) + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake + "file(COPY \"${file}\" DESTINATION \"${destination}/${outdir}\")\n") + if(file MATCHES "\\.so\\..+$") + get_filename_component(srcfile "${file}" NAME) + string(REGEX REPLACE "\\.so\\..+$" "\.so" destfile ${srcfile}) + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake + "file(RENAME \"${destination}/${outdir}/${srcfile}\" \"${destination}/${outdir}/${destfile}\")\n") + endif() +endfunction() + +# Copy files into prefix +foreach(file IN LISTS XBT_FILES install_data) + string(REPLACE "${CMAKE_BINARY_DIR}/" "" file ${file}) + add_bundle_file(${CMAKE_BINARY_DIR}/${file} ${datarootdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR}) +endforeach() + +foreach(library IN LISTS LIBRARY_FILES) + add_bundle_file(${library} ${libdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR}) +endforeach() + +foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay) + string(TOUPPER ${lib} lib_up) + set(lib_so ${${lib_up}_SONAME}) + if(lib_so AND EXISTS ${DEPENDS_PATH}/lib/${lib_so}) + add_bundle_file(${DEPENDS_PATH}/lib/${lib_so} ${libdir} "") + endif() +endforeach() +add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") +add_bundle_file(${DEPENDS_PATH}/lib/librtmp.so ${libdir} "") + +# Main targets from Makefile.in +if(CPU MATCHES i686) + set(CPU x86) + set(ARCH x86) +endif() +foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign) + add_custom_target(${target} + COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} ${CMAKE_MAKE_PROGRAM} + -C ${CMAKE_BINARY_DIR}/tools/android/packaging + CORE_SOURCE_DIR=${CORE_SOURCE_DIR} + CC=${CMAKE_C_COMPILER} + CPU=${CPU} + ARCH=${ARCH} + PREFIX=${prefix} + NDKROOT=${NDKROOT} + SDKROOT=${SDKROOT} + SDK_PLATFORM=${SDK_PLATFORM} + STRIP=${CMAKE_STRIP} + AAPT=${AAPT_EXECUTABLE} + DX=${DX_EXECUTABLE} + ZIPALIGN=${ZIPALIGN_EXECUTABLE} + ${target} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/android/packaging + ) + if(NOT target STREQUAL apk-clean) + add_dependencies(${target} bundle) + endif() +endforeach() 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/android/PathSetup.cmake b/project/cmake/scripts/android/PathSetup.cmake new file mode 100644 index 0000000..69de883 --- /dev/null +++ b/project/cmake/scripts/android/PathSetup.cmake @@ -0,0 +1,33 @@ +if(NOT prefix) + set(prefix ${CMAKE_BINARY_DIR}/install) +endif() +set(CMAKE_INSTALL_PREFIX ${prefix}) +if(NOT exec_prefix) + set(exec_prefix ${prefix}) +endif() +if(NOT libdir) + set(libdir ${prefix}/lib) +endif() +if(NOT bindir) + set(bindir ${prefix}/bin) +endif() +if(NOT includedir) + set(includedir ${prefix}/include) +endif() +if(NOT datarootdir) + set(datarootdir ${prefix}/share) +endif() +if(NOT datadir) + set(datadir ${datarootdir}) +endif() + +list(APPEND final_message "-- PATH config --") +list(APPEND final_message "Prefix: ${prefix}") +list(APPEND final_message "Libdir: ${libdir}") +list(APPEND final_message "Bindir: ${bindir}") +list(APPEND final_message "Includedir: ${includedir}") +list(APPEND final_message "Datarootdir: ${datarootdir}") +list(APPEND final_message "Datadir: ${datadir}") + +set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" + -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/android/archsetup.cmake b/project/cmake/scripts/android/archsetup.cmake deleted file mode 100644 index 86c0f6a..0000000 --- a/project/cmake/scripts/android/archsetup.cmake +++ /dev/null @@ -1,30 +0,0 @@ -if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md") -endif() - -set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) -set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED - -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) -set(PLATFORM_DIR linux) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL armeabi-v7a) - set(ARCH arm-linux-androideabi) - elseif(CPU STREQUAL i686) - set(ARCH i686-linux-android) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -set(FFMPEG_OPTS --enable-cross-compile --cpu=cortex-a9 --arch=arm --target-os=linux --enable-neon - --disable-vdpau --cc=${CMAKE_C_COMPILER} --host-cc=${CMAKE_C_COMPILER} - --strip=${CMAKE_STRIP}) -set(ENABLE_SDL OFF) -set(ENABLE_X11 OFF) -set(ENABLE_EGL ON) -set(ENABLE_AML ON) -set(ENABLE_OPTICAL OFF) - -list(APPEND DEPLIBS android log jnigraphics) diff --git a/project/cmake/scripts/android/install.cmake b/project/cmake/scripts/android/install.cmake deleted file mode 100644 index e69de29..0000000 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 @@ -../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 @@ -../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 @@ +# - Add options without repeating them on the command line +# +# Synopsis: +# +# add_options (lang build opts) +# +# where: +# +# lang Name of the language whose compiler should receive the +# options, e.g. CXX. If a comma-separated list is received +# then the option is added for all those languages. Use the +# special value ALL_LANGUAGES for these languages: CXX, C +# and Fortran +# +# build Kind of build to which this options should apply, +# such as DEBUG and RELEASE. This can also be a comma- +# separated list. Use the special value ALL_BUILDS to apply +# to all builds. +# +# opts List of options to add. Each should be quoted. +# +# Example: +# +# add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall") + +function(add_options langs builds) + # special handling of empty language specification + if("${langs}" STREQUAL "ALL_LANGUAGES") + set(langs CXX C Fortran) + endif() + foreach(lang IN LISTS langs) + # prepend underscore if necessary + foreach(build IN LISTS builds) + if(NOT ("${build}" STREQUAL "ALL_BUILDS")) + set(_bld "_${build}") + string(TOUPPER "${_bld}" _bld) + else() + set(_bld "") + endif() + foreach(_opt IN LISTS ARGN) + set(_var "CMAKE_${lang}_FLAGS${_bld}") + #message(STATUS "Adding \"${_opt}\" to \${${_var}}") + # remove it first + string(REPLACE "${_opt}" "" _without "${${_var}}") + string(STRIP "${_without}" _without) + # we need to strip this one as well, so they are comparable + string(STRIP "${${_var}}" _stripped) + # if it wasn't there, then add it at the end + if("${_without}" STREQUAL "${_stripped}") + # don't add any extra spaces if no options yet are set + if(NOT ${_stripped} STREQUAL "") + set(${_var} "${_stripped} ${_opt}") + else() + set(${_var} "${_opt}") + endif() + set(${_var} "${${_var}}" PARENT_SCOPE) + endif() + endforeach() + endforeach() + endforeach() +endfunction() + +# set varname to flag unless user has specified something that matches regex +function(set_default_option varname flag regex) + if(NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" + AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" + AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") + set(${varname} ${flag} PARENT_SCOPE) + else() + set(${varname} PARENT_SCOPE) + endif() +endfunction() + +# note: this must be called before project() +macro(no_default_options) + # prevent the platform probe to set options + set(CMAKE_NOT_USING_CONFIG_FLAGS TRUE) +endmacro() 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 @@ +# Workaround for the fact that cpack's filenames are not customizable. +# Each add-on is added as a separate component to facilitate zip/tgz packaging. +# The filenames are always of the form basename-component, which is +# incompatible with the addonid-version scheme we want. This hack renames +# the files from the file names generated by the 'package' target. +# Sadly we cannot extend the 'package' target, as it is a builtin target, see +# http://public.kitware.com/Bug/view.php?id=8438 +# Thus, we have to add an 'addon-package' target. +add_custom_target(addon-package + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) + +macro(add_cpack_workaround target version ext) + if(NOT PACKAGE_DIR) + set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips") + endif() + + add_custom_command(TARGET addon-package PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext}) +endmacro() + +# Grab the version from a given add-on's addon.xml +macro (addon_version dir prefix) + if(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in) + file(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML) + else() + file(READ ${dir}/addon.xml ADDONXML) + endif() + + string(REGEX MATCH "]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) + string(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) + message(STATUS ${prefix}_VERSION=${${prefix}_VERSION}) +endmacro() + +# Build, link and optionally package an add-on +macro (build_addon target prefix libs) + addon_version(${target} ${prefix}) + if(${prefix}_SOURCES) + add_library(${target} ${${prefix}_SOURCES}) + target_link_libraries(${target} ${${libs}}) + set_target_properties(${target} PROPERTIES VERSION ${${prefix}_VERSION} + SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} + PREFIX "") + if(OS STREQUAL "android") + set_target_properties(${target} PROPERTIES PREFIX "lib") + endif() + elseif(${prefix}_CUSTOM_BINARY) + add_custom_target(${target} ALL) + endif() + + # get the library's location + if(${prefix}_CUSTOM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 0 LIBRARY_LOCATION) + list(GET ${prefix}_CUSTOM_BINARY 1 LIBRARY_FILENAME) + else() + set(LIBRARY_LOCATION $) + # get the library's filename + if("${CORE_SYSTEM_NAME}" STREQUAL "android") + # for android we need the filename without any version numbers + set(LIBRARY_FILENAME $) + else() + set(LIBRARY_FILENAME $) + endif() + endif() + + # if there's an addon.xml.in we need to generate the addon.xml + if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) + set(PLATFORM ${CORE_SYSTEM_NAME}) + + file(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file) + string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) + file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") + if(${APP_NAME_UC}_BUILD_DIR) + file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}") + endif() + endif() + + # if there's an settings.xml.in we need to generate the settings.xml + if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in) + set(PLATFORM ${CORE_SYSTEM_NAME}) + + file(READ ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml.in settings_file) + string(CONFIGURE "${settings_file}" settings_file_conf @ONLY) + file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/resources/settings.xml CONTENT "${settings_file_conf}") + if(${APP_NAME_UC}_BUILD_DIR) + file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources/settings.xml CONTENT "${settings_file_conf}") + endif() + endif() + + # set zip as default if addon-package is called without PACKAGE_XXX + set(CPACK_GENERATOR "ZIP") + set(ext "zip") + if(PACKAGE_ZIP OR PACKAGE_TGZ) + if(PACKAGE_TGZ) + set(CPACK_GENERATOR "TGZ") + set(ext "tar.gz") + endif() + set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) + set(CPACK_PACKAGE_FILE_NAME addon) + if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CPACK_STRIP_FILES TRUE) + endif() + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + set(CPACK_COMPONENTS_IGNORE_GROUPS 1) + list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) + # Pack files together to create an archive + install(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "xml.in" EXCLUDE) + if(WIN32) + if(NOT CPACK_PACKAGE_DIRECTORY) + # determine the temporary path + file(TO_CMAKE_PATH "$ENV{TEMP}" WIN32_TEMP_PATH) + string(LENGTH "${WIN32_TEMP_PATH}" WIN32_TEMP_PATH_LENGTH) + string(LENGTH "${PROJECT_BINARY_DIR}" PROJECT_BINARY_DIR_LENGTH) + + # check if the temporary path is shorter than the default packaging directory path + if(WIN32_TEMP_PATH_LENGTH GREATER 0 AND WIN32_TEMP_PATH_LENGTH LESS PROJECT_BINARY_DIR_LENGTH) + # set the directory used by CPack for packaging to the temp directory + set(CPACK_PACKAGE_DIRECTORY ${WIN32_TEMP_PATH}) + endif() + endif() + + # in case of a VC++ project the installation location contains a $(Configuration) VS variable + # we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration + # is changed within Visual Studio) + string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}") + + if(${prefix}_SOURCES) + # install the generated DLL file + install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}) + + if(CMAKE_BUILD_TYPE MATCHES Debug) + # for debug builds also install the PDB file + get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY) + install(FILES $ DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}) + endif() + endif() + if (${prefix}_CUSTOM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) + install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY}) + endif() + if(${prefix}_CUSTOM_DATA) + install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) + endif() + else() + if(NOT CPACK_PACKAGE_DIRECTORY) + set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}) + endif() + if(${prefix}_SOURCES) + install(TARGETS ${target} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}) + endif() + if (${prefix}_CUSTOM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) + if(OS STREQUAL "android") + set(TO_BINARY "lib${TO_BINARY}") + endif() + install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY} + COMPONENT ${target}-${${prefix}_VERSION}) + endif() + if(${prefix}_CUSTOM_DATA) + install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) + endif() + endif() + add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) + else() + if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL rbpi OR CORE_SYSTEM_NAME STREQUAL freebsd) + if(NOT OVERRIDE_PATHS) + if(CMAKE_INSTALL_PREFIX AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT CMAKE_INSTALL_PREFIX STREQUAL "${${APP_NAME_UC}_PREFIX}") + 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") + endif() + if(CMAKE_INSTALL_LIBDIR AND NOT CMAKE_INSTALL_LIBDIR STREQUAL "${${APP_NAME_UC}_LIB_DIR}") + 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") + endif() + if(CMAKE_INSTALL_DATADIR AND NOT CMAKE_INSTALL_DATADIR STREQUAL "${${APP_NAME_UC}_DATA_DIR}") + 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") + endif() + set(CMAKE_INSTALL_PREFIX "${${APP_NAME_UC}_PREFIX}" CACHE PATH "${APP_NAME} install prefix" FORCE) + set(CMAKE_INSTALL_LIBDIR "${${APP_NAME_UC}_LIB_DIR}" CACHE PATH "${APP_NAME} install libdir" FORCE) + set(CMAKE_INSTALL_DATADIR "${${APP_NAME_UC}_DATA_DIR}" CACHE PATH "${APP_NAME} install datadir" FORCE) + else() + if(NOT CMAKE_INSTALL_LIBDIR) + set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}") + endif() + if(NOT CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_PREFIX}/share/${APP_NAME_LC}") + endif() + endif() + else() + set(CMAKE_INSTALL_LIBDIR "lib/${APP_NAME_LC}") + set(CMAKE_INSTALL_DATADIR "share/${APP_NAME_LC}") + endif() + if(${prefix}_SOURCES) + install(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) + endif() + if (${prefix}_CUSTOM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) + list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) + if(OS STREQUAL "android") + set(TO_BINARY "lib${TO_BINARY}") + endif() + install(FILES ${FROM_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${TO_BINARY}) + endif() + install(DIRECTORY ${target} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons PATTERN "xml.in" EXCLUDE) + if(${prefix}_CUSTOM_DATA) + install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/addons/${target}/resources) + endif() + endif() + if(${APP_NAME_UC}_BUILD_DIR) + file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*) + if(${prefix}_CUSTOM_DATA) + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${${prefix}_CUSTOM_DATA} + ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources) + endif() + foreach(file ${files}) + string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${target}/" "" name "${file}") + # A good way to deal with () in filenames + if(NOT ${file} MATCHES xml.in) + configure_file(${file} ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${name} COPYONLY) + endif() + endforeach() + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${LIBRARY_LOCATION} + ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/${LIBRARY_FILENAME}) + endif() +endmacro() + +# finds a path to a given file (recursive) +function (kodi_find_path var_name filename search_path strip_file) + file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename}) + if(strip_file) + string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE}) + endif() + set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE) +endfunction() + +# Cmake build options +include(AddOptions) +include(TestCXXAcceptsFlag) +option(PACKAGE_ZIP "Package Zip file?" OFF) +option(PACKAGE_TGZ "Package TGZ file?" OFF) +option(BUILD_SHARED_LIBS "Build shared libs?" ON) + +# LTO support? +CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO) +if(HAVE_LTO) + option(USE_LTO "use link time optimization" OFF) + if(USE_LTO) + add_options(ALL_LANGUAGES ALL_BUILDS "-flto") + endif() +endif() + +# set this to try linking dependencies as static as possible +if(ADDONS_PREFER_STATIC_LIBS) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) +endif() + +if(${APP_NAME_UC}_BUILD_DIR) + list(APPEND CMAKE_PREFIX_PATH ${${APP_NAME_UC}_BUILD_DIR}/build) +endif() diff --git a/project/cmake/scripts/common/ArchSetup.cmake b/project/cmake/scripts/common/ArchSetup.cmake new file mode 100644 index 0000000..438e3bd --- /dev/null +++ b/project/cmake/scripts/common/ArchSetup.cmake @@ -0,0 +1,150 @@ +# This script configures the build for a given architecture. +# Flags and stringified arch is set up. +# General compiler tests belongs here. +# +# On return, the following variables are set: +# CMAKE_SYSTEM_NAME - a lowercased system name +# CPU - the CPU on the target +# ARCH - the system architecture +# ARCH_DEFINES - list of compiler definitions for this architecture +# SYSTEM_DEFINES - list of compiler definitions for this system +# DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC) +# + the results of compiler tests etc. + +include(CheckCXXSourceCompiles) +include(CheckSymbolExists) +include(CheckFunctionExists) + +# Macro to check if a given type exists in a given header +# Arguments: +# header the header to check +# type the type to check for existence +# var the compiler definition to set if type exists +# On return: +# If type was found, the definition is added to SYSTEM_DEFINES +macro(check_type header type var) + check_cxx_source_compiles("#include <${header}> + int main() + { + ${type} s; + }" ${var}) + if(${var}) + list(APPEND SYSTEM_DEFINES -D${var}=1) + endif() +endmacro() + +# Macro to check if a given builtin function exists +# Arguments: +# func the function to check +# var the compiler definition to set if type exists +# On return: +# If type was found, the definition is added to SYSTEM_DEFINES +macro(check_builtin func var) + check_cxx_source_compiles(" + int main() + { + ${func}; + }" ${var}) + if(${var}) + list(APPEND SYSTEM_DEFINES -D${var}=1) + endif() +endmacro() + + +# -------- Main script --------- +message(STATUS "System type: ${CMAKE_SYSTEM_NAME}") +if(NOT CORE_SYSTEM_NAME) + string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) +endif() + +if(WITH_CPU) + set(CPU ${WITH_CPU}) +elseif(NOT CMAKE_TOOLCHAIN_FILE) + set(CPU ${CMAKE_SYSTEM_PROCESSOR}) +endif() + +if(CMAKE_TOOLCHAIN_FILE) + if(NOT EXISTS "${CMAKE_TOOLCHAIN_FILE}") + message(FATAL_ERROR "Toolchain file ${CMAKE_TOOLCHAIN_FILE} does not exist.") + elseif(NOT DEPENDS_PATH OR NOT NATIVEPREFIX) + message(FATAL_ERROR "Toolchain did not define DEPENDS_PATH or NATIVEPREFIX. Possibly outdated depends.") + endif() +endif() + +# While CMAKE_CROSSCOMPILING is set unconditionally if there's a toolchain file, +# this variable is set if we can execute build artefacts on the host system (for example unit tests). +if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR AND + CMAKE_HOST_SYSTEM_NAME STREQUAL CMAKE_SYSTEM_NAME) + set(CORE_HOST_IS_TARGET TRUE) +else() + set(CORE_HOST_IS_TARGET FALSE) +endif() + +# Main cpp +set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp) + +# system specific arch setup +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) + message(FATAL_ERROR "Couldn't find configuration for '${CORE_SYSTEM_NAME}' " + "Either the platform is not (yet) supported " + "or a toolchain file has to be specified. " + "Consult ${CMAKE_SOURCE_DIR}/README.md for instructions. " + "Note: Specifying a toolchain requires a clean build directory!") +endif() +include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) + +message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") +message(STATUS "Platform: ${PLATFORM}") +message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") +message(STATUS "Cross-Compiling: ${CMAKE_CROSSCOMPILING}") +message(STATUS "Execute build artefacts on host: ${CORE_HOST_IS_TARGET}") + +check_type(string std::u16string HAVE_STD__U16_STRING) +check_type(string std::u32string HAVE_STD__U32_STRING) +check_type(string char16_t HAVE_CHAR16_T) +check_type(string char32_t HAVE_CHAR32_T) +check_type(stdint.h uint_least16_t HAVE_STDINT_H) +check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) +check_symbol_exists(PRIdMAX inttypes.h HAVE_INTTYPES_H) +check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) +check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH) +check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP) +if(HAVE_POSIX_FADVISE) + list(APPEND SYSTEM_DEFINES -DHAVE_POSIX_FADVISE=1) +endif() +check_function_exists(localtime_r HAVE_LOCALTIME_R) +if(HAVE_LOCALTIME_R) + list(APPEND SYSTEM_DEFINES -DHAVE_LOCALTIME_R=1) +endif() +if(HAVE_INTTYPES_H) + list(APPEND SYSTEM_DEFINES -DHAVE_INTTYPES_H=1) +endif() + +find_package(SSE) +foreach(_sse SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 AVX AVX2) + if(${${_sse}_FOUND}) + # enable SSE versions up to 4.1 by default, if available + if(NOT ${_sse} MATCHES "AVX" AND NOT ${_sse} STREQUAL "SSE4_2") + option(ENABLE_${_sse} "Enable ${_sse}" ON) + else() + option(ENABLE_${_sse} "Enable ${_sse}" OFF) + endif() + endif() + if(ENABLE_${_sse}) + set(HAVE_${_sse} TRUE CACHE STRING "${_sse} enabled") + list(APPEND ARCH_DEFINES -DHAVE_${_sse}=1) + endif() +endforeach() + +if(NOT DEFINED NEON OR NEON) + option(ENABLE_NEON "Enable NEON optimization" ${NEON}) + if(ENABLE_NEON) + message(STATUS "NEON optimization enabled") + add_options(CXX ALL_BUILDS "-mfpu=neon -mvectorize-with-neon-quad") + endif() +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_options (ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall") +endif() + 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 @@ +# This file contains functions that support the debugging of the CMake files. + +# This file shouldn't be included per default in any CMake file. It should be +# included and used only on demand. All functions are prefixed with "debug_". +# +# Usage: +# include(scripts/common/CMakeHelpers.cmake) +# debug_print_variables() + +# Print all CMake variables. +macro(debug_print_variables) + get_cmake_property(_variableNames VARIABLES) + foreach(_variableName ${_variableNames}) + message(STATUS "${_variableName} = ${${_variableName}}") + endforeach() +endmacro() + +# Get all properties that CMake supports and convert them to a list. +function(debug_get_properties VAR) + execute_process(COMMAND cmake --help-property-list + OUTPUT_VARIABLE _properties) + string(REGEX REPLACE ";" "\\\\;" _properties "${_properties}") + string(REGEX REPLACE "\n" ";" _properties "${_properties}") + list(REMOVE_DUPLICATES _properties) + list(REMOVE_ITEM _properties LOCATION) + set(${VAR} ${_properties} PARENT_SCOPE) +endfunction() + +# List all properties. +function(debug_list_properties) + debug_get_properties(_properties) + message("CMake properties = ${_properties}") +endfunction() + +# Print all set properties of a specified target. +function(debug_print_target_properties target) + if(NOT TARGET ${target}) + message(FATAL_ERROR "There is no target named '${target}'") + endif() + + debug_get_properties(_properties) + + # Reading LOCATION property is deprecated and triggers a fatal error. + string(REGEX REPLACE ";LOCATION;|LOCATION" "" _properties "${_properties}") + string(REGEX REPLACE "" "${CMAKE_BUILD_TYPE}" _properties + "${_properties}") + foreach(_property ${_properties}) + get_property(_value TARGET ${target} PROPERTY ${_property} SET) + if(_value) + get_target_property(_value ${target} ${_property}) + message("${target} ${_property} = ${_value}") + endif() + endforeach() +endfunction() diff --git a/project/cmake/scripts/common/CheckCommits.cmake b/project/cmake/scripts/common/CheckCommits.cmake new file mode 100644 index 0000000..304e623 --- /dev/null +++ b/project/cmake/scripts/common/CheckCommits.cmake @@ -0,0 +1,75 @@ +find_package(Git REQUIRED) + +macro(sanity_check message) + if(status_code) + message(FATAL_ERROR "${message}") + endif() +endmacro() + +# Check that there are no changes in working-tree +execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet + RESULT_VARIABLE status_code) +sanity_check("Cannot run with working tree changes. Commit, stash or drop them.") + +# Setup base of tests +set(check_base $ENV{CHECK_BASE}) +if(NOT check_base) + set(check_base origin/master) +endif() + +# Setup end of tests +set(check_head $ENV{CHECK_HEAD}) +if(NOT check_head) + set(check_head HEAD) +endif() + +# Setup target to build +set(check_target $ENV{CHECK_TARGET}) +if(NOT check_target) + set(check_target check) +endif() + +# Build threads +set(build_threads $ENV{CHECK_THREADS}) +if(NOT build_threads) + if(UNIX) + execute_process(COMMAND nproc + OUTPUT_VARIABLE build_threads) + string(REGEX REPLACE "(\r?\n)+$" "" build_threads "${build_threads}") + endif() +endif() + +# Record current HEAD +execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + OUTPUT_VARIABLE current_branch) + +string(REGEX REPLACE "(\r?\n)+$" "" current_branch "${current_branch}") + +# Grab revision list +execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${check_base}..${check_head} --reverse + OUTPUT_VARIABLE rev_list) + +string(REPLACE "\n" ";" rev_list ${rev_list}) +foreach(rev ${rev_list}) + # Checkout + message("Testing revision ${rev}") + execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${rev} + RESULT_VARIABLE status_code) + sanity_check("Failed to checkout ${rev}") + + # Build + if(build_threads GREATER 2) + execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${check_target}" "--use-stderr" "--" "-j${build_threads}" + RESULT_VARIABLE status_code) + else() + execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${check_target}" "--use-stderr" + RESULT_VARIABLE status_code) + endif() + if(status_code) + execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}) + endif() + sanity_check("Failed to build target for revision ${rev}") +endforeach() + +message("Everything checks out fine") +execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}) diff --git a/project/cmake/scripts/common/CheckTargetPlatform.cmake b/project/cmake/scripts/common/CheckTargetPlatform.cmake new file mode 100644 index 0000000..5b5d9a1 --- /dev/null +++ b/project/cmake/scripts/common/CheckTargetPlatform.cmake @@ -0,0 +1,63 @@ +# handle target platforms +function(check_target_platform dir target_platform build) + # param[in] dir path/directory of the addon/dependency + # param[in] target_platform target platform of the build + # param[out] build Result whether the addon/dependency should be built for the specified target platform + + set(${build} FALSE) + # check if the given directory exists and contains a platforms.txt + if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt) + # get all the specified platforms + file(STRINGS ${dir}/platforms.txt platforms) + string(REPLACE " " ";" platforms ${platforms}) + + # check if the addon/dependency should be built for the current platform + foreach(platform ${platforms}) + if(${platform} STREQUAL "all" OR ${platform} STREQUAL ${target_platform}) + set(${build} TRUE) + else() + # check if the platform is defined as "!" + string(SUBSTRING ${platform} 0 1 platform_first) + if(${platform_first} STREQUAL "!") + # extract the platform + string(LENGTH ${platform} platform_length) + math(EXPR platform_length "${platform_length} - 1") + string(SUBSTRING ${platform} 1 ${platform_length} platform) + + # check if the current platform does not match the extracted platform + if(NOT ${platform} STREQUAL ${target_platform}) + set(${build} TRUE) + endif() + endif() + endif() + endforeach() + else() + set(${build} TRUE) + endif() + + # make the ${build} variable available to the calling script + set(${build} "${${build}}" PARENT_SCOPE) +endfunction() + +function(check_install_permissions install_dir have_perms) + # param[in] install_dir directory to check for write permissions + # param[out] have_perms wether we have permissions to install to install_dir + + set(testfile_lib ${install_dir}/lib/kodi/.cmake-inst-test) + set(testfile_share ${install_dir}/share/kodi/.cmake-inst-test) + get_filename_component(testdir_lib ${testfile_lib} DIRECTORY) + get_filename_component(testdir_share ${testfile_share} DIRECTORY) + + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_lib}) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_share}) + execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_lib}) + execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_share}) + + if(EXISTS ${testfile_lib} AND EXISTS ${testfile_share}) + set(${have_perms} True PARENT_SCOPE) + else() + message(STATUS "check_install_permissions ${install_dir}: failed to create files") + set(${have_perms} False PARENT_SCOPE) + endif() + file(REMOVE ${testfile_lib} ${testfile_share}) +endfunction() 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 @@ +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) + +core_find_versions() +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon) +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/kodi.guilib) + +# configure_file without dependency tracking +# configure_file would register additional file dependencies that interfere +# with the ones from add_custom_command (and the generation would happen twice) +function(generate_versioned_file _SRC _DEST) + file(READ ${CORE_SOURCE_DIR}/${_SRC} file_content) + string(CONFIGURE "${file_content}" file_content @ONLY) + file(WRITE ${CMAKE_BINARY_DIR}/${_DEST} "${file_content}") +endfunction() + +generate_versioned_file(addons/xbmc.addon/addon.xml.in addons/xbmc.addon/addon.xml) +generate_versioned_file(addons/kodi.guilib/addon.xml.in addons/kodi.guilib/addon.xml) +generate_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 new file mode 100644 index 0000000..304b504 --- /dev/null +++ b/project/cmake/scripts/common/GeneratorSetup.cmake @@ -0,0 +1,49 @@ +# Configure single-/multiconfiguration generators and variables +# +# CORE_BUILD_CONFIG that is set to +# - CMAKE_BUILD_TYPE for single configuration generators such as make, nmake +# - a variable that expands on build time to the current configuration for +# multi configuration generators such as VS or Xcode +if(CMAKE_CONFIGURATION_TYPES) + if(CMAKE_BUILD_TYPE) + message(FATAL_ERROR "CMAKE_BUILD_TYPE must not be defined for multi-configuration generators") + endif() + set(CORE_BUILD_CONFIG ${CMAKE_CFG_INTDIR}) + message(STATUS "Generator: Multi-configuration (${CMAKE_GENERATOR})") +else() + if(CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} + CACHE STRING "Choose build type (${CMAKE_BUILD_TYPES})" FORCE) + else() + # Set default + set(CMAKE_BUILD_TYPE Release + CACHE STRING "Choose build type (${CMAKE_BUILD_TYPES})" FORCE) + endif() + set(CORE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) + message(STATUS "Generator: Single-configuration: ${CMAKE_BUILD_TYPE} (${CMAKE_GENERATOR})") +endif() + +# Print CMake version +message(STATUS "CMake Version: ${CMAKE_VERSION}") + +# Deal with CMake special cases +if(CMAKE_VERSION VERSION_EQUAL 3.5.1) + message(WARNING "CMake 3.5.1 introduced a crash during configuration. " + "Please consider upgrading to 3.5.2 (cmake.org/Bug/view.php?id=16044)") +endif() + +# Darwin needs CMake 3.4 +if(APPLE AND CMAKE_VERSION VERSION_LESS 3.4) + message(WARNING "Build on Darwin requires CMake 3.4 or later (tdb library support) " + "or the usage of the patched version in depends.") +endif() + +# Windows needs CMake 3.6 (VS_STARTUP_PROJECT) +if(WIN32 AND CMAKE_VERSION VERSION_LESS 3.6) + message(FATAL_ERROR "Build on Windows needs CMake 3.6 or later") +endif() + +# Ninja needs CMake 3.2 due to ExternalProject BUILD_BYPRODUCTS usage +if(CMAKE_GENERATOR STREQUAL Ninja AND CMAKE_VERSION VERSION_LESS 3.2) + message(FATAL_ERROR "Generator: Ninja requires CMake 3.2 or later") +endif() diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake new file mode 100644 index 0000000..880ccdf --- /dev/null +++ b/project/cmake/scripts/common/HandleDepends.cmake @@ -0,0 +1,219 @@ +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake) + +# handle addon depends +function(add_addon_depends addon searchpath) + # input: string addon string searchpath + + set(OUTPUT_DIR ${ADDON_DEPENDS_PATH}) + # look for platform-specific dependencies + file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) + file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) + list(APPEND cmake_input_files ${cmake_input_files2}) + + foreach(file ${cmake_input_files}) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${file}) + if(NOT (file MATCHES CMakeLists.txt OR + file MATCHES install.txt OR + file MATCHES noinstall.txt OR + file MATCHES flags.txt OR + file MATCHES deps.txt OR + file MATCHES platforms.txt)) + message(STATUS "Processing ${file}") + file(STRINGS ${file} def) + string(REPLACE " " ";" def ${def}) + list(LENGTH def deflength) + get_filename_component(dir ${file} DIRECTORY) + + # get the id of the dependency + if(NOT "${def}" STREQUAL "") + # read the id from the file + list(GET def 0 id) + else() + # read the id from the filename + get_filename_component(id ${file} NAME_WE) + endif() + + # check if the dependency has a platforms.txt + set(platform_found FALSE) + check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) + + if(${platform_found} AND NOT TARGET ${id}) + # determine the download URL of the dependency + set(url "") + if(deflength GREATER 1) + list(GET def 1 url) + message(STATUS "${id} url: ${url}") + endif() + + # check if there are any library specific flags that need to be passed on + if(EXISTS ${dir}/flags.txt) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) + file(STRINGS ${dir}/flags.txt extraflags) + string(REPLACE " " ";" extraflags ${extraflags}) + message(STATUS "${id} extraflags: ${extraflags}") + endif() + + set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DOUTPUT_DIR=${OUTPUT_DIR} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} + -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} + -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} + -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} + -DENABLE_STATIC=1 + -DBUILD_SHARED_LIBS=0) + # if there are no make rules override files available take care of manually passing on ARCH_DEFINES + if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) + # make sure we create strings, not lists + set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}") + set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}") + list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS} + -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS}) + endif() + + if(CMAKE_TOOLCHAIN_FILE) + list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) + message("toolchain specified") + message(${BUILD_ARGS}) + endif() + + # prepare patchfile. ensure we have a clean file after reconfiguring + set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) + file(REMOVE ${PATCH_FILE}) + + # if there's a CMakeLists.txt use it to prepare the build + if(EXISTS ${dir}/CMakeLists.txt) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt) + file(APPEND ${PATCH_FILE} + "file(COPY ${dir}/CMakeLists.txt + DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") + endif() + + # check if we have patches to apply + file(GLOB patches ${dir}/*.patch) + list(SORT patches) + foreach(patch ${patches}) + if(NOT PATCH_PROGRAM OR "${PATCH_PROGRAM}" STREQUAL "") + if(NOT PATCH_EXECUTABLE) + # find the path to the patch executable + find_program(PATCH_EXECUTABLE NAMES patch) + + if(NOT PATCH_EXECUTABLE) + message(FATAL_ERROR "Missing patch command (we looked in ${CMAKE_PREFIX_PATH})") + endif() + endif() + + # on windows "patch.exe" can only handle CR-LF line-endings so we + # need to force it to also handle LF-only line endings + set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) + if(WIN32) + set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") + endif() + endif() + + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch}) + file(APPEND ${PATCH_FILE} + "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") + endforeach() + + + # if there's an install.txt use it to properly install the built files + set(INSTALL_COMMAND "") + if(EXISTS ${dir}/install.txt) + set(INSTALL_COMMAND INSTALL_COMMAND ${CMAKE_COMMAND} + -DINPUTDIR=${BUILD_DIR}/${id}/src/${id}-build/ + -DINPUTFILE=${dir}/install.txt + -DDESTDIR=${OUTPUT_DIR} + -DENABLE_STATIC=1 + "${extraflags}" + -P ${PROJECT_SOURCE_DIR}/install.cmake) + elseif(EXISTS ${dir}/noinstall.txt) + set(INSTALL_COMMAND INSTALL_COMMAND "") + endif() + + # check if there's a deps.txt containing dependencies on other libraries + if(EXISTS ${dir}/deps.txt) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) + file(STRINGS ${dir}/deps.txt deps) + message(STATUS "${id} depends: ${deps}") + else() + set(deps) + endif() + + if(CROSS_AUTOCONF AND AUTOCONF_FILES) + foreach(afile ${AUTOCONF_FILES}) + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile}) + file(APPEND ${PATCH_FILE} + "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n + file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") + endforeach() + endif() + + # if the patch file exists we need to set the PATCH_COMMAND + set(PATCH_COMMAND "") + if(EXISTS ${PATCH_FILE}) + set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) + endif() + + # prepare the setup of the call to externalproject_add() + set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id} + CMAKE_ARGS ${extraflags} ${BUILD_ARGS} + PATCH_COMMAND ${PATCH_COMMAND} + "${INSTALL_COMMAND}") + + # if there's an url defined we need to pass that to externalproject_add() + if(DEFINED url AND NOT "${url}" STREQUAL "") + # check if there's a third parameter in the file + if(deflength GREATER 2) + # the third parameter is considered as a revision of a git repository + list(GET def 2 revision) + + externalproject_add(${id} + GIT_REPOSITORY ${url} + GIT_TAG ${revision} + "${EXTERNALPROJECT_SETUP}") + else() + set(CONFIGURE_COMMAND "") + if(NOT WIN32) + # manually specify the configure command to be able to pass in the custom PKG_CONFIG_PATH + set(CONFIGURE_COMMAND PKG_CONFIG_PATH=${OUTPUT_DIR}/lib/pkgconfig + ${CMAKE_COMMAND} -DCMAKE_LIBRARY_PATH=${OUTPUT_DIR}/lib ${extraflags} ${BUILD_ARGS} + ${BUILD_DIR}/${id}/src/${id} + -DPACKAGE_CONFIG_PATH=${OUTPUT_DIR}/lib/pkgconfig + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DOUTPUT_DIR=${OUTPUT_DIR} + -DCMAKE_PREFIX_PATH=${OUTPUT_DIR} + -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} + -DCMAKE_EXE_LINKER_FLAGS=-L${OUTPUT_DIR}/lib + -DCMAKE_INCLUDE_PATH=${OUTPUT_DIR}/include) + endif() + + externalproject_add(${id} + URL ${url} + DOWNLOAD_DIR ${BUILD_DIR}/download + CONFIGURE_COMMAND ${CONFIGURE_COMMAND} + "${EXTERNALPROJECT_SETUP}") + endif() + else() + externalproject_add(${id} + SOURCE_DIR ${dir} + "${EXTERNALPROJECT_SETUP}") + endif() + + if(deps) + add_dependencies(${id} ${deps}) + endif() + endif() + + # if the dependency is available for the target platform add it to the list of the addon's dependencies + # (even if the target already exists as it still has to be built before the addon) + if(${platform_found}) + list(APPEND ${addon}_DEPS ${id}) + endif() + endif() + endforeach() + + # make the ${addon}_DEPS variable available to the calling script + set(${addon}_DEPS "${${addon}_DEPS}" PARENT_SCOPE) +endfunction() + 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 @@ +# This script holds the main functions used to construct the build system + +# include system specific macros +include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/Macros.cmake) + +# IDEs: Group source files in target in folders (file system hierarchy) +# Source: http://blog.audio-tk.com/2015/09/01/sorting-source-files-and-projects-in-folders-with-cmake-and-visual-studioxcode/ +# Arguments: +# target The target that shall be grouped by folders. +# Optional Arguments: +# RELATIVE allows to specify a different reference folder. +function(source_group_by_folder target) + if(NOT TARGET ${target}) + message(FATAL_ERROR "There is no target named '${target}'") + endif() + + set(SOURCE_GROUP_DELIMITER "/") + + cmake_parse_arguments(arg "" "RELATIVE" "" ${ARGN}) + if(arg_RELATIVE) + set(relative_dir ${arg_RELATIVE}) + else() + set(relative_dir ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + + get_property(files TARGET ${target} PROPERTY SOURCES) + if(files) + list(SORT files) + + if(CMAKE_GENERATOR STREQUAL Xcode) + set_target_properties(${target} PROPERTIES SOURCES "${files}") + endif() + endif() + foreach(file ${files}) + if(NOT IS_ABSOLUTE ${file}) + set(file ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + endif() + file(RELATIVE_PATH relative_file ${relative_dir} ${file}) + get_filename_component(dir "${relative_file}" DIRECTORY) + if(NOT dir STREQUAL "${last_dir}") + if(files) + source_group("${last_dir}" FILES ${files}) + endif() + set(files "") + endif() + set(files ${files} ${file}) + set(last_dir "${dir}") + endforeach(file) + if(files) + source_group("${last_dir}" FILES ${files}) + endif() +endfunction() + +# Add sources to main application +# Arguments: +# name name of the library to add +# Implicit arguments: +# ENABLE_STATIC_LIBS Build static libraries per directory +# SOURCES the sources of the library +# HEADERS the headers of the library (only for IDE support) +# OTHERS other library related files (only for IDE support) +# On return: +# Library will be built, optionally added to ${core_DEPENDS} +# Sets CORE_LIBRARY for calls for setting target specific options +function(core_add_library name) + if(ENABLE_STATIC_LIBS) + add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) + set_target_properties(${name} PROPERTIES PREFIX "") + set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) + add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid) + set(CORE_LIBRARY ${name} PARENT_SCOPE) + + # Add precompiled headers to Kodi main libraries + if(CORE_SYSTEM_NAME STREQUAL windows) + add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + set_language_cxx(${name}) + target_link_libraries(${name} PUBLIC effects11) + endif() + else() + foreach(src IN LISTS SOURCES HEADERS OTHERS) + get_filename_component(src_path "${src}" ABSOLUTE) + list(APPEND FILES ${src_path}) + endforeach() + target_sources(lib${APP_NAME_LC} PRIVATE ${FILES}) + set(CORE_LIBRARY lib${APP_NAME_LC} PARENT_SCOPE) + endif() +endfunction() + +# Add a test library, and add sources to list for gtest integration macros +function(core_add_test_library name) + if(ENABLE_STATIC_LIBS) + add_library(${name} STATIC ${SOURCES} ${SUPPORTED_SOURCES} ${HEADERS} ${OTHERS}) + set_target_properties(${name} PROPERTIES PREFIX "" + EXCLUDE_FROM_ALL 1 + FOLDER "Build Utilities/tests") + add_dependencies(${name} libcpluff ffmpeg dvdnav crossguid) + set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) + endif() + foreach(src IN LISTS SOURCES) + get_filename_component(src_path "${src}" ABSOLUTE) + set(test_sources "${src_path}" ${test_sources} CACHE STRING "" FORCE) + endforeach() +endfunction() + +# Add an addon callback library +# Arguments: +# name name of the library to add +# Implicit arguments: +# SOURCES the sources of the library +# HEADERS the headers of the library (only for IDE support) +# OTHERS other library related files (only for IDE support) +# On return: +# Library target is defined and added to LIBRARY_FILES +function(core_add_addon_library name) + get_filename_component(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NAME) + list(APPEND SOURCES lib${name}.cpp) + core_add_shared_library(${name} OUTPUT_DIRECTORY addons/${DIRECTORY}) + set_target_properties(${name} PROPERTIES FOLDER addons) + target_include_directories(${name} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi + ${CORE_SOURCE_DIR}/xbmc) +endfunction() + +# Add an dl-loaded shared library +# Arguments: +# name name of the library to add +# Optional arguments: +# WRAPPED wrap this library on POSIX platforms to add VFS support for +# libraries that would otherwise not support it. +# OUTPUT_DIRECTORY where to create the library in the build dir +# (default: system) +# Implicit arguments: +# SOURCES the sources of the library +# HEADERS the headers of the library (only for IDE support) +# OTHERS other library related files (only for IDE support) +# On return: +# Library target is defined and added to LIBRARY_FILES +function(core_add_shared_library name) + cmake_parse_arguments(arg "WRAPPED" "OUTPUT_DIRECTORY" "" ${ARGN}) + if(arg_OUTPUT_DIRECTORY) + set(OUTPUT_DIRECTORY ${arg_OUTPUT_DIRECTORY}) + else() + if(NOT CORE_SYSTEM_NAME STREQUAL windows) + set(OUTPUT_DIRECTORY system) + endif() + endif() + if(CORE_SYSTEM_NAME STREQUAL windows) + set(OUTPUT_NAME lib${name}) + else() + set(OUTPUT_NAME lib${name}-${ARCH}) + endif() + + if(NOT arg_WRAPPED OR CORE_SYSTEM_NAME STREQUAL windows) + add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} + OUTPUT_NAME ${OUTPUT_NAME} PREFIX "") + + set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE) + add_dependencies(${APP_NAME_LC}-libraries ${name}) + else() + add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) + set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE 1) + core_link_library(${name} ${OUTPUT_DIRECTORY}/lib${name}) + endif() +endfunction() + +# Sets the compile language for all C source files in a target to CXX. +# Needs to be called from the CMakeLists.txt that defines the target. +# Arguments: +# target target +function(set_language_cxx target) + get_property(sources TARGET ${target} PROPERTY SOURCES) + foreach(file IN LISTS sources) + if(file MATCHES "\.c$") + set_source_files_properties(${file} PROPERTIES LANGUAGE CXX) + endif() + endforeach() +endfunction() + +# Add a data file to installation list with a mirror in build tree +# Mirroring files in the buildtree allows to execute the app from there. +# Arguments: +# file full path to file to mirror +# Optional Arguments: +# NO_INSTALL: exclude file from installation target (only mirror) +# DIRECTORY: directory where the file should be mirrored to +# (default: preserve tree structure relative to CORE_SOURCE_DIR) +# On return: +# Files is mirrored to the build tree and added to ${install_data} +# (if NO_INSTALL is not given). +function(copy_file_to_buildtree file) + cmake_parse_arguments(arg "NO_INSTALL" "DIRECTORY" "" ${ARGN}) + if(arg_DIRECTORY) + set(outdir ${arg_DIRECTORY}) + get_filename_component(outfile ${file} NAME) + set(outfile ${outdir}/${outfile}) + else() + string(REPLACE "${CORE_SOURCE_DIR}/" "" outfile ${file}) + get_filename_component(outdir ${outfile} DIRECTORY) + endif() + + if(NOT TARGET export-files) + file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) + add_custom_target(export-files ALL COMMENT "Copying files into build tree" + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) + set_target_properties(export-files PROPERTIES FOLDER "Build Utilities") + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake "# Export files to build tree\n") + endif() + + # Exclude autotools build artefacts and other blacklisted files in source tree. + if(file MATCHES "(Makefile|\.in|\.xbt|\.so|\.dylib|\.gitignore)$") + if(VERBOSE) + message(STATUS "copy_file_to_buildtree - ignoring file: ${file}") + endif() + return() + endif() + + if(NOT file STREQUAL ${CMAKE_BINARY_DIR}/${outfile}) + if(VERBOSE) + message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") + endif() + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake + "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") + endif() + + if(NOT arg_NO_INSTALL) + list(APPEND install_data ${outfile}) + set(install_data ${install_data} PARENT_SCOPE) + endif() +endfunction() + +# Add data files to installation list with a mirror in build tree. +# reads list of files to install from a given list of text files. +# Arguments: +# pattern globbing pattern for text files to read +# Optional Arguments: +# NO_INSTALL: exclude files from installation target +# Implicit arguments: +# CORE_SOURCE_DIR - root of source tree +# On return: +# Files are mirrored to the build tree and added to ${install_data} +# (if NO_INSTALL is not given). +function(copy_files_from_filelist_to_buildtree pattern) + # copies files listed in text files to the buildtree + # Input: [glob pattern: filepattern] + cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN}) + list(APPEND pattern ${ARGN}) + list(SORT pattern) + if(VERBOSE) + message(STATUS "copy_files_from_filelist_to_buildtree - got pattern: ${pattern}") + endif() + foreach(pat ${pattern}) + file(GLOB filenames ${pat}) + foreach(filename ${filenames}) + string(STRIP ${filename} filename) + core_file_read_filtered(fstrings ${filename}) + foreach(dir ${fstrings}) + string(REPLACE " " ";" dir ${dir}) + list(GET dir 0 src) + list(LENGTH dir len) + if(len EQUAL 1) + set(dest) + else() + list(GET dir -1 dest) + endif() + + # If the full path to an existing file is specified then add that single file. + # Don't recursively add all files with the given name. + if(EXISTS ${CORE_SOURCE_DIR}/${src} AND NOT IS_DIRECTORY ${CORE_SOURCE_DIR}/${src}) + set(files ${src}) + else() + file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${src}) + endif() + + foreach(file ${files}) + if(arg_NO_INSTALL) + copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest} NO_INSTALL) + else() + copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest}) + endif() + endforeach() + endforeach() + endforeach() + endforeach() + set(install_data ${install_data} PARENT_SCOPE) +endfunction() + +# helper macro to set modified variables in parent scope +macro(export_dep) + set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE) + set(DEPLIBS ${DEPLIBS} PARENT_SCOPE) + set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE) + set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE) + mark_as_advanced(${depup}_LIBRARIES) +endmacro() + +# add a required dependency of main application +# Arguments: +# dep name of find rule for dependency, used uppercased for variable prefix +# On return: +# dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} +function(core_require_dep dep) + find_package(${dep} REQUIRED) + string(TOUPPER ${dep} depup) + list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) + list(APPEND DEPLIBS ${${depup}_LIBRARIES}) + list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) + export_dep() +endfunction() + +# add a required dyloaded dependency of main application +# Arguments: +# dep name of find rule for dependency, used uppercased for variable prefix +# On return: +# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up +function(core_require_dyload_dep dep) + find_package(${dep} REQUIRED) + string(TOUPPER ${dep} depup) + list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) + list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) + find_soname(${depup} REQUIRED) + export_dep() + set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) +endfunction() + +# helper macro for optional deps +macro(setup_enable_switch) + string(TOUPPER ${dep} depup) + if(ARGV1) + set(enable_switch ${ARGV1}) + else() + set(enable_switch ENABLE_${depup}) + endif() + # normal options are boolean, so we override set our ENABLE_FOO var to allow "auto" handling + set(${enable_switch} "AUTO" CACHE STRING "Enable ${depup} support?") +endmacro() + +# add an optional dependency of main application +# Arguments: +# dep name of find rule for dependency, used uppercased for variable prefix +# On return: +# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} +function(core_optional_dep dep) + setup_enable_switch() + if(${enable_switch} STREQUAL AUTO) + find_package(${dep}) + elseif(${${enable_switch}}) + find_package(${dep} REQUIRED) + endif() + + if(${depup}_FOUND) + list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) + list(APPEND DEPLIBS ${${depup}_LIBRARIES}) + list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) + set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) + export_dep() + else() + set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE) + endif() +endfunction() + +# add an optional dyloaded dependency of main application +# Arguments: +# dep name of find rule for dependency, used uppercased for variable prefix +# On return: +# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up +function(core_optional_dyload_dep dep) + setup_enable_switch() + if(${enable_switch}) + find_package(${dep}) + if(${depup}_FOUND) + list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) + find_soname(${depup} REQUIRED) + list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) + set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) + export_dep() + set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) + endif() + endif() +endfunction() + +function(core_file_read_filtered result filepattern) + # Reads STRINGS from text files + # with comments filtered out + # Result: [list: result] + # Input: [glob pattern: filepattern] + file(GLOB filenames ${filepattern}) + list(SORT filenames) + foreach(filename ${filenames}) + if(VERBOSE) + message(STATUS "core_file_read_filtered - filename: ${filename}") + endif() + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename}) + file(STRINGS ${filename} fstrings REGEX "^[^#//]") + foreach(fstring ${fstrings}) + string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring}) + string(REGEX REPLACE "[ \n\r\t]//.*" "" fstring ${fstring}) + string(STRIP ${fstring} fstring) + list(APPEND filename_strings ${fstring}) + endforeach() + endforeach() + set(${result} ${filename_strings} PARENT_SCOPE) +endfunction() + +function(core_add_subdirs_from_filelist files) + # Adds subdirectories from a sorted list of files + # Input: [list: filenames] [bool: sort] + foreach(arg ${ARGN}) + list(APPEND files ${arg}) + endforeach() + list(SORT files) + if(VERBOSE) + message(STATUS "core_add_subdirs_from_filelist - got pattern: ${files}") + endif() + foreach(filename ${files}) + string(STRIP ${filename} filename) + core_file_read_filtered(fstrings ${filename}) + foreach(subdir ${fstrings}) + string(REPLACE " " ";" subdir ${subdir}) + list(GET subdir 0 subdir_src) + list(GET subdir -1 subdir_dest) + if(VERBOSE) + message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") + endif() + add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) + endforeach() + endforeach() +endfunction() + +macro(core_add_optional_subdirs_from_filelist pattern) + # Adds subdirectories from text files + # if the option(s) in the 3rd field are enabled + # Input: [glob pattern: filepattern] + foreach(arg ${ARGN}) + list(APPEND pattern ${arg}) + endforeach() + foreach(elem ${pattern}) + string(STRIP ${elem} elem) + list(APPEND filepattern ${elem}) + endforeach() + + file(GLOB filenames ${filepattern}) + list(SORT filenames) + if(VERBOSE) + message(STATUS "core_add_optional_subdirs_from_filelist - got pattern: ${filenames}") + endif() + + foreach(filename ${filenames}) + if(VERBOSE) + message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}") + endif() + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename}) + file(STRINGS ${filename} fstrings REGEX "^[^#//]") + foreach(line ${fstrings}) + string(REPLACE " " ";" line "${line}") + list(GET line 0 subdir_src) + list(GET line 1 subdir_dest) + list(GET line 3 opts) + foreach(opt ${opts}) + if(ENABLE_${opt}) + if(VERBOSE) + message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") + endif() + add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) + else() + if(VERBOSE) + message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir") + endif() + endif() + endforeach() + endforeach() + endforeach() +endmacro() + +# Generates an RFC2822 timestamp +# +# The following variable is set: +# RFC2822_TIMESTAMP +function(rfc2822stamp) + execute_process(COMMAND date -R + OUTPUT_VARIABLE RESULT) + set(RFC2822_TIMESTAMP ${RESULT} PARENT_SCOPE) +endfunction() + +# Generates an user stamp from git config info +# +# The following variable is set: +# PACKAGE_MAINTAINER - user stamp in the form of "username " +# if no git tree is found, value is set to "nobody " +function(userstamp) + find_package(Git) + if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) + execute_process(COMMAND ${GIT_EXECUTABLE} config user.name + OUTPUT_VARIABLE username + WORKING_DIRECTORY ${CORE_SOURCE_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${GIT_EXECUTABLE} config user.email + OUTPUT_VARIABLE useremail + WORKING_DIRECTORY ${CORE_SOURCE_DIR} + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(PACKAGE_MAINTAINER "${username} <${useremail}>" PARENT_SCOPE) + else() + set(PACKAGE_MAINTAINER "nobody " PARENT_SCOPE) + endif() +endfunction() + +# Parses git info and sets variables used to identify the build +# Arguments: +# stamp variable name to return +# Optional Arguments: +# FULL: generate git HEAD commit in the form of 'YYYYMMDD-hash' +# if git tree is dirty, value is set in the form of 'YYYYMMDD-hash-dirty' +# if no git tree is found, value is set in the form of 'YYYYMMDD-nogitfound' +# if FULL is not given, stamp is generated following the same process as above +# but without 'YYYYMMDD' +# On return: +# Variable is set with generated stamp to PARENT_SCOPE +function(core_find_git_rev stamp) + # allow manual setting GIT_VERSION + if(GIT_VERSION) + set(${stamp} ${GIT_VERSION} PARENT_SCOPE) + else() + find_package(Git) + if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) + execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- + RESULT_VARIABLE status_code + WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + if(NOT status_code) + execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD -- + RESULT_VARIABLE status_code + WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + endif() + if(status_code) + execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD + OUTPUT_VARIABLE HASH + WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + string(SUBSTRING ${HASH} 1 13 HASH) + else() + execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD + OUTPUT_VARIABLE HASH + WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + string(SUBSTRING ${HASH} 1 7 HASH) + endif() + execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD + OUTPUT_VARIABLE DATE + WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + string(SUBSTRING ${DATE} 1 10 DATE) + string(REPLACE "-" "" DATE ${DATE}) + else() + string(TIMESTAMP DATE "%Y%m%d" UTC) + set(HASH "nogitfound") + endif() + cmake_parse_arguments(arg "FULL" "" "" ${ARGN}) + if(arg_FULL) + set(${stamp} ${DATE}-${HASH} PARENT_SCOPE) + else() + set(${stamp} ${HASH} PARENT_SCOPE) + endif() + endif() +endfunction() + +# Parses version.txt and libKODI_guilib.h and sets variables +# used to construct dirs structure, file naming, API version, etc. +# +# The following variables are set from version.txt: +# APP_NAME - app name +# APP_NAME_LC - lowercased app name +# APP_NAME_UC - uppercased app name +# COMPANY_NAME - company name +# APP_VERSION_MAJOR - the app version major +# APP_VERSION_MINOR - the app version minor +# APP_VERSION_TAG - the app version tag +# APP_VERSION_TAG_LC - lowercased app version tag +# APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}) +# APP_ADDON_API - the addon API version in the form of 16.9.702 +# FILE_VERSION - file version in the form of 16,9,702,0 - Windows only +# +# The following variables are set from libKODI_guilib.h: +# guilib_version - current ADDONGUI API version +# guilib_version_min - minimal ADDONGUI API version +macro(core_find_versions) + include(CMakeParseArguments) + core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) + string(REPLACE " " ";" version_list "${version_list}") + cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API" "" ${version_list}) + + set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird + string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) + string(TOUPPER ${APP_APP_NAME} APP_NAME_UC) + set(COMPANY_NAME ${APP_COMPANY_NAME}) + set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) + if(APP_VERSION_TAG) + set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) + endif() + string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) + string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) + file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") + string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) + file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") + string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min}) + # unset variables not used anywhere else + unset(version_list) + unset(APP_APP_NAME) + + # bail if we can't parse version.txt + if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) + message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists") + endif() + + # bail if we can't parse libKODI_guilib.h + if(NOT DEFINED guilib_version OR NOT DEFINED guilib_version_min) + 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") + endif() +endmacro() + diff --git a/project/cmake/scripts/common/PrepareEnv.cmake b/project/cmake/scripts/common/PrepareEnv.cmake new file mode 100644 index 0000000..8e02382 --- /dev/null +++ b/project/cmake/scripts/common/PrepareEnv.cmake @@ -0,0 +1,93 @@ +# parse version.txt and libKODI_guilib.h to get the version and API info +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) +core_find_versions() + +# in case we need to download something, set KODI_MIRROR to the default if not alread set +if(NOT DEFINED KODI_MIRROR) + set(KODI_MIRROR "http://mirrors.kodi.tv") +endif() + +### copy all the addon binding header files to include/kodi +# make sure include/kodi exists and is empty +set(APP_LIB_DIR ${ADDON_DEPENDS_PATH}/lib/${APP_NAME_LC}) +if(NOT EXISTS "${APP_LIB_DIR}/") + file(MAKE_DIRECTORY ${APP_LIB_DIR}) +endif() + +set(APP_DATA_DIR ${ADDON_DEPENDS_PATH}/share/${APP_NAME_LC}) +if(NOT EXISTS "${APP_DATA_DIR}/") + file(MAKE_DIRECTORY ${APP_DATA_DIR}) +endif() + +set(APP_INCLUDE_DIR ${ADDON_DEPENDS_PATH}/include/${APP_NAME_LC}) +if(NOT EXISTS "${APP_INCLUDE_DIR}/") + file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) +endif() + +# make sure C++11 is always set +if(NOT WIN32) + string(REGEX MATCH "-std=(gnu|c)\\+\\+11" cxx11flag "${CMAKE_CXX_FLAGS}") + if(NOT cxx11flag) + set(CXX11_SWITCH "-std=c++11") + endif() +endif() + +# generate the proper KodiConfig.cmake file +configure_file(${CORE_SOURCE_DIR}/project/cmake/KodiConfig.cmake.in ${APP_LIB_DIR}/KodiConfig.cmake @ONLY) + +# copy cmake helpers to lib/kodi +file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake + DESTINATION ${APP_LIB_DIR}) + +### copy all the addon binding header files to include/kodi +# parse addon-bindings.mk to get the list of header files to copy +core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) +foreach(binding ${bindings}) + string(REPLACE " =" ";" binding "${binding}") + string(REPLACE "+=" ";" binding "${binding}") + list(GET binding 1 header) + # copy the header file to include/kodi + configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY) +endforeach() + +### on windows we need a "patch" binary to be able to patch 3rd party sources +if(WIN32) + find_program(PATCH_FOUND NAMES patch patch.exe) + if(PATCH_FOUND) + message(STATUS "patch utility found at ${PATCH_FOUND}") + else() + set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3") + set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") + set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") + set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) + + # download the archive containing patch.exe + message(STATUS "Downloading patch utility from ${PATCH_URL}...") + file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) + list(GET PATCH_DL_STATUS 0 PATCH_RETCODE) + if(NOT ${PATCH_RETCODE} EQUAL 0) + message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}") + endif() + + # extract the archive containing patch.exe + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD} + WORKING_DIRECTORY ${BUILD_DIR}) + + # make sure the extraction worked and that patch.exe is there + set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME}) + set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe) + if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH}) + message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_DOWNLOAD_DIR}") + endif() + + # copy patch.exe into the output directory + file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) + + # make sure that cmake can find the copied patch.exe + find_program(PATCH_FOUND NAMES patch patch.exe) + if(NOT PATCH_FOUND) + message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin") + endif() + endif() +endif() diff --git a/project/cmake/scripts/common/ProjectMacros.cmake b/project/cmake/scripts/common/ProjectMacros.cmake new file mode 100644 index 0000000..e73ef90 --- /dev/null +++ b/project/cmake/scripts/common/ProjectMacros.cmake @@ -0,0 +1,89 @@ +# This script holds macros which are project specific + +# Pack a skin xbt file +# Arguments: +# input input directory to pack +# output ouput xbt file +# On return: +# xbt is added to ${XBT_FILES} +function(pack_xbt input output) + file(GLOB_RECURSE MEDIA_FILES ${input}/*) + get_filename_component(dir ${output} DIRECTORY) + add_custom_command(OUTPUT ${output} + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND TexturePacker::TexturePacker + ARGS -input ${input} + -output ${output} + -dupecheck + DEPENDS ${MEDIA_FILES}) + list(APPEND XBT_FILES ${output}) + set(XBT_FILES ${XBT_FILES} PARENT_SCOPE) +endfunction() + +# Add a skin to installation list, mirroring it in build tree, packing textures +# Arguments: +# skin skin directory +# On return: +# xbt is added to ${XBT_FILES}, data added to ${install_data}, mirror in build tree +function(copy_skin_to_buildtree skin) + file(GLOB_RECURSE FILES ${skin}/*) + file(GLOB_RECURSE MEDIA_FILES ${skin}/media/*) + list(REMOVE_ITEM FILES ${MEDIA_FILES}) + foreach(file ${FILES}) + copy_file_to_buildtree(${file}) + endforeach() + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media) + string(REPLACE "${CORE_SOURCE_DIR}/" "" dest ${skin}) + pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt) + + file(GLOB THEMES RELATIVE ${skin}/themes ${skin}/themes/*) + foreach(theme ${THEMES}) + pack_xbt(${skin}/themes/${theme} ${CMAKE_BINARY_DIR}/${dest}/media/${theme}.xbt) + endforeach() + + set(XBT_FILES ${XBT_FILES} PARENT_SCOPE) + set(install_data ${install_data} PARENT_SCOPE) +endfunction() + +# Get GTest tests as CMake tests. +# Copied from FindGTest.cmake +# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code +function(GTEST_ADD_TESTS executable extra_args) + if(NOT ARGN) + message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS") + endif() + foreach(source ${ARGN}) + # This assumes that every source file passed in exists. Consider using + # SUPPORT_SOURCES for source files which do not contain tests and might + # have to be generated. + file(READ "${source}" contents) + string(REGEX MATCHALL "TEST_?[F]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) + foreach(hit ${found_tests}) + string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit}) + add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args}) + endforeach() + # Groups parametrized tests under a single ctest entry + string(REGEX MATCHALL "INSTANTIATE_TEST_CASE_P\\(([^,]+), *([^,]+)" found_tests2 ${contents}) + foreach(hit ${found_tests2}) + string(SUBSTRING ${hit} 24 -1 test_name) + string(REPLACE "," ";" test_name "${test_name}") + list(GET test_name 0 filter_name) + list(GET test_name 1 test_prefix) + string(STRIP ${test_prefix} test_prefix) + add_test(${test_prefix}.${filter_name} ${executable} --gtest_filter=${filter_name}* ${extra_args}) + endforeach() + endforeach() +endfunction() + +function(whole_archive output) + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) + set(${output} -Wl,--whole-archive ${ARGN} -Wl,--no-whole-archive PARENT_SCOPE) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) + foreach(library ${ARGN}) + list(APPEND ${output} -Wl,-force_load ${library}) + set(${output} ${${output}} PARENT_SCOPE) + endforeach() + else() + set(${output} ${ARGN} PARENT_SCOPE) + endif() +endfunction() 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 @@ +# Uninstall target +set(MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt) +if(EXISTS ${MANIFEST}) + file(STRINGS ${MANIFEST} files) + foreach(file IN LISTS files) + if(EXISTS $ENV{DESTDIR}${file}) + message(STATUS "Uninstalling: ${file}") + execute_process( + COMMAND ${CMAKE_COMMAND} -E remove $ENV{DESTDIR}${file} + OUTPUT_VARIABLE rm_out + RESULT_VARIABLE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Failed to remove file: $ENV{DESTDIR}${file}") + endif() + else() + message(STATUS "File does not exist: $ENV{DESTDIR}${file}") + endif() + endforeach(file) +else() + message(STATUS "Cannot find install manifest: '${MANIFEST}'") +endif() 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 @@ -# Workaround for the fact that cpack's filenames are not customizable. -# Each add-on is added as a separate component to facilitate zip/tgz packaging. -# The filenames are always of the form basename-component, which is -# incompatible with the addonid-version scheme we want. This hack renames -# the files from the file names generated by the 'package' target. -# Sadly we cannot extend the 'package' target, as it is a builtin target, see -# http://public.kitware.com/Bug/view.php?id=8438 -# Thus, we have to add an 'addon-package' target. -add_custom_target(addon-package - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) - -macro(add_cpack_workaround target version ext) - if(NOT PACKAGE_DIR) - set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips") - endif() - - add_custom_command(TARGET addon-package PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR} - COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_PACKAGE_DIRECTORY}/addon-${target}-${version}.${ext} ${PACKAGE_DIR}/${target}-${version}.${ext}) -endmacro() - -# Grab the version from a given add-on's addon.xml -macro (addon_version dir prefix) - IF(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in) - FILE(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML) - ELSE() - FILE(READ ${dir}/addon.xml ADDONXML) - ENDIF() - - STRING(REGEX MATCH "]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) - STRING(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) - message(STATUS ${prefix}_VERSION=${${prefix}_VERSION}) -endmacro() - -# Build, link and optionally package an add-on -macro (build_addon target prefix libs) - ADD_LIBRARY(${target} ${${prefix}_SOURCES}) - TARGET_LINK_LIBRARIES(${target} ${${libs}}) - addon_version(${target} ${prefix}) - SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${${prefix}_VERSION} - SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} - PREFIX "") - IF(OS STREQUAL "android") - SET_TARGET_PROPERTIES(${target} PROPERTIES PREFIX "lib") - ENDIF(OS STREQUAL "android") - - # get the library's location - SET(LIBRARY_LOCATION $) - # get the library's filename - if("${CORE_SYSTEM_NAME}" STREQUAL "android") - # for android we need the filename without any version numbers - set(LIBRARY_FILENAME $) - else() - SET(LIBRARY_FILENAME $) - endif() - - # if there's an addon.xml.in we need to generate the addon.xml - IF(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) - SET(PLATFORM ${CORE_SYSTEM_NAME}) - - FILE(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file) - STRING(CONFIGURE "${addon_file}" addon_file_conf @ONLY) - FILE(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") - ENDIF() - - # set zip as default if addon-package is called without PACKAGE_XXX - SET(CPACK_GENERATOR "ZIP") - SET(ext "zip") - IF(PACKAGE_ZIP OR PACKAGE_TGZ) - IF(PACKAGE_TGZ) - SET(CPACK_GENERATOR "TGZ") - SET(ext "tar.gz") - ENDIF(PACKAGE_TGZ) - SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) - set(CPACK_PACKAGE_FILE_NAME addon) - IF(CMAKE_BUILD_TYPE STREQUAL "Release") - SET(CPACK_STRIP_FILES TRUE) - ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - set(CPACK_COMPONENTS_IGNORE_GROUPS 1) - list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) - # Pack files together to create an archive - INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "addon.xml.in" EXCLUDE) - IF(WIN32) - if(NOT CPACK_PACKAGE_DIRECTORY) - # determine the temporary path - file(TO_CMAKE_PATH "$ENV{TEMP}" WIN32_TEMP_PATH) - string(LENGTH "${WIN32_TEMP_PATH}" WIN32_TEMP_PATH_LENGTH) - string(LENGTH "${PROJECT_BINARY_DIR}" PROJECT_BINARY_DIR_LENGTH) - - # check if the temporary path is shorter than the default packaging directory path - if(WIN32_TEMP_PATH_LENGTH GREATER 0 AND WIN32_TEMP_PATH_LENGTH LESS PROJECT_BINARY_DIR_LENGTH) - # set the directory used by CPack for packaging to the temp directory - set(CPACK_PACKAGE_DIRECTORY ${WIN32_TEMP_PATH}) - endif() - endif() - - # in case of a VC++ project the installation location contains a $(Configuration) VS variable - # we replace it with ${CMAKE_BUILD_TYPE} (which doesn't cover the case when the build configuration - # is changed within Visual Studio) - string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}") - - # install the generated DLL file - INSTALL(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) - - IF(CMAKE_BUILD_TYPE MATCHES Debug) - # for debug builds also install the PDB file - get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY) - INSTALL(FILES $ DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) - ENDIF() - ELSE(WIN32) - if(NOT CPACK_PACKAGE_DIRECTORY) - set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}) - endif() - INSTALL(TARGETS ${target} DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) - ENDIF(WIN32) - add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) - ELSE(PACKAGE_ZIP OR PACKAGE_TGZ) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) - message(STATUS "setting install paths to match ${APP_NAME}: CMAKE_INSTALL_PREFIX: ${${APP_NAME_UC}_PREFIX}") - set(CMAKE_INSTALL_PREFIX "${${APP_NAME_UC}_PREFIX}" CACHE PATH "${APP_NAME} install prefix" FORCE) - set(CMAKE_INSTALL_LIBDIR "${${APP_NAME_UC}_LIB_DIR}" CACHE PATH "${APP_NAME} install libdir" FORCE) - elseif(NOT CMAKE_INSTALL_PREFIX STREQUAL "${${APP_NAME_UC}_PREFIX}" AND NOT OVERRIDE_PATHS) - 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") - else() - if(NOT CMAKE_INSTALL_LIBDIR) - set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}") - endif() - endif() - else() - set(CMAKE_INSTALL_LIBDIR "lib/${APP_NAME_LC}") - endif() - INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) - INSTALL(DIRECTORY ${target} DESTINATION share/${APP_NAME_LC}/addons PATTERN "addon.xml.in" EXCLUDE) - ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ) -endmacro() - -# finds a path to a given file (recursive) -function (kodi_find_path var_name filename search_path strip_file) - file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename}) - if(strip_file) - string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE}) - endif(strip_file) - set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE) -endfunction() - -# Cmake build options -include(addoptions) -include(TestCXXAcceptsFlag) -OPTION(PACKAGE_ZIP "Package Zip file?" OFF) -OPTION(PACKAGE_TGZ "Package TGZ file?" OFF) -OPTION(BUILD_SHARED_LIBS "Build shared libs?" ON) - -# LTO support? -CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO) -IF(HAVE_LTO) - OPTION(USE_LTO "use link time optimization" OFF) - IF(USE_LTO) - add_options(ALL_LANGUAGES ALL_BUILDS "-flto") - ENDIF(USE_LTO) -ENDIF(HAVE_LTO) - -# set this to try linking dependencies as static as possible -IF(ADDONS_PREFER_STATIC_LIBS) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -ENDIF(ADDONS_PREFER_STATIC_LIBS) - 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 @@ -# - Add options without repeating them on the command line -# -# Synopsis: -# -# add_options (lang build opts) -# -# where: -# -# lang Name of the language whose compiler should receive the -# options, e.g. CXX. If a comma-separated list is received -# then the option is added for all those languages. Use the -# special value ALL_LANGUAGES for these languages: CXX, C -# and Fortran -# -# build Kind of build to which this options should apply, -# such as DEBUG and RELEASE. This can also be a comma- -# separated list. Use the special value ALL_BUILDS to apply -# to all builds. -# -# opts List of options to add. Each should be quoted. -# -# Example: -# -# add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall") - -function (add_options langs builds) - # special handling of empty language specification - if ("${langs}" STREQUAL "ALL_LANGUAGES") - set (langs CXX C Fortran) - endif ("${langs}" STREQUAL "ALL_LANGUAGES") - foreach (lang IN LISTS langs) - # prepend underscore if necessary - foreach (build IN LISTS builds) - if (NOT ("${build}" STREQUAL "ALL_BUILDS")) - set (_bld "_${build}") - string (TOUPPER "${_bld}" _bld) - else (NOT ("${build}" STREQUAL "ALL_BUILDS")) - set (_bld "") - endif (NOT ("${build}" STREQUAL "ALL_BUILDS")) - foreach (_opt IN LISTS ARGN) - set (_var "CMAKE_${lang}_FLAGS${_bld}") - #message (STATUS "Adding \"${_opt}\" to \${${_var}}") - # remove it first - string (REPLACE "${_opt}" "" _without "${${_var}}") - string (STRIP "${_without}" _without) - # we need to strip this one as well, so they are comparable - string (STRIP "${${_var}}" _stripped) - # if it wasn't there, then add it at the end - if ("${_without}" STREQUAL "${_stripped}") - # don't add any extra spaces if no options yet are set - if (NOT ${_stripped} STREQUAL "") - set (${_var} "${_stripped} ${_opt}") - else (NOT ${_stripped} STREQUAL "") - set (${_var} "${_opt}") - endif (NOT ${_stripped} STREQUAL "") - set (${_var} "${${_var}}" PARENT_SCOPE) - endif ("${_without}" STREQUAL "${_stripped}") - endforeach (_opt) - endforeach (build) - endforeach (lang) -endfunction (add_options lang build) - -# set varname to flag unless user has specified something that matches regex -function (set_default_option varname flag regex) - if (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") - set (${varname} ${flag} PARENT_SCOPE) - else (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") - set (${varname} PARENT_SCOPE) - endif (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") -endfunction (set_default_option) - -# note: this must be called before project() -macro (no_default_options) - # prevent the platform probe to set options - set (CMAKE_NOT_USING_CONFIG_FLAGS TRUE) -endmacro (no_default_options) diff --git a/project/cmake/scripts/common/archsetup.cmake b/project/cmake/scripts/common/archsetup.cmake deleted file mode 100644 index dff5558..0000000 --- a/project/cmake/scripts/common/archsetup.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# This script configures the build for a given architecture. -# Flags and stringified arch is set up. -# General compiler tests belongs here. -# -# On return, the following variables are set: -# CMAKE_SYSTEM_NAME - a lowercased system name -# CPU - the CPU on the target -# ARCH - the system architecture -# ARCH_DEFINES - list of compiler definitions for this architecture -# SYSTEM_DEFINES - list of compiler definitions for this system -# DEP_DEFINES - compiler definitions for system dependencies (e.g. LIRC) -# + the results of compiler tests etc. - -include(CheckCXXSourceCompiles) -include(CheckSymbolExists) -include(CheckFunctionExists) - -# Macro to check if a given type exists in a given header -# Arguments: -# header the header to check -# type the type to check for existence -# var the compiler definition to set if type exists -# On return: -# If type was found, the definition is added to SYSTEM_DEFINES -macro(check_type header type var) - check_cxx_source_compiles("#include <${header}> - int main() - { - ${type} s; - }" ${var}) - if(${var}) - list(APPEND SYSTEM_DEFINES -D${var}=1) - endif() -endmacro() - -# Macro to check if a given builtin function exists -# Arguments: -# func the function to check -# var the compiler definition to set if type exists -# On return: -# If type was found, the definition is added to SYSTEM_DEFINES -macro(check_builtin func var) - check_cxx_source_compiles(" - int main() - { - ${func}; - }" ${var}) - if(${var}) - list(APPEND SYSTEM_DEFINES -D${var}=1) - endif() -endmacro() - - -# -------- Main script --------- -message(STATUS "System type: ${CMAKE_SYSTEM_NAME}") -if(NOT CORE_SYSTEM_NAME) - string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) -endif() - -if(WITH_CPU) - set(CPU ${WITH_CPU}) -elseif(NOT CMAKE_TOOLCHAIN_FILE) - set(CPU ${CMAKE_SYSTEM_PROCESSOR}) -endif() - -if(CMAKE_TOOLCHAIN_FILE) - if(NOT EXISTS "${CMAKE_TOOLCHAIN_FILE}") - message(FATAL_ERROR "Toolchain file ${CMAKE_TOOLCHAIN_FILE} does not exist.") - elseif(NOT DEPENDS_PATH OR NOT NATIVEPREFIX) - message(FATAL_ERROR "Toolchain did not define DEPENDS_PATH or NATIVEPREFIX. Possibly outdated depends.") - endif() -endif() - -# Main cpp -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp) - -# system specific arch setup -include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/archsetup.cmake) - -message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") -message(STATUS "Platform: ${PLATFORM}") -message(STATUS "CPU: ${CPU}, ARCH: ${ARCH}") - -check_type(string std::u16string HAVE_STD__U16_STRING) -check_type(string std::u32string HAVE_STD__U32_STRING) -check_type(string char16_t HAVE_CHAR16_T) -check_type(string char32_t HAVE_CHAR32_T) -check_type(stdint.h uint_least16_t HAVE_STDINT_H) -check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) -check_builtin("long* temp=0; long ret=__sync_add_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_ADD_AND_FETCH) -check_builtin("long* temp=0; long ret=__sync_sub_and_fetch(temp, 1)" HAS_BUILTIN_SYNC_SUB_AND_FETCH) -check_builtin("long* temp=0; long ret=__sync_val_compare_and_swap(temp, 1, 1)" HAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP) -if(HAVE_POSIX_FADVISE) - list(APPEND SYSTEM_DEFINES -DHAVE_POSIX_FADVISE=1) -endif() -check_function_exists(localtime_r HAVE_LOCALTIME_R) -if(HAVE_LOCALTIME_R) - list(APPEND SYSTEM_DEFINES -DHAVE_LOCALTIME_R=1) -endif() diff --git a/project/cmake/scripts/common/check_target_platform.cmake b/project/cmake/scripts/common/check_target_platform.cmake deleted file mode 100644 index fc8b403..0000000 --- a/project/cmake/scripts/common/check_target_platform.cmake +++ /dev/null @@ -1,61 +0,0 @@ -# handle target platforms -function(check_target_platform dir target_platform build) - # param[in] dir path/directory of the addon/dependency - # param[in] target_platform target platform of the build - # param[out] build Result whether the addon/dependency should be built for the specified target platform - - set(${build} FALSE) - # check if the given directory exists and contains a platforms.txt - if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt) - # get all the specified platforms - file(STRINGS ${dir}/platforms.txt platforms) - separate_arguments(platforms) - - # check if the addon/dependency should be built for the current platform - foreach(platform ${platforms}) - if(${platform} STREQUAL "all" OR ${platform} STREQUAL ${target_platform}) - set(${build} TRUE) - else() - # check if the platform is defined as "!" - string(SUBSTRING ${platform} 0 1 platform_first) - if(${platform_first} STREQUAL "!") - # extract the platform - string(LENGTH ${platform} platform_length) - MATH(EXPR platform_length "${platform_length} - 1") - string(SUBSTRING ${platform} 1 ${platform_length} platform) - - # check if the current platform does not match the extracted platform - if (NOT ${platform} STREQUAL ${target_platform}) - set(${build} TRUE) - endif() - endif() - endif() - endforeach() - else() - set(${build} TRUE) - endif() - - # make the ${build} variable available to the calling script - set(${build} "${${build}}" PARENT_SCOPE) -endfunction() - -function(check_install_permissions install_dir have_perms) - # param[in] install_dir directory to check for write permissions - # param[out] have_perms wether we have permissions to install to install_dir - - set(${have_perms} TRUE) - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/lib/kodi - COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/share/kodi - COMMAND ${CMAKE_COMMAND} -E touch ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test - RESULT_VARIABLE permtest) - - if(${permtest} GREATER 0) - message(STATUS "check_install_permissions: ${permtest}") - set(${have_perms} FALSE) - endif() - set(${have_perms} "${${have_perms}}" PARENT_SCOPE) - - if(EXISTS ${install_dir}/lib/kodi/.cmake-inst-test OR EXISTS ${install_dir}/share/kodi/.cmake-inst-test) - file(REMOVE ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test) - endif() -endfunction() diff --git a/project/cmake/scripts/common/checkcommits.cmake b/project/cmake/scripts/common/checkcommits.cmake deleted file mode 100644 index 304e623..0000000 --- a/project/cmake/scripts/common/checkcommits.cmake +++ /dev/null @@ -1,75 +0,0 @@ -find_package(Git REQUIRED) - -macro(sanity_check message) - if(status_code) - message(FATAL_ERROR "${message}") - endif() -endmacro() - -# Check that there are no changes in working-tree -execute_process(COMMAND ${GIT_EXECUTABLE} diff --quiet - RESULT_VARIABLE status_code) -sanity_check("Cannot run with working tree changes. Commit, stash or drop them.") - -# Setup base of tests -set(check_base $ENV{CHECK_BASE}) -if(NOT check_base) - set(check_base origin/master) -endif() - -# Setup end of tests -set(check_head $ENV{CHECK_HEAD}) -if(NOT check_head) - set(check_head HEAD) -endif() - -# Setup target to build -set(check_target $ENV{CHECK_TARGET}) -if(NOT check_target) - set(check_target check) -endif() - -# Build threads -set(build_threads $ENV{CHECK_THREADS}) -if(NOT build_threads) - if(UNIX) - execute_process(COMMAND nproc - OUTPUT_VARIABLE build_threads) - string(REGEX REPLACE "(\r?\n)+$" "" build_threads "${build_threads}") - endif() -endif() - -# Record current HEAD -execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - OUTPUT_VARIABLE current_branch) - -string(REGEX REPLACE "(\r?\n)+$" "" current_branch "${current_branch}") - -# Grab revision list -execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${check_base}..${check_head} --reverse - OUTPUT_VARIABLE rev_list) - -string(REPLACE "\n" ";" rev_list ${rev_list}) -foreach(rev ${rev_list}) - # Checkout - message("Testing revision ${rev}") - execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${rev} - RESULT_VARIABLE status_code) - sanity_check("Failed to checkout ${rev}") - - # Build - if(build_threads GREATER 2) - execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${check_target}" "--use-stderr" "--" "-j${build_threads}" - RESULT_VARIABLE status_code) - else() - execute_process(COMMAND ${CMAKE_COMMAND} "--build" "${CMAKE_BINARY_DIR}" "--target" "${check_target}" "--use-stderr" - RESULT_VARIABLE status_code) - endif() - if(status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}) - endif() - sanity_check("Failed to build target for revision ${rev}") -endforeach() - -message("Everything checks out fine") -execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${current_branch}) 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 @@ -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/macros.cmake) - -core_find_versions() -file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon) -file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/kodi.guilib) -configure_file(${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in - ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml @ONLY) -configure_file(${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in - ${CMAKE_BINARY_DIR}/addons/kodi.guilib/addon.xml @ONLY) -configure_file(${CORE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp @ONLY) diff --git a/project/cmake/scripts/common/generatorsetup.cmake b/project/cmake/scripts/common/generatorsetup.cmake deleted file mode 100644 index 75083ca..0000000 --- a/project/cmake/scripts/common/generatorsetup.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Configure single-/multiconfiguration generators and variables -# -# CORE_BUILD_CONFIG that is set to -# - CMAKE_BUILD_TYPE for single configuration generators such as make, nmake -# - a variable that expands on build time to the current configuration for -# multi configuration generators such as VS or Xcode -if(CMAKE_CONFIGURATION_TYPES) - if(CMAKE_BUILD_TYPE) - message(FATAL_ERROR "CMAKE_BUILD_TYPE must not be defined for multi-configuration generators") - endif() - set(CORE_BUILD_CONFIG ${CMAKE_CFG_INTDIR}) - message(STATUS "Generator: Multi-configuration (${CMAKE_GENERATOR})") -else() - if(CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} - CACHE STRING "Choose build type (${CMAKE_BUILD_TYPES})" FORCE) - else() - # Set default - set(CMAKE_BUILD_TYPE Release - CACHE STRING "Choose build type (${CMAKE_BUILD_TYPES})" FORCE) - endif() - set(CORE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) - message(STATUS "Generator: Single-configuration: ${CMAKE_BUILD_TYPE} (${CMAKE_GENERATOR})") -endif() diff --git a/project/cmake/scripts/common/handle-depends.cmake b/project/cmake/scripts/common/handle-depends.cmake deleted file mode 100644 index 4d78928..0000000 --- a/project/cmake/scripts/common/handle-depends.cmake +++ /dev/null @@ -1,209 +0,0 @@ -include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) - -# handle addon depends -function(add_addon_depends addon searchpath) - # input: string addon string searchpath - - set(OUTPUT_DIR ${DEPENDS_PATH}) - file(GLOB_RECURSE cmake_input_files ${searchpath}/${CORE_SYSTEM_NAME}/*.txt) - file(GLOB_RECURSE cmake_input_files2 ${searchpath}/common/*.txt) - list(APPEND cmake_input_files ${cmake_input_files2}) - - foreach(file ${cmake_input_files}) - if(NOT (file MATCHES CMakeLists.txt OR - file MATCHES install.txt OR - file MATCHES noinstall.txt OR - file MATCHES flags.txt OR - file MATCHES deps.txt OR - file MATCHES platforms.txt)) - message(STATUS "Processing ${file}") - file(STRINGS ${file} def) - separate_arguments(def) - list(LENGTH def deflength) - get_filename_component(dir ${file} PATH) - - # get the id of the dependency - if(NOT "${def}" STREQUAL "") - # read the id from the file - list(GET def 0 id) - else() - # read the id from the filename - get_filename_component(id ${file} NAME_WE) - endif() - - # check if the dependency has a platforms.txt - set(platform_found FALSE) - check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) - - if(${platform_found} AND NOT TARGET ${id}) - # determine the download URL of the dependency - set(url "") - if(deflength GREATER 1) - list(GET def 1 url) - message(STATUS "${id} url: ${url}") - endif() - - # check if there are any library specific flags that need to be passed on - if(EXISTS ${dir}/flags.txt) - file(STRINGS ${dir}/flags.txt extraflags) - separate_arguments(extraflags) - message(STATUS "${id} extraflags: ${extraflags}") - endif() - - set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} - -DOUTPUT_DIR=${OUTPUT_DIR} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} - -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} - -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} - -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} - -DENABLE_STATIC=1 - -DBUILD_SHARED_LIBS=0) - # if there are no make rules override files available take care of manually passing on ARCH_DEFINES - if(NOT CMAKE_USER_MAKE_RULES_OVERRIDE AND NOT CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) - # make sure we create strings, not lists - set(TMP_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_DEFINES}") - set(TMP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_DEFINES}") - list(APPEND BUILD_ARGS -DCMAKE_C_FLAGS=${TMP_C_FLAGS} - -DCMAKE_CXX_FLAGS=${TMP_CXX_FLAGS}) - endif() - - if(CMAKE_TOOLCHAIN_FILE) - list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) - MESSAGE("toolchain specified") - MESSAGE(${BUILD_ARGS}) - endif() - - # if there's a CMakeLists.txt use it to prepare the build - set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) - if(EXISTS ${dir}/CMakeLists.txt) - file(APPEND ${PATCH_FILE} - "file(COPY ${dir}/CMakeLists.txt - DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") - endif() - - # check if we have patches to apply - file(GLOB patches ${dir}/*.patch) - list(SORT patches) - foreach(patch ${patches}) - if(NOT PATCH_PROGRAM OR "${PATCH_PROGRAM}" STREQUAL "") - if(NOT PATCH_EXECUTABLE) - # find the path to the patch executable - find_program(PATCH_EXECUTABLE NAMES patch) - - if(NOT PATCH_EXECUTABLE) - message(FATAL_ERROR "Missing patch command (we looked in ${CMAKE_PREFIX_PATH})") - endif() - endif() - - # on windows "patch.exe" can only handle CR-LF line-endings so we - # need to force it to also handle LF-only line endings - set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) - if(WIN32) - set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") - endif() - endif() - - file(APPEND ${PATCH_FILE} - "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") - endforeach() - - - # if there's an install.txt use it to properly install the built files - set(INSTALL_COMMAND "") - if(EXISTS ${dir}/install.txt) - set(INSTALL_COMMAND INSTALL_COMMAND ${CMAKE_COMMAND} - -DINPUTDIR=${BUILD_DIR}/${id}/src/${id}-build/ - -DINPUTFILE=${dir}/install.txt - -DDESTDIR=${OUTPUT_DIR} - -DENABLE_STATIC=1 - "${extraflags}" - -P ${PROJECT_SOURCE_DIR}/install.cmake) - elseif(EXISTS ${dir}/noinstall.txt) - set(INSTALL_COMMAND INSTALL_COMMAND "") - endif() - - # check if there's a deps.txt containing dependencies on other libraries - if(EXISTS ${dir}/deps.txt) - file(STRINGS ${dir}/deps.txt deps) - message(STATUS "${id} depends: ${deps}") - else() - set(deps) - endif() - - if(CROSS_AUTOCONF AND AUTOCONF_FILES) - foreach(afile ${AUTOCONF_FILES}) - file(APPEND ${PATCH_FILE} - "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n - file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") - endforeach() - endif() - - # if the patch file exists we need to set the PATCH_COMMAND - set(PATCH_COMMAND "") - if (EXISTS ${PATCH_FILE}) - set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) - endif() - - # prepare the setup of the call to externalproject_add() - set(EXTERNALPROJECT_SETUP PREFIX ${BUILD_DIR}/${id} - CMAKE_ARGS ${extraflags} ${BUILD_ARGS} - PATCH_COMMAND ${PATCH_COMMAND} - "${INSTALL_COMMAND}") - - # if there's an url defined we need to pass that to externalproject_add() - if(DEFINED url AND NOT "${url}" STREQUAL "") - # check if there's a third parameter in the file - if(deflength GREATER 2) - # the third parameter is considered as a revision of a git repository - list(GET def 2 revision) - - externalproject_add(${id} - GIT_REPOSITORY ${url} - GIT_TAG ${revision} - "${EXTERNALPROJECT_SETUP}") - else() - set(CONFIGURE_COMMAND "") - if(NOT WIN32) - # manually specify the configure command to be able to pass in the custom PKG_CONFIG_PATH - set(CONFIGURE_COMMAND PKG_CONFIG_PATH=${OUTPUT_DIR}/lib/pkgconfig - ${CMAKE_COMMAND} -DCMAKE_LIBRARY_PATH=${OUTPUT_DIR}/lib ${extraflags} ${BUILD_ARGS} - ${BUILD_DIR}/${id}/src/${id} - -DPACKAGE_CONFIG_PATH=${OUTPUT_DIR}/lib/pkgconfig - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DOUTPUT_DIR=${OUTPUT_DIR} - -DCMAKE_PREFIX_PATH=${OUTPUT_DIR} - -DCMAKE_INSTALL_PREFIX=${OUTPUT_DIR} - -DCMAKE_EXE_LINKER_FLAGS=-L${OUTPUT_DIR}/lib - -DCMAKE_INCLUDE_PATH=${OUTPUT_DIR}/include) - endif() - - externalproject_add(${id} - URL ${url} - DOWNLOAD_DIR ${BUILD_DIR}/download - CONFIGURE_COMMAND ${CONFIGURE_COMMAND} - "${EXTERNALPROJECT_SETUP}") - endif() - else() - externalproject_add(${id} - SOURCE_DIR ${dir} - "${EXTERNALPROJECT_SETUP}") - endif() - - if(deps) - add_dependencies(${id} ${deps}) - endif() - endif() - - # if the dependency is available for the target platform add it to the list of the addon's dependencies - # (even if the target already exists as it still has to be built before the addon) - if(${platform_found}) - list(APPEND ${addon}_DEPS ${id}) - endif() - endif() - endforeach() - - # make the ${addon}_DEPS variable available to the calling script - set(${addon}_DEPS "${${addon}_DEPS}" PARENT_SCOPE) -endfunction() - 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 @@ -# This script holds the main functions used to construct the build system - -# include system specific macros -include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/macros.cmake) - -# Add a library, optionally as a dependency of the main application -# Arguments: -# name name of the library to add -# Optional Arguments: -# NO_MAIN_DEPENDS if specified, the library is not added to main depends -# Implicit arguments: -# SOURCES the sources of the library -# HEADERS the headers of the library (only for IDE support) -# OTHERS other library related files (only for IDE support) -# On return: -# Library will be built, optionally added to ${core_DEPENDS} -function(core_add_library name) - cmake_parse_arguments(arg "NO_MAIN_DEPENDS" "" "" ${ARGN}) - - if(NOT SOURCES) - message(STATUS "No sources added to ${name} skipping") - return() - endif() - - add_library(${name} STATIC ${SOURCES} ${HEADERS} ${OTHERS}) - set_target_properties(${name} PROPERTIES PREFIX "") - if(NOT arg_NO_MAIN_DEPENDS) - set(core_DEPENDS ${name} ${core_DEPENDS} CACHE STRING "" FORCE) - endif() - - # Add precompiled headers to Kodi main libraries - if(WIN32 AND "${CMAKE_CURRENT_LIST_DIR}" MATCHES "^${CORE_SOURCE_DIR}/xbmc") - add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/win32/pch.cpp - PCH_TARGET kodi) - endif() - - # IDE support - if(CMAKE_GENERATOR MATCHES "Xcode") - file(RELATIVE_PATH parentfolder ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..) - set_target_properties(${name} PROPERTIES FOLDER "${parentfolder}") - elseif(CMAKE_GENERATOR MATCHES "Visual Studio") - file(RELATIVE_PATH foldername ${CORE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - set_target_properties(${name} PROPERTIES FOLDER "${foldername}") - source_group(" " REGULAR_EXPRESSION ".*") - endif() -endfunction() - -# Add a test library, and add sources to list for gtest integration macros -function(core_add_test_library name) - core_add_library(${name} NO_MAIN_DEPENDS) - set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL 1) - foreach(src ${SOURCES}) - set(test_sources ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${test_sources} CACHE STRING "" FORCE) - endforeach() - set(test_archives ${test_archives} ${name} CACHE STRING "" FORCE) -endfunction() - -# Add a data file to installation list with a mirror in build tree -# Arguments: -# file full path to file to mirror -# relative the relative base of file path in the build/install tree -# Optional Arguments: -# NO_INSTALL: exclude file from installation target -# Implicit arguments: -# CORE_SOURCE_DIR - root of source tree -# On return: -# Files is mirrored to the build tree and added to ${install_data} -# (if NO_INSTALL is not given). -function(copy_file_to_buildtree file relative) - cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN}) - string(REPLACE "${relative}/" "" outfile ${file}) - get_filename_component(outdir ${outfile} DIRECTORY) - - if(NOT TARGET export-files) - file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) - add_custom_target(export-files ALL COMMENT "Copying files into build tree" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake) - endif() - if(NOT ${CORE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR}) - if(VERBOSE) - message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") - endif() - file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake - "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") - endif() - if(NOT arg_NO_INSTALL) - list(APPEND install_data ${outfile}) - set(install_data ${install_data} PARENT_SCOPE) - endif() -endfunction() - -# Add data files to installation list with a mirror in build tree. -# reads list of files to install from a given list of text files. -# Arguments: -# pattern globbing pattern for text files to read -# Optional Arguments: -# NO_INSTALL: exclude files from installation target -# Implicit arguments: -# CORE_SOURCE_DIR - root of source tree -# On return: -# Files are mirrored to the build tree and added to ${install_data} -# (if NO_INSTALL is not given). -function(copy_files_from_filelist_to_buildtree pattern) - # copies files listed in text files to the buildtree - # Input: [glob pattern: filepattern] - cmake_parse_arguments(arg "NO_INSTALL" "" "" ${ARGN}) - list(APPEND pattern ${ARGN}) - list(SORT pattern) - if(VERBOSE) - message(STATUS "copy_files_from_filelist_to_buildtree - got pattern: ${pattern}") - endif() - foreach(pat ${pattern}) - file(GLOB filenames ${pat}) - foreach(filename ${filenames}) - string(STRIP ${filename} filename) - core_file_read_filtered(fstrings ${filename}) - foreach(dir ${fstrings}) - file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${dir}) - foreach(file ${files}) - if(arg_NO_INSTALL) - copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR} NO_INSTALL) - else() - copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR}) - endif() - endforeach() - endforeach() - endforeach() - endforeach() - set(install_data ${install_data} PARENT_SCOPE) -endfunction() - -# helper macro to set modified variables in parent scope -macro(export_dep) - set(SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE) - set(DEPLIBS ${DEPLIBS} PARENT_SCOPE) - set(DEP_DEFINES ${DEP_DEFINES} PARENT_SCOPE) - set(${depup}_FOUND ${${depup}_FOUND} PARENT_SCOPE) - mark_as_advanced(${depup}_LIBRARIES) -endmacro() - -# add a required dependency of main application -# Arguments: -# dep name of find rule for dependency, used uppercased for variable prefix -# On return: -# dependency added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} -function(core_require_dep dep) - find_package(${dep} REQUIRED) - string(TOUPPER ${dep} depup) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - list(APPEND DEPLIBS ${${depup}_LIBRARIES}) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - export_dep() -endfunction() - -# add a required dyloaded dependency of main application -# Arguments: -# dep name of find rule for dependency, used uppercased for variable prefix -# On return: -# dependency added to ${SYSTEM_INCLUDES}, ${dep}_SONAME is set up -function(core_require_dyload_dep dep) - find_package(${dep} REQUIRED) - string(TOUPPER ${dep} depup) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - find_soname(${depup} REQUIRED) - export_dep() - set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) -endfunction() - -# helper macro for optional deps -macro(setup_enable_switch) - string(TOUPPER ${dep} depup) - if (ARGV1) - set(enable_switch ${ARGV1}) - else() - set(enable_switch ENABLE_${depup}) - endif() -endmacro() - -# add an optional dependency of main application -# Arguments: -# dep name of find rule for dependency, used uppercased for variable prefix -# On return: -# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEPLIBS} and ${DEP_DEFINES} -function(core_optional_dep dep) - setup_enable_switch() - if(${enable_switch}) - find_package(${dep}) - if(${depup}_FOUND) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - list(APPEND DEPLIBS ${${depup}_LIBRARIES}) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) - export_dep() - else() - set(final_message ${final_message} "${depup} enabled: No" PARENT_SCOPE) - endif() - endif() -endfunction() - -# add an optional dyloaded dependency of main application -# Arguments: -# dep name of find rule for dependency, used uppercased for variable prefix -# On return: -# dependency optionally added to ${SYSTEM_INCLUDES}, ${DEP_DEFINES}, ${dep}_SONAME is set up -function(core_optional_dyload_dep dep) - setup_enable_switch() - if(${enable_switch}) - find_package(${dep}) - if(${depup}_FOUND) - list(APPEND SYSTEM_INCLUDES ${${depup}_INCLUDE_DIRS}) - find_soname(${depup} REQUIRED) - list(APPEND DEP_DEFINES ${${depup}_DEFINITIONS}) - set(final_message ${final_message} "${depup} enabled: Yes" PARENT_SCOPE) - export_dep() - set(${depup}_SONAME ${${depup}_SONAME} PARENT_SCOPE) - endif() - endif() -endfunction() - -function(core_file_read_filtered result filepattern) - # Reads STRINGS from text files - # with comments filtered out - # Result: [list: result] - # Input: [glob pattern: filepattern] - file(GLOB filenames ${filepattern}) - list(SORT filenames) - foreach(filename ${filenames}) - if(VERBOSE) - message(STATUS "core_file_read_filtered - filename: ${filename}") - endif() - file(STRINGS ${filename} fstrings REGEX "^[^#//]") - foreach(fstring ${fstrings}) - string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring}) - string(REGEX REPLACE "//.*" "" fstring ${fstring}) - string(STRIP ${fstring} fstring) - list(APPEND filename_strings ${fstring}) - endforeach() - endforeach() - set(${result} ${filename_strings} PARENT_SCOPE) -endfunction() - -function(core_add_subdirs_from_filelist files) - # Adds subdirectories from a sorted list of files - # Input: [list: filenames] [bool: sort] - foreach(arg ${ARGN}) - list(APPEND files ${arg}) - endforeach() - list(SORT files) - if(VERBOSE) - message(STATUS "core_add_subdirs_from_filelist - got pattern: ${files}") - endif() - foreach(filename ${files}) - string(STRIP ${filename} filename) - core_file_read_filtered(fstrings ${filename}) - foreach(subdir ${fstrings}) - STRING_SPLIT(subdir " " ${subdir}) - list(GET subdir 0 subdir_src) - list(GET subdir -1 subdir_dest) - if(VERBOSE) - message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") - endif() - add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) - endforeach() - endforeach() -endfunction() - -macro(core_add_optional_subdirs_from_filelist pattern) - # Adds subdirectories from text files - # if the option(s) in the 3rd field are enabled - # Input: [glob pattern: filepattern] - foreach(arg ${ARGN}) - list(APPEND pattern ${arg}) - endforeach() - foreach(elem ${pattern}) - string(STRIP ${elem} elem) - list(APPEND filepattern ${elem}) - endforeach() - - file(GLOB filenames ${filepattern}) - list(SORT filenames) - if(VERBOSE) - message(STATUS "core_add_optional_subdirs_from_filelist - got pattern: ${filenames}") - endif() - - foreach(filename ${filenames}) - if(VERBOSE) - message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}") - endif() - file(STRINGS ${filename} fstrings REGEX "^[^#//]") - foreach(line ${fstrings}) - string(REPLACE " " ";" line "${line}") - list(GET line 0 subdir_src) - list(GET line 1 subdir_dest) - list(GET line 3 opts) - foreach(opt ${opts}) - if(ENABLE_${opt}) - if(VERBOSE) - message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") - endif() - add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) - else() - if(VERBOSE) - message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir") - endif() - endif() - endforeach() - endforeach() - endforeach() -endmacro() - -macro(today RESULT) - if (WIN32) - execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}}) - elseif(UNIX) - execute_process(COMMAND date -u +%F - OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}}) - else() - message(SEND_ERROR "date not implemented") - set(${RESULT} 000000) - endif() - string(REGEX REPLACE "(\r?\n)+$" "" ${RESULT} "${${RESULT}}") -endmacro() - -function(core_find_git_rev) - find_package(Git) - if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- - RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - if (NOT status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD -- - RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - endif() - if (status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD - OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - string(SUBSTRING ${HASH} 1 13 HASH) - else() - execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD - OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - string(SUBSTRING ${HASH} 1 7 HASH) - endif() - execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD - OUTPUT_VARIABLE DATE - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - string(SUBSTRING ${DATE} 1 10 DATE) - else() - today(DATE) - set(HASH "nogitfound") - endif() - string(REPLACE "-" "" DATE ${DATE}) - set(GIT_REV "${DATE}-${HASH}") - if(GIT_REV) - set(APP_SCMID ${GIT_REV} PARENT_SCOPE) - endif() -endfunction() - -macro(core_find_versions) - include(CMakeParseArguments) - core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) - string(REPLACE " " ";" version_list "${version_list}") - cmake_parse_arguments(APP "" "VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_NAME;COMPANY_NAME" "" ${version_list}) - - set(APP_NAME ${APP_APP_NAME}) # inconsistency in upstream - string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) - set(COMPANY_NAME ${APP_COMPANY_NAME}) - set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) - if(APP_VERSION_TAG) - set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) - endif() - string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) - string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) - file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") - string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) - file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") - string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min}) -endmacro() 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 @@ -# - Collection of String utility macros. -# Defines the following macros: -# STRING_TRIM(var str [NOUNQUOTE]) -# - Trim a string by removing the leading and trailing spaces, -# just like STRING(STRIP ...) in CMake 2.6 and later. -# This macro is needed as CMake 2.4 does not support STRING(STRIP ..) -# This macro also remove quote and double quote marks around the string, -# unless NOUNQUOTE is defined. -# * Parameters: -# + var: A variable that stores the result. -# + str: A string. -# + NOUNQUOTE: (Optional) do not remove the double quote mark around the string. -# -# STRING_UNQUOTE(var str) -# - Remove double quote marks and quote marks around a string. -# If the string is not quoted, then it returns an empty string. -# * Parameters: -# + var: A variable that stores the result. -# + str: A string. -# -# STRING_JOIN(var delimiter str_list [str...]) -# - Concatenate strings, with delimiter inserted between strings. -# * Parameters: -# + var: A variable that stores the result. -# + str_list: A list of string. -# + str: (Optional) more string to be join. -# -# STRING_SPLIT(var delimiter str [NOESCAPE_SEMICOLON]) -# - Split a string into a list using a delimiter, which can be in 1 or more -# characters long. -# * Parameters: -# + var: A variable that stores the result. -# + delimiter: To separate a string. -# + str: A string. -# + NOESCAPE_SEMICOLON: (Optional) Do not escape semicolons. -# - -IF(NOT DEFINED _MANAGE_STRING_CMAKE_) - SET(_MANAGE_STRING_CMAKE_ "DEFINED") - - MACRO(STRING_TRIM var str) - SET(${var} "") - IF (NOT "${ARGN}" STREQUAL "NOUNQUOTE") - # Need not trim a quoted string. - STRING_UNQUOTE(_var "${str}") - IF(NOT _var STREQUAL "") - # String is quoted - SET(${var} "${_var}") - ENDIF(NOT _var STREQUAL "") - ENDIF(NOT "${ARGN}" STREQUAL "NOUNQUOTE") - - IF(${var} STREQUAL "") - SET(_var_1 "${str}") - STRING(REGEX REPLACE "^[ \t\r\n]+" "" _var_2 "${str}" ) - STRING(REGEX REPLACE "[ \t\r\n]+$" "" _var_3 "${_var_2}" ) - SET(${var} "${_var_3}") - ENDIF(${var} STREQUAL "") - ENDMACRO(STRING_TRIM var str) - - # Internal macro - # Variable cannot be escaped here, as variable is already substituted - # at the time it passes to this macro. - MACRO(STRING_ESCAPE var str) - # ';' and '\' are tricky, need to be encoded. - # '#' => '#H' - # '\' => '#B' - # ';' => '#S' - SET(_NOESCAPE_SEMICOLON "") - SET(_NOESCAPE_HASH "") - - FOREACH(_arg ${ARGN}) - IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") - ELSEIF(${_arg} STREQUAL "NOESCAPE_HASH") - SET(_NOESCAPE_HASH "NOESCAPE_HASH") - ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - ENDFOREACH(_arg) - - IF(_NOESCAPE_HASH STREQUAL "") - STRING(REGEX REPLACE "#" "#H" _ret "${str}") - ELSE(_NOESCAPE_HASH STREQUAL "") - SET(_ret "${str}") - ENDIF(_NOESCAPE_HASH STREQUAL "") - - STRING(REGEX REPLACE "\\\\" "#B" _ret "${_ret}") - IF(_NOESCAPE_SEMICOLON STREQUAL "") - STRING(REGEX REPLACE ";" "#S" _ret "${_ret}") - ENDIF(_NOESCAPE_SEMICOLON STREQUAL "") - SET(${var} "${_ret}") - ENDMACRO(STRING_ESCAPE var str) - - MACRO(STRING_UNESCAPE var str) - # '#B' => '\' - # '#H' => '#' - # '#D' => '$' - # '#S' => ';' - SET(_ESCAPE_VARIABLE "") - SET(_NOESCAPE_SEMICOLON "") - SET(_ret "${str}") - FOREACH(_arg ${ARGN}) - IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") - ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE") - SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE") - STRING(REGEX REPLACE "#D" "$" _ret "${_ret}") - ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - ENDFOREACH(_arg) - - STRING(REGEX REPLACE "#B" "\\\\" _ret "${_ret}") - IF(_NOESCAPE_SEMICOLON STREQUAL "") - # ';' => '#S' - STRING(REGEX REPLACE "#S" "\\\\;" _ret "${_ret}") - ELSE(_NOESCAPE_SEMICOLON STREQUAL "") - STRING(REGEX REPLACE "#S" ";" _ret "${_ret}") - ENDIF(_NOESCAPE_SEMICOLON STREQUAL "") - - IF(NOT _ESCAPE_VARIABLE STREQUAL "") - # '#D' => '$' - STRING(REGEX REPLACE "#D" "$" _ret "${_ret}") - ENDIF(NOT _ESCAPE_VARIABLE STREQUAL "") - STRING(REGEX REPLACE "#H" "#" _ret "${_ret}") - SET(${var} "${_ret}") - ENDMACRO(STRING_UNESCAPE var str) - - - MACRO(STRING_UNQUOTE var str) - STRING_ESCAPE(_ret "${str}" ${ARGN}) - IF(_ret MATCHES "^[ \t\r\n]+") - STRING(REGEX REPLACE "^[ \t\r\n]+" "" _ret "${_ret}") - ENDIF(_ret MATCHES "^[ \t\r\n]+") - IF(_ret MATCHES "^\"") - # Double quote - STRING(REGEX REPLACE "\"\(.*\)\"[ \t\r\n]*$" "\\1" _ret "${_ret}") - ELSEIF(_ret MATCHES "^'") - # Single quote - STRING(REGEX REPLACE "'\(.*\)'[ \t\r\n]*$" "\\1" _ret "${_ret}") - ELSE(_ret MATCHES "^\"") - SET(_ret "") - ENDIF(_ret MATCHES "^\"") - - # Unencoding - STRING_UNESCAPE(${var} "${_ret}" ${ARGN}) - ENDMACRO(STRING_UNQUOTE var str) - - MACRO(STRING_JOIN var delimiter str_list) - SET(_ret "") - FOREACH(_str ${str_list}) - IF(_ret STREQUAL "") - SET(_ret "${_str}") - ELSE(_ret STREQUAL "") - SET(_ret "${_ret}${delimiter}${_str}") - ENDIF(_ret STREQUAL "") - ENDFOREACH(_str ${str_list}) - - FOREACH(_str ${ARGN}) - IF(_ret STREQUAL "") - SET(_ret "${_str}") - ELSE(_ret STREQUAL "") - SET(_ret "${_ret}${delimiter}${_str}") - ENDIF(_ret STREQUAL "") - ENDFOREACH(_str ${str_list}) - SET(${var} "${_ret}") - ENDMACRO(STRING_JOIN var delimiter str_list) - - MACRO(STRING_SPLIT var delimiter str) - SET(_max_tokens "") - SET(_NOESCAPE_SEMICOLON "") - SET(_ESCAPE_VARIABLE "") - FOREACH(_arg ${ARGN}) - IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") - ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE") - SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE") - ELSE(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - SET(_max_tokens ${_arg}) - ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") - ENDFOREACH(_arg) - - IF(NOT _max_tokens) - SET(_max_tokens -1) - ENDIF(NOT _max_tokens) - - STRING_ESCAPE(_str "${str}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) - STRING_ESCAPE(_delimiter "${delimiter}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) - - SET(_str_list "") - SET(_token_count 0) - STRING(LENGTH "${_delimiter}" _de_len) - - WHILE(NOT _token_count EQUAL _max_tokens) - MATH(EXPR _token_count ${_token_count}+1) - IF(_token_count EQUAL _max_tokens) - # Last token, no need splitting - SET(_str_list ${_str_list} "${_str}") - ELSE(_token_count EQUAL _max_tokens) - # in case encoded characters are delimiters - STRING(LENGTH "${_str}" _str_len) - SET(_index 0) - SET(_token "") - SET(_str_remain "") - MATH(EXPR _str_end ${_str_len}-${_de_len}+1) - SET(_bound "k") - WHILE(_index LESS _str_end) - STRING(SUBSTRING "${_str}" ${_index} ${_de_len} _str_cursor) - IF(_str_cursor STREQUAL _delimiter) - # Get the token - STRING(SUBSTRING "${_str}" 0 ${_index} _token) - # Get the rest - MATH(EXPR _rest_index ${_index}+${_de_len}) - MATH(EXPR _rest_len ${_str_len}-${_index}-${_de_len}) - STRING(SUBSTRING "${_str}" ${_rest_index} ${_rest_len} _str_remain) - SET(_index ${_str_end}) - ELSE(_str_cursor STREQUAL _delimiter) - MATH(EXPR _index ${_index}+1) - ENDIF(_str_cursor STREQUAL _delimiter) - ENDWHILE(_index LESS _str_end) - - IF(_str_remain STREQUAL "") - # Meaning: end of string - LIST(APPEND _str_list "${_str}") - SET(_max_tokens ${_token_count}) - ELSE(_str_remain STREQUAL "") - LIST(APPEND _str_list "${_token}") - SET(_str "${_str_remain}") - ENDIF(_str_remain STREQUAL "") - ENDIF(_token_count EQUAL _max_tokens) - ENDWHILE(NOT _token_count EQUAL _max_tokens) - - - # Unencoding - STRING_UNESCAPE(${var} "${_str_list}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) - ENDMACRO(STRING_SPLIT var delimiter str) - -ENDIF(NOT DEFINED _MANAGE_STRING_CMAKE_) - 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 @@ -# This script configures installation paths - -include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/pathsetup.cmake) diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake deleted file mode 100644 index 8e9bd1c..0000000 --- a/project/cmake/scripts/common/prepare-env.cmake +++ /dev/null @@ -1,136 +0,0 @@ -# parse version.txt to get the version info -if(EXISTS "${APP_ROOT}/version.txt") - file(STRINGS "${APP_ROOT}/version.txt" versions) - foreach (version ${versions}) - if(version MATCHES "^VERSION_.*") - string(REGEX MATCH "^[^ ]+" version_name ${version}) - string(REPLACE "${version_name} " "" version_value ${version}) - set(APP_${version_name} "${version_value}") - else() - string(REGEX MATCH "^[^ ]+" name ${version}) - string(REPLACE "${name} " "" value ${version}) - set(${name} "${value}") - endif() - endforeach() - string(TOLOWER ${APP_NAME} APP_NAME_LC) - string(TOUPPER ${APP_NAME} APP_NAME_UC) -endif() - -# bail if we can't parse versions -if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) - message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists") -endif() - -# in case we need to download something, set KODI_MIRROR to the default if not alread set -if(NOT DEFINED KODI_MIRROR) - set(KODI_MIRROR "http://mirrors.kodi.tv") -endif() - -### copy all the addon binding header files to include/kodi -# make sure include/kodi exists and is empty -set(APP_LIB_DIR ${DEPENDS_PATH}/lib/${APP_NAME_LC}) -if(NOT EXISTS "${APP_LIB_DIR}/") - file(MAKE_DIRECTORY ${APP_LIB_DIR}) -endif() - -set(APP_INCLUDE_DIR ${DEPENDS_PATH}/include/${APP_NAME_LC}) -if(NOT EXISTS "${APP_INCLUDE_DIR}/") - file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) -endif() - -# we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc -set(XBMC_LIB_DIR ${DEPENDS_PATH}/lib/xbmc) -if(NOT EXISTS "${XBMC_LIB_DIR}/") - file(MAKE_DIRECTORY ${XBMC_LIB_DIR}) -endif() -set(XBMC_INCLUDE_DIR ${DEPENDS_PATH}/include/xbmc) -if(NOT EXISTS "${XBMC_INCLUDE_DIR}/") - file(MAKE_DIRECTORY ${XBMC_INCLUDE_DIR}) -endif() - -# make sure C++11 is always set -if(NOT WIN32) - string(REGEX MATCH "-std=(gnu|c)\\+\\+11" cxx11flag "${CMAKE_CXX_FLAGS}") - if(NOT cxx11flag) - set(CXX11_SWITCH "-std=c++11") - endif() -endif() - -# generate the proper kodi-config.cmake file -configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${APP_LIB_DIR}/kodi-config.cmake @ONLY) - -# copy cmake helpers to lib/kodi -file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake - ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake - DESTINATION ${APP_LIB_DIR}) - -# generate xbmc-config.cmake for backwards compatibility to xbmc -configure_file(${APP_ROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) - -### copy all the addon binding header files to include/kodi -# parse addon-bindings.mk to get the list of header files to copy -file(STRINGS ${APP_ROOT}/xbmc/addons/addon-bindings.mk bindings) -string(REPLACE "\n" ";" bindings "${bindings}") -foreach(binding ${bindings}) - string(REPLACE " =" ";" binding "${binding}") - string(REPLACE "+=" ";" binding "${binding}") - list(GET binding 1 header) - # copy the header file to include/kodi - file(COPY ${APP_ROOT}/${header} DESTINATION ${APP_INCLUDE_DIR}) - - # auto-generate header files for backwards compatibility to xbmc with deprecation warning - # but only do it if the file doesn't already exist - get_filename_component(headerfile ${header} NAME) - if (NOT EXISTS "${XBMC_INCLUDE_DIR}/${headerfile}") - file(WRITE ${XBMC_INCLUDE_DIR}/${headerfile} -"#pragma once -#define DEPRECATION_WARNING \"Including xbmc/${headerfile} has been deprecated, please use kodi/${headerfile}\" -#ifdef _MSC_VER - #pragma message(\"WARNING: \" DEPRECATION_WARNING) -#else - #warning DEPRECATION_WARNING -#endif -#include \"kodi/${headerfile}\"") - endif() -endforeach() - -### on windows we need a "patch" binary to be able to patch 3rd party sources -if(WIN32) - find_program(PATCH_FOUND NAMES patch patch.exe) - if(PATCH_FOUND) - message(STATUS "patch utility found at ${PATCH_FOUND}") - else() - set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3") - set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") - set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") - set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) - - # download the archive containing patch.exe - message(STATUS "Downloading patch utility from ${PATCH_URL}...") - file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) - list(GET PATCH_DL_STATUS 0 PATCH_RETCODE) - if(NOT ${PATCH_RETCODE} EQUAL 0) - message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}") - endif() - - # extract the archive containing patch.exe - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD} - WORKING_DIRECTORY ${BUILD_DIR}) - - # make sure the extraction worked and that patch.exe is there - set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME}) - set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe) - if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH}) - message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_DOWNLOAD_DIR}") - endif() - - # copy patch.exe into the output directory - file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${DEPENDS_PATH}/bin) - - # make sure that cmake can find the copied patch.exe - find_program(PATCH_FOUND NAMES patch patch.exe) - if(NOT PATCH_FOUND) - message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${DEPENDS_PATH}/bin") - endif() - endif() -endif() diff --git a/project/cmake/scripts/common/projectmacros.cmake b/project/cmake/scripts/common/projectmacros.cmake deleted file mode 100644 index 7ce4ee9..0000000 --- a/project/cmake/scripts/common/projectmacros.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# This script holds macros which are project specific - -# Pack a skin xbt file -# Arguments: -# input input directory to pack -# output ouput xbt file -# On return: -# xbt is added to ${XBT_FILES} -function(pack_xbt input output) - file(GLOB_RECURSE MEDIA_FILES ${input}/*) - get_filename_component(dir ${output} PATH) - add_custom_command(OUTPUT ${output} - COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} - COMMAND TexturePacker::TexturePacker - ARGS -input ${input} - -output ${output} - -dupecheck - DEPENDS ${MEDIA_FILES}) - list(APPEND XBT_FILES ${output}) - set(XBT_FILES ${XBT_FILES} PARENT_SCOPE) -endfunction() - -# Add a skin to installation list, mirroring it in build tree, packing textures -# Arguments: -# skin skin directory -# relative relative base path in build tree -# On return: -# xbt is added to ${XBT_FILES}, data added to ${install_data}, mirror in build tree -function(copy_skin_to_buildtree skin relative) - file(GLOB_RECURSE FILES ${skin}/*) - file(GLOB_RECURSE MEDIA_FILES ${skin}/media/*) - list(REMOVE_ITEM FILES ${MEDIA_FILES}) - foreach(file ${FILES}) - copy_file_to_buildtree(${file} ${relative}) - endforeach() - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media) - string(REPLACE "${relative}/" "" dest ${skin}) - pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt) - - file(GLOB THEMES RELATIVE ${skin}/themes ${skin}/themes/*) - foreach(theme ${THEMES}) - pack_xbt(${skin}/themes/${theme} ${CMAKE_BINARY_DIR}/${dest}/media/${theme}.xbt) - endforeach() - - set(XBT_FILES ${XBT_FILES} PARENT_SCOPE) - set(install_data ${install_data} PARENT_SCOPE) -endfunction() - -# Get GTest tests as CMake tests. -# Copied from FindGTest.cmake -# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code -function(GTEST_ADD_TESTS executable extra_args) - if(NOT ARGN) - message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS") - endif() - foreach(source ${ARGN}) - file(READ "${source}" contents) - string(REGEX MATCHALL "TEST_?[F]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) - foreach(hit ${found_tests}) - string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit}) - add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args}) - endforeach() - # Groups parametrized tests under a single ctest entry - string(REGEX MATCHALL "INSTANTIATE_TEST_CASE_P\\(([^,]+), *([^,]+)" found_tests2 ${contents}) - foreach(hit ${found_tests2}) - string(SUBSTRING ${hit} 24 -1 test_name) - string(REPLACE "," ";" test_name "${test_name}") - list(GET test_name 0 filter_name) - list(GET test_name 1 test_prefix) - string(STRIP ${test_prefix} test_prefix) - add_test(${test_prefix}.${filter_name} ${executable} --gtest_filter=${filter_name}* ${extra_args}) - endforeach() - endforeach() -endfunction() - -function(whole_archive output) - if(CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(${output} -Wl,--whole-archive ${ARGN} -Wl,--no-whole-archive PARENT_SCOPE) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) - foreach(library ${ARGN}) - list(APPEND ${output} -Wl,-force_load ${library}) - set(${output} ${${output}} PARENT_SCOPE) - endforeach() - else() - set(${output} ${ARGN} PARENT_SCOPE) - endif() -endfunction() diff --git a/project/cmake/scripts/darwin/archsetup.cmake b/project/cmake/scripts/darwin/archsetup.cmake deleted file mode 100644 index accb8ab..0000000 --- a/project/cmake/scripts/darwin/archsetup.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for darwin. See ${PROJECT_SOURCE_DIR}/README.md") -endif() - -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) - -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) -set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE - -D__STDC_CONSTANT_MACROS) -set(PLATFORM_DIR linux) -set(CMAKE_SYSTEM_NAME Darwin) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL x86_64) - set(ARCH x86_64-apple-darwin) - elseif(CPU STREQUAL i386) - set(ARCH i386-apple-darwin) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -find_package(CXX11 REQUIRED) - -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) - -list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit" - "-framework IOSurface" "-framework SystemConfiguration" - "-framework ApplicationServices" "-framework AppKit" - "-framework CoreAudio" "-framework AudioToolbox" - "-framework CoreGraphics") diff --git a/project/cmake/scripts/darwin/install.cmake b/project/cmake/scripts/darwin/install.cmake deleted file mode 100644 index e69de29..0000000 diff --git a/project/cmake/scripts/darwin/macros.cmake b/project/cmake/scripts/darwin/macros.cmake deleted file mode 100644 index 4ee17c2..0000000 --- a/project/cmake/scripts/darwin/macros.cmake +++ /dev/null @@ -1,108 +0,0 @@ -function(core_link_library lib wraplib) - if(CMAKE_GENERATOR MATCHES "Unix Makefiles") - set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) - elseif(CMAKE_GENERATOR MATCHES "Xcode") - set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) - else() - message(FATAL_ERROR "Unsupported generator in core_link_library") - endif() - - set(export -bundle -undefined dynamic_lookup -read_only_relocs suppress - -Wl,-alias_list,${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def - ${CORE_BUILD_DIR}/${wrapper_obj}) - set(check_arg "") - if(TARGET ${lib}) - set(target ${lib}) - set(link_lib $) - set(check_arg ${ARGV2}) - set(data_arg ${ARGV3}) - else() - set(target ${ARGV2}) - set(link_lib ${lib}) - set(check_arg ${ARGV3}) - set(data_arg ${ARGV4}) - endif() - if(check_arg STREQUAL export) - set(export ${export} - -Wl,--version-script=${ARGV3}) - elseif(check_arg STREQUAL nowrap) - set(export ${data_arg}) - elseif(check_arg STREQUAL extras) - foreach(arg ${data_arg}) - list(APPEND export ${arg}) - endforeach() - endif() - get_filename_component(dir ${wraplib} PATH) - - # We can't simply pass the linker flags to the args section of the custom command - # because cmake will add quotes around it (and the linker will fail due to those). - # We need to do this handstand first ... - separate_arguments(CUSTOM_COMMAND_ARGS_LDFLAGS UNIX_COMMAND "${CMAKE_SHARED_LINKER_FLAGS}") - - add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} - COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} - COMMAND ${CMAKE_C_COMPILER} - ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} - -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} - DEPENDS ${target} wrapper.def wrapper - VERBATIM) - - # Uncomment to create wrap_ targets for debugging - #get_filename_component(libname ${wraplib} NAME_WE) - #add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) - - list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) - set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) -endfunction() - -function(find_soname lib) - cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) - - string(TOLOWER ${lib} liblow) - if(${lib}_LDFLAGS) - set(link_lib "${${lib}_LDFLAGS}") - else() - set(link_lib "${${lib}_LIBRARIES}") - endif() - - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs - COMMAND fgrep libraries: - COMMAND sed "s/[^=]*=\\(.*\\)/\\1/" - COMMAND sed "s/:/ /g" - ERROR_QUIET - OUTPUT_VARIABLE cc_lib_path - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND echo ${link_lib} - COMMAND sed "s/-L[ ]*//g" - COMMAND sed "s/-l[^ ]*//g" - ERROR_QUIET - OUTPUT_VARIABLE env_lib_path - OUTPUT_STRIP_TRAILING_WHITESPACE) - - foreach(path ${cc_lib_path} ${env_lib_path}) - if(IS_DIRECTORY ${path}) - execute_process(COMMAND ls -- ${path}/lib${liblow}.dylib - ERROR_QUIET - OUTPUT_VARIABLE lib_file - OUTPUT_STRIP_TRAILING_WHITESPACE) - else() - set(lib_file ${path}) - endif() - if(lib_file) - # we want the path/name that is embedded in the dylib - execute_process(COMMAND otool -L ${lib_file} - COMMAND grep -v lib${liblow}.dylib - COMMAND grep ${liblow} - COMMAND awk "{V=1; print $V}" - ERROR_QUIET - OUTPUT_VARIABLE filename - OUTPUT_STRIP_TRAILING_WHITESPACE) - get_filename_component(${lib}_SONAME "${filename}" NAME) - message(STATUS "${lib} soname: ${${lib}_SONAME}") - endif() - endforeach() - if(arg_REQUIRED AND NOT ${lib}_SONAME) - message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") - endif() - set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) -endfunction() diff --git a/project/cmake/scripts/darwin/pathsetup.cmake b/project/cmake/scripts/darwin/pathsetup.cmake deleted file mode 100644 index 071dfd4..0000000 --- a/project/cmake/scripts/darwin/pathsetup.cmake +++ /dev/null @@ -1,32 +0,0 @@ -if(NOT prefix) - set(prefix ${DEPENDS_PATH}) -endif() -if(NOT exec_prefix) - set(exec_prefix ${prefix}) -endif() -if(NOT libdir) - set(libdir ${prefix}/lib) -endif() -if(NOT bindir) - set(bindir ${prefix}/bin) -endif() -if(NOT includedir) - set(includedir ${prefix}/include) -endif() -if(NOT datarootdir) - set(datarootdir ${prefix}/share) -endif() -if(NOT datadir) - set(datadir ${datarootdir}) -endif() - -list(APPEND final_message "-- PATH config --") -list(APPEND final_message "Prefix: ${prefix}") -list(APPEND final_message "Libdir: ${libdir}") -list(APPEND final_message "Bindir: ${bindir}") -list(APPEND final_message "Includedir: ${includedir}") -list(APPEND final_message "Datarootdir: ${datarootdir}") -list(APPEND final_message "Datadir: ${datadir}") - -set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" - -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/freebsd/ArchSetup.cmake b/project/cmake/scripts/freebsd/ArchSetup.cmake new file mode 100644 index 0000000..013205c --- /dev/null +++ b/project/cmake/scripts/freebsd/ArchSetup.cmake @@ -0,0 +1,16 @@ +set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD) +set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) +set(PLATFORM_DIR linux) +set(SYSTEM_LDFLAGS -L/usr/local/lib) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CMAKE_SYSTEM_PROCESSOR STREQUAL amd64) + set(ARCH x86_64-freebsd) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86") + set(ARCH x86-freebsd) + else() + message(WARNING "unknown CPU: ${CPU}") + endif() +endif() 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/archsetup.cmake b/project/cmake/scripts/freebsd/archsetup.cmake deleted file mode 100644 index b85121f..0000000 --- a/project/cmake/scripts/freebsd/archsetup.cmake +++ /dev/null @@ -1,19 +0,0 @@ -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_FREEBSD) -set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED - -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) -set(PLATFORM_DIR linux) -set(SYSTEM_LDFLAGS -L/usr/local/lib) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CMAKE_SYSTEM_PROCESSOR STREQUAL amd64) - set(ARCH x86_64-freebsd) - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i.86") - set(ARCH x86-freebsd) - else() - message(WARNING "unknown CPU: ${CPU}") - endif() -endif() - -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") -set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE}) 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 @@ -set(libdir ${CMAKE_INSTALL_PREFIX}/lib) -set(bindir ${CMAKE_INSTALL_PREFIX}/bin) - -configure_file(${CORE_SOURCE_DIR}/tools/Linux/xbmc.sh.in - ${CORE_BUILD_DIR}/scripts/xbmc @ONLY) -configure_file(${CORE_SOURCE_DIR}/tools/Linux/xbmc-standalone.sh.in - ${CORE_BUILD_DIR}/scripts/xbmc-standalone @ONLY) - -install(TARGETS xbmc-xrandr DESTINATION lib/xbmc) -install(FILES ${addon_bindings} DESTINATION include/xbmc) -install(FILES ${cmake_files} ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/modules/xbmc-config.cmake - DESTINATION lib/xbmc) -install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/xbmc - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/xbmc-standalone - DESTINATION bin) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/FEH.py - DESTINATION share/xbmc) - -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/xbmc-xsession.desktop - RENAME XBMC.desktop - DESTINATION share/xsessions) - -install(FILES ${CORE_SOURCE_DIR}/copying.txt - ${CORE_SOURCE_DIR}/LICENSE.GPL - ${CORE_SOURCE_DIR}/version.txt - ${CORE_SOURCE_DIR}/docs/README.freebsd - DESTINATION share/doc/xbmc) - -foreach(texture ${XBT_FILES}) - string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) - get_filename_component(dir ${dir} PATH) - install(FILES ${texture} - DESTINATION share/xbmc/${dir}) -endforeach() - -foreach(wraplib ${WRAP_FILES}) - get_filename_component(dir ${wraplib} PATH) - install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib} - DESTINATION lib/xbmc/${dir}) -endforeach() - -foreach(file ${install_data}) - get_filename_component(dir ${file} PATH) - install(FILES ${CMAKE_BINARY_DIR}/${file} - DESTINATION share/xbmc/${dir}) -endforeach() - -install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) - foreach(dir \${dirs}) - file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) - foreach(file \${FILES}) - get_filename_component(dir \${file} PATH) - file(INSTALL \${file} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/xbmc/\${dir}) - endforeach() - endforeach()") -foreach(subdir ${build_dirs}) - string(REPLACE " " ";" subdir ${subdir}) - list(GET subdir 0 id) - install(CODE "execute_process(COMMAND make -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install)") -endforeach() 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 @@ -include(../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 @@ -include(${PROJECT_SOURCE_DIR}/scripts/linux/pathsetup.cmake) diff --git a/project/cmake/scripts/ios/ArchSetup.cmake b/project/cmake/scripts/ios/ArchSetup.cmake new file mode 100644 index 0000000..56661e2 --- /dev/null +++ b/project/cmake/scripts/ios/ArchSetup.cmake @@ -0,0 +1,36 @@ +if(NOT CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${PROJECT_SOURCE_DIR}/README.md") +endif() + +set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.m) + +set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) +set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + -D__STDC_CONSTANT_MACROS) +set(PLATFORM_DIR linux) +set(CMAKE_SYSTEM_NAME Darwin) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) + set(ARCH arm-osx) + set(NEON False) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() +endif() + +find_package(CXX11 REQUIRED) + +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) + +list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" + "-framework CoreAudio" "-framework AudioToolbox" + "-framework QuartzCore" "-framework MediaPlayer" + "-framework CFNetwork" "-framework CoreGraphics" + "-framework Foundation" "-framework UIKit" + "-framework CoreMedia" "-framework AVFoundation" + "-framework VideoToolbox") + +set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) +set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) 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 @@ +# IOS packaging + +set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}-iphoneos) + +file(MAKE_DIRECTORY ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app) +set(BUNDLE_RESOURCES xbmc/platform/darwin/ios/Default-568h@2x.png + xbmc/platform/darwin/ios/Default-667h@2x.png + xbmc/platform/darwin/ios/Default-736h@3x.png + xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png + tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png + tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png + tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png + tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png + tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png + tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png + tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png + tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png + tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) + +foreach(resource IN LISTS BUNDLE_RESOURCES) + configure_file(${CORE_SOURCE_DIR}/${resource} ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app COPYONLY) +endforeach() +configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings + ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/English.lproj/InfoPlist.strings COPYONLY) + +configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in + ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/Info.plist @ONLY) + +add_custom_target(bundle + COMMAND ${CMAKE_COMMAND} -E copy $ ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/${APP_NAME}.bin + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h + ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h + COMMAND "ACTION=build" + "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" + "TARGET_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + "PRODUCT_NAME=${APP_NAME}" + "WRAPPER_EXTENSION=app" + "SRCROOT=${CMAKE_BINARY_DIR}" + ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command + COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" + "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" + "TARGET_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + "PRODUCT_NAME=${APP_NAME}" + "FULL_PRODUCT_NAME=${APP_NAME}.app" + "WRAPPER_EXTENSION=app" + "SRCROOT=${CMAKE_BINARY_DIR}" + ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command) +add_dependencies(bundle ${APP_NAME_LC}) + +set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) +configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh @ONLY) +configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) + +add_custom_target(deb + COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.." + "PLATFORM_NAME=${PLATFORM}" + "CODESIGNING_FOLDER_PATH=${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app" + "BUILT_PRODUCTS_DIR=${PACKAGE_OUTPUT_DIR}" + "WRAPPER_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + "CODE_SIGN_IDENTITY=\"\"" + ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command + COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) +add_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/archsetup.cmake b/project/cmake/scripts/ios/archsetup.cmake deleted file mode 100644 index e6639f7..0000000 --- a/project/cmake/scripts/ios/archsetup.cmake +++ /dev/null @@ -1,38 +0,0 @@ -if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${PROJECT_SOURCE_DIR}/README.md") -endif() - -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.m) - -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) -set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE - -D__STDC_CONSTANT_MACROS) -set(PLATFORM_DIR linux) -set(CMAKE_SYSTEM_NAME Darwin) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL armv7) - set(ARCH arm-apple-darwin) - elseif(CPU STREQUAL arm64) - set(ARCH arm-apple-darwin) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -find_package(CXX11 REQUIRED) - -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) - -list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" - "-framework CoreAudio" "-framework AudioToolbox" - "-framework QuartzCore" "-framework MediaPlayer" - "-framework CFNetwork" "-framework CoreGraphics" - "-framework Foundation" "-framework UIKit" - "-framework CoreMedia" "-framework AVFoundation") - -set(ENABLE_DVDCSS OFF) -set(ENABLE_OPTICAL OFF) -set(ENABLE_VTB ON) -set(VTB_FOUND 1 CACHE INTERNAL "VTB") 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 @@ -../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 @@ -../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 @@ -../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 @@ +set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX) +set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) +set(PLATFORM_DIR linux) +set(CMAKE_SYSTEM_NAME Linux) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL x86_64) + set(ARCH x86_64-linux) + set(NEON False) + elseif(CPU MATCHES "i.86") + set(ARCH i486-linux) + set(NEON False) + add_options(CXX ALL_BUILDS "-msse") + elseif(CPU MATCHES arm) + set(ARCH arm) + set(NEON True) + elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64) + set(ARCH aarch64) + set(NEON False) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() +endif() + +# Make sure we strip binaries in Release build +if(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") +endif() + +find_package(CXX11 REQUIRED) +include(LDGOLD) + +# Code Coverage +if(CMAKE_BUILD_TYPE STREQUAL Coverage) + set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test) + set(COVERAGE_SOURCE_DIR ${CORE_SOURCE_DIR}) + set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") + set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) +endif() 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 @@ +# - CodeCoverage +# Generate code coverage reports with LCOV and GCovr. +# +# Configuration: +# COVERAGE_SOURCE_DIR - Source root directory (default ${CMAKE_SOURCE_DIR}). +# COVERAGE_BINARY_DIR - Directory where the coverage reports (and intermediate files) +# are generated to. +# COVERAGE_EXCLUDES - List of exclude patterns (for example '*/tests/*'). +# +# The following targets will be generated: +# coverage - Builds an html report. Requires LCOV. +# coverage_xml - Builds an xml report (in Cobertura format for Jenkins). +# Requires Gcovr. +# +# Inspired by https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake + +# Comiler and linker setup +set(CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING + "Flags used by the C compiler during coverage builds." FORCE) +set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING + "Flags used by the C++ compiler during coverage builds." FORCE) +set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING + "Flags used for linking binaries during coverage builds." FORCE) +set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING + "Flags used by the shared libraries linker during coverage builds." FORCE) +mark_as_advanced( + CMAKE_C_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE + CMAKE_SHARED_LINKER_FLAGS_COVERAGE CMAKE_STATIC_LINKER_FLAGS_COVERAGE +) + +find_program(LCOV_EXECUTABLE lcov) +find_program(GENINFO_EXECUTABLE geninfo) +find_program(GENHTML_EXECUTABLE genhtml) +find_program(GCOVR_EXECUTABLE gcovr) +mark_as_advanced(LCOV_EXECUTABLE GENINFO_EXECUTABLE GENHTML_EXECUTABLE GCOVR_EXECUTABLE) + +# Default options +if(NOT COVERAGE_SOURCE_DIR) + set(COVERAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +endif() +if(NOT COVERAGE_BINARY_DIR) + set(COVERAGE_BINARY_DIR ${CMAKE_BINARY_DIR}/coverage) +endif() +if(NOT COVERAGE_EXCLUDES) + set(COVERAGE_EXCLUDES) +endif() + +# Allow variables in COVERAGE_DEPENDS that are not evaluated before this file is included. +string(CONFIGURE "${COVERAGE_DEPENDS}" COVERAGE_DEPENDS) + +# Add coverage target that generates an HTML report using LCOV +if(LCOV_EXECUTABLE AND GENINFO_EXECUTABLE AND GENHTML_EXECUTABLE) + file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR}) + add_custom_target(coverage + COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_BINARY_DIR} + COMMAND ${LCOV_EXECUTABLE} -z -q -d ${CMAKE_BINARY_DIR} + COMMAND ${LCOV_EXECUTABLE} -c -q -i -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR} + -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true + COMMAND ${LCOV_EXECUTABLE} -c -q -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR} + -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info + COMMAND ${LCOV_EXECUTABLE} -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info + -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info + -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info -q + COMMAND ${LCOV_EXECUTABLE} -q -r ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info + /usr/include/* ${CMAKE_BINARY_DIR}/* ${COVERAGE_EXCLUDES} + -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info + COMMAND ${GENHTML_EXECUTABLE} ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info + -o ${COVERAGE_BINARY_DIR}/html -s --legend --highlight --demangle-cpp + COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/html/index.html" + WORKING_DIRECTORY ${COVERAGE_BINARY_DIR} + VERBATIM + DEPENDS ${COVERAGE_DEPENDS} + COMMENT "Generate code coverage html report" + ) +else() + message(WARNING "Target coverage not available (lcov, geninfo and genhtml needed).") +endif() + +# Add coverage target that generates an XML report using Gcovr +if(GCOVR_EXECUTABLE) + file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR}) + string(REGEX REPLACE "([^;]+)" "--exclude=\"\\1\"" _gcovr_excludes "${COVERAGE_EXCLUDES}") + string(REPLACE "*" ".*" _gcovr_excludes "${_gcovr_excludes}") + add_custom_target(coverage_xml + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true + COMMAND ${GCOVR_EXECUTABLE} -x -r ${COVERAGE_SOURCE_DIR} -o ${COVERAGE_BINARY_DIR}/coverage.xml + --object-directory ${CMAKE_BINARY_DIR} ${_gcovr_excludes} ${CMAKE_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/coverage.xml" + WORKING_DIRECTORY ${COVERAGE_BINARY_DIR} + DEPENDS ${COVERAGE_DEPENDS} + COMMENT "Generate code coverage xml report" + ) + unset(_gcovr_excludes) +else() + message(WARNING "Target coverage_xml not available (gcovr needed).") +endif() 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 @@ +# xrandr +if(ENABLE_X11 AND X_FOUND AND XRANDR_FOUND) + find_package(X QUIET) + find_package(XRandR QUIET) + add_executable(${APP_NAME_LC}-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c) + target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) +endif() + +# WiiRemote +if(ENABLE_EVENTCLIENTS) + add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) +endif() 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 @@ +if(X_FOUND) + set(USE_X11 1) +else() + set(USE_X11 0) +endif() +if(OPENGL_FOUND) + set(USE_OPENGL 1) +else() + set(USE_OPENGL 0) +endif() +if(OPENGLES_FOUND) + set(USE_OPENGLES 1) +else() + set(USE_OPENGLES 0) +endif() + +# CMake config +set(APP_PREFIX ${prefix}) +set(APP_LIB_DIR ${libdir}/${APP_NAME_LC}) +set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC}) +set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC}) +set(CXX11_SWITCH "-std=c++11") + +# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone +if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) + if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND) + file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) + set(XBMC_STANDALONE_SH_PULSE ${pulse_content}) + endif() +endif() + +# Configure startup scripts +configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in + ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) +configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in + ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) + +# Configure cmake files +configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in + ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY) + +# Configure xsession entry +configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in + ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY) + +# Install app +install(TARGETS ${APP_NAME_LC} + DESTINATION ${libdir}/${APP_NAME_LC} + COMPONENT kodi-bin) +if(ENABLE_X11 AND XRANDR_FOUND) + install(TARGETS ${APP_NAME_LC}-xrandr + DESTINATION ${libdir}/${APP_NAME_LC} + COMPONENT kodi-bin) +endif() + +# Install scripts +install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} + ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone + DESTINATION ${bindir} + COMPONENT kodi-bin) + +# Install libraries +foreach(library ${LIBRARY_FILES}) + get_filename_component(dir ${library} DIRECTORY) + string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${dir}) + install(PROGRAMS ${library} + DESTINATION ${libdir}/${APP_NAME_LC}/${dir} + COMPONENT kodi-bin) +endforeach() + +# Install add-ons, fonts, icons, keyboard maps, keymaps, etc +# (addons, media, system, userdata folders in share/kodi/) +foreach(file ${install_data}) + get_filename_component(dir ${file} DIRECTORY) + install(FILES ${CMAKE_BINARY_DIR}/${file} + DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir} + COMPONENT kodi) +endforeach() + +# Install xsession entry +install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop + DESTINATION ${datarootdir}/xsessions + COMPONENT kodi) + +# Install desktop entry +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop + DESTINATION ${datarootdir}/applications + COMPONENT kodi) + +# Install icons +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/16x16/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/22x22/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/24x24/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/32x32/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/48x48/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/64x64/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/128x128/apps + COMPONENT kodi) +install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png + RENAME ${APP_NAME_LC}.png + DESTINATION ${datarootdir}/icons/hicolor/256x256/apps + COMPONENT kodi) +install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t + $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)" + COMPONENT kodi) + +# Install docs +install(FILES ${CORE_SOURCE_DIR}/copying.txt + ${CORE_SOURCE_DIR}/LICENSE.GPL + ${CORE_SOURCE_DIR}/version.txt + ${CORE_SOURCE_DIR}/docs/README.linux + DESTINATION ${datarootdir}/doc/${APP_NAME_LC} + COMPONENT kodi) + +install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt + DESTINATION ${datarootdir}/${APP_NAME_LC} + COMPONENT kodi) + +# Install kodi-tools-texturepacker +install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker + DESTINATION ${bindir} + COMPONENT kodi-tools-texturepacker) + +# Install kodi-addon-dev headers +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h + ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h + ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-addon-dev) + +# Install kodi-addon-dev add-on bindings +install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake + ${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake + DESTINATION ${datarootdir}/${APP_NAME_LC}/cmake + COMPONENT kodi-addon-dev) + +# Install kodi-audio-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-audio-dev) + +if(ENABLE_EVENTCLIENTS) + # Install kodi-eventclients-common BT python files + install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py + DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt + COMPONENT kodi-eventclients-common) + + # Install kodi-eventclients-common PS3 python files + install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py + DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3 + COMPONENT kodi-eventclients-common) + + # Install kodi-eventclients-common python files + file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/") + install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py + "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py + ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py + DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC} + COMPONENT kodi-eventclients-common) + + # Install kodi-eventclients-common icons + install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png + ${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png + ${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png + ${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png + DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC} + COMPONENT kodi-eventclients-common) + + # Install kodi-eventclients-dev headers + install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-eventclients-dev) + + # Install kodi-eventclients-dev C# examples + install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs" + DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#" + COMPONENT kodi-eventclients-dev) + + # Install kodi-eventclients-dev C++ examples + install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp + ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp + ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp + ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp + ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp + DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++ + COMPONENT kodi-eventclients-dev) + + # Install kodi-eventclients-dev java examples + install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java + DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java + COMPONENT kodi-eventclients-dev) + + # Install kodi-eventclients-dev python examples + install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py + ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py + ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py + ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py + ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py + ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py + DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python + COMPONENT kodi-eventclients-dev) + + # Install kodi-eventclients-ps3 + install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" + RENAME ${APP_NAME_LC}-ps3remote + DESTINATION ${bindir} + COMPONENT kodi-eventclients-ps3) + + # Install kodi-eventclients-wiiremote + install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/WiiRemote/${APP_NAME_LC}-wiiremote + DESTINATION ${bindir} + COMPONENT kodi-eventclients-wiiremote) + + # Install kodi-eventclients-xbmc-send + install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py" + RENAME ${APP_NAME_LC}-send + DESTINATION ${bindir} + COMPONENT kodi-eventclients-xbmc-send) +endif() + +# Install kodi-inputstream-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-inputstream-dev) + +# Install kodi-pvr-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-pvr-dev) + +# Install kodi-screensaver-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-screensaver-dev) + +# Install kodi-visualization-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-visualization-dev) + +# Install kodi-peripheral-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-peripheral-dev) + +# Install XBT skin files +foreach(texture ${XBT_FILES}) + string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) + get_filename_component(dir ${dir} DIRECTORY) + install(FILES ${texture} + DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir} + COMPONENT kodi) +endforeach() + +# Install extra stuff if it exists +if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs) + install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) + foreach(dir \${dirs}) + file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) + foreach(file \${FILES}) + get_filename_component(dir \${file} DIRECTORY) + file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir}) + endforeach() + endforeach()") +endif() + +if(NOT "$ENV{DESTDIR}" STREQUAL "") + set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR}) +endif() +foreach(subdir ${build_dirs}) + if(NOT subdir MATCHES kodi-platform) + string(REPLACE " " ";" subdir ${subdir}) + list(GET subdir 0 id) + install(CODE "execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})") + endif() +endforeach() + +# generate packages? yes please, if everything checks out +if(CPACK_GENERATOR) + if(CPACK_GENERATOR STREQUAL DEB AND CORE_SYSTEM_NAME STREQUAL linux) + if(CMAKE_BUILD_TYPE STREQUAL Debug) + message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.") + endif() + include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake) + else() + message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.") + endif() +endif() diff --git a/project/cmake/scripts/linux/Macros.cmake b/project/cmake/scripts/linux/Macros.cmake new file mode 100644 index 0000000..72e9d5c --- /dev/null +++ b/project/cmake/scripts/linux/Macros.cmake @@ -0,0 +1,95 @@ +function(core_link_library lib wraplib) + set(export -Wl,--unresolved-symbols=ignore-all + `cat ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def` + ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) + set(check_arg "") + if(TARGET ${lib}) + set(target ${lib}) + set(link_lib $) + set(check_arg ${ARGV2}) + set(data_arg ${ARGV3}) + else() + set(target ${ARGV2}) + set(link_lib ${lib}) + set(check_arg ${ARGV3}) + set(data_arg ${ARGV4}) + endif() + + # wrapper has to be adapted in order to support coverage. + if(CMAKE_BUILD_TYPE STREQUAL Coverage) + set(export "") + endif() + + if(check_arg STREQUAL export) + set(export ${export} + -Wl,--version-script=${ARGV3}) + elseif(check_arg STREQUAL extras) + foreach(arg ${data_arg}) + list(APPEND export ${arg}) + endforeach() + elseif(check_arg STREQUAL archives) + set(extra_libs ${data_arg}) + endif() + + string(REGEX REPLACE "[ ]+" ";" _flags ${CMAKE_SHARED_LINKER_FLAGS}) + get_filename_component(dir ${wraplib} DIRECTORY) + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND ${CMAKE_C_COMPILER} + ARGS ${_flags} -Wl,--whole-archive + "${link_lib}" ${extra_libs} + -Wl,--no-whole-archive -lm + -Wl,-soname,${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} + -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} + ${export} + DEPENDS ${target} wrapper.def wrapper) + + get_filename_component(libname ${wraplib} NAME_WE) + add_custom_target(wrap_${libname} ALL DEPENDS ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) + set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped) + add_dependencies(${APP_NAME_LC}-libraries wrap_${libname}) + + set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} CACHE STRING "" FORCE) +endfunction() + +function(find_soname lib) + cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) + + string(TOLOWER ${lib} liblow) + if(${lib}_LDFLAGS) + set(link_lib "${${lib}_LDFLAGS}") + else() + if(IS_ABSOLUTE "${${lib}_LIBRARIES}") + set(link_lib "${${lib}_LIBRARIES}") + else() + set(link_lib -l${${lib}_LIBRARIES}) + endif() + endif() + execute_process(COMMAND ${CMAKE_C_COMPILER} -nostdlib -o /dev/null -Wl,-M ${link_lib} + COMMAND grep LOAD.*${liblow} + ERROR_QUIET + OUTPUT_VARIABLE ${lib}_FILENAME) + string(REPLACE "LOAD " "" ${lib}_FILENAME "${${lib}_FILENAME}") + string(STRIP "${${lib}_FILENAME}" ${lib}_FILENAME) + if(NOT ${lib}_FILENAME) + execute_process(COMMAND ${CMAKE_C_COMPILER} -nostdlib -o /dev/null -Wl,-t ${link_lib} + OUTPUT_QUIET + ERROR_VARIABLE _TMP_FILENAME) + string(REGEX MATCH ".*lib${liblow}.so" ${lib}_FILENAME ${_TMP_FILENAME}) + endif() + if(${lib}_FILENAME) + execute_process(COMMAND objdump -p ${${lib}_FILENAME} + COMMAND grep SONAME.*${liblow} + ERROR_QUIET + OUTPUT_VARIABLE ${lib}_SONAME) + string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME}) + string(STRIP ${${lib}_SONAME} ${lib}_SONAME) + if(VERBOSE) + message(STATUS "${lib} soname: ${${lib}_SONAME}") + endif() + set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) + endif() + if(arg_REQUIRED AND NOT ${lib}_SONAME) + message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") + endif() +endfunction() 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 @@ +include(GNUInstallDirs) + +if(NOT prefix) + set(prefix ${CMAKE_INSTALL_PREFIX}) +else() + set(CMAKE_INSTALL_PREFIX ${prefix}) +endif() +if(NOT exec_prefix) + set(exec_prefix ${prefix}) +endif() +if(NOT libdir) + set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) +endif() +if(NOT bindir) + set(bindir ${CMAKE_INSTALL_FULL_BINDIR}) +endif() +if(NOT includedir) + set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +endif() +if(NOT datarootdir) + set(datarootdir ${CMAKE_INSTALL_FULL_DATAROOTDIR}) +endif() +if(NOT datadir) + set(datadir ${CMAKE_INSTALL_FULL_DATADIR}) +endif() +if(NOT docdir) + set(docdir ${CMAKE_INSTALL_FULL_DOCDIR}) +endif() + +list(APPEND final_message "-- PATH config --") +list(APPEND final_message "Prefix: ${prefix}") +list(APPEND final_message "Libdir: ${libdir}") +list(APPEND final_message "Bindir: ${bindir}") +list(APPEND final_message "Includedir: ${includedir}") +list(APPEND final_message "Datarootdir: ${datarootdir}") +list(APPEND final_message "Datadir: ${datadir}") + +set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" + -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 @@ -set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX) -set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED - -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) -set(PLATFORM_DIR linux) -set(CMAKE_SYSTEM_NAME Linux) -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL x86_64) - set(ARCH x86_64-linux) - elseif(CPU MATCHES "i.86") - set(ARCH i486-linux) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -find_package(CXX11 REQUIRED) - -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") -set(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 @@ -if(X_FOUND) - set(USE_X11 1) -else() - set(USE_X11 0) -endif() -if(OPENGL_FOUND) - set(USE_OPENGL 1) -else() - set(USE_OPENGL 0) -endif() -if(OPENGLES_FOUND) - set(USE_OPENGLES 1) -else() - set(USE_OPENGLES 0) -endif() - -configure_file(${CORE_SOURCE_DIR}/project/cmake/${APP_NAME_LC}-config.cmake.in - ${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake @ONLY) - -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in - ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) - -# Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone -if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) - if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND) - file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) - set(XBMC_STANDALONE_SH_PULSE ${pulse_content}) - endif() -endif() - -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in - ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) - -install(TARGETS ${APP_NAME_LC} DESTINATION ${libdir}/kodi) -if(ENABLE_X11 AND XRANDR_FOUND) - install(TARGETS ${APP_NAME_LC}-xrandr DESTINATION ${libdir}/${APP_NAME_LC}) -endif() - -if(NOT EXISTS ${libdir}/xbmc) -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${libdir})") -endif() -install(FILES ${addon_bindings} DESTINATION ${includedir}/kodi) -if(NOT EXISTS ${includedir}/xbmc) -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${includedir})") -endif() - -install(FILES ${cmake_files} - DESTINATION ${libdir}/kodi) -install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake - DESTINATION ${libdir}/${APP_NAME_LC}) -install(FILES ${CORE_SOURCE_DIR}/project/cmake/xbmc-config.cmake.in - RENAME xbmc-config.cmake - DESTINATION ${libdir}/${APP_NAME_LC}) - -install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone - DESTINATION ${bindir}) -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC} xbmc WORKING_DIRECTORY ${bindir})") -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}-standalone xbmc-standalone WORKING_DIRECTORY ${bindir})") - -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in - ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop) -install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop - DESTINATION ${datarootdir}/xsessions) -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}.desktop xbmc.desktop WORKING_DIRECTORY ${datarootdir}/xsessions/)") - -if(NOT EXISTS ${datarootdir}/xbmc) -install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${datarootdir})") -endif() - -install(FILES ${CORE_SOURCE_DIR}/copying.txt - ${CORE_SOURCE_DIR}/LICENSE.GPL - ${CORE_SOURCE_DIR}/version.txt - ${CORE_SOURCE_DIR}/docs/README.linux - DESTINATION ${datarootdir}/doc/kodi) - -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop - DESTINATION ${datarootdir}/applications) - -foreach(texture ${XBT_FILES}) - string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) - get_filename_component(dir ${dir} PATH) - install(FILES ${texture} - DESTINATION ${datarootdir}/kodi/${dir}) -endforeach() - -foreach(wraplib ${WRAP_FILES}) - get_filename_component(dir ${wraplib} PATH) - install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib} - DESTINATION ${libdir}/kodi/${dir}) -endforeach() - -foreach(file ${install_data}) - get_filename_component(dir ${file} PATH) - install(FILES ${CMAKE_BINARY_DIR}/${file} - DESTINATION ${datarootdir}/kodi/${dir}) -endforeach() - -if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs) - install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) - foreach(dir \${dirs}) - file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) - foreach(file \${FILES}) - get_filename_component(dir \${file} PATH) - file(INSTALL \${file} DESTINATION ${datarootdir}/kodi/\${dir}) - endforeach() - endforeach()") -endif() - -if(NOT "$ENV{DESTDIR}" STREQUAL "") - set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR}) -endif() -foreach(subdir ${build_dirs}) - if(NOT subdir MATCHES kodi-platform) - string(REPLACE " " ";" subdir ${subdir}) - list(GET subdir 0 id) - install(CODE "execute_process(COMMAND make -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})") - endif() -endforeach() - -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/16x16/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/22x22/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/24x24/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/32x32/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/48x48/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/64x64/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/128x128/apps) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png - RENAME ${APP_NAME_LC}.png - DESTINATION ${datarootdir}/icons/hicolor/256x256/apps) - -install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)") diff --git a/project/cmake/scripts/linux/macros.cmake b/project/cmake/scripts/linux/macros.cmake deleted file mode 100644 index 7453a1c..0000000 --- a/project/cmake/scripts/linux/macros.cmake +++ /dev/null @@ -1,79 +0,0 @@ -function(core_link_library lib wraplib) - set(export -Wl,--unresolved-symbols=ignore-all - `cat ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def` - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) - set(check_arg "") - if(TARGET ${lib}) - set(target ${lib}) - set(link_lib ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${lib}/${lib}.a) - set(check_arg ${ARGV2}) - set(data_arg ${ARGV3}) - else() - set(target ${ARGV2}) - set(link_lib ${lib}) - set(check_arg ${ARGV3}) - set(data_arg ${ARGV4}) - endif() - if(check_arg STREQUAL export) - set(export ${export} - -Wl,--version-script=${ARGV3}) - elseif(check_arg STREQUAL nowrap) - set(export ${data_arg}) - elseif(check_arg STREQUAL extras) - foreach(arg ${data_arg}) - list(APPEND export ${arg}) - endforeach() - endif() - get_filename_component(dir ${wraplib} PATH) - add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} - COMMAND cmake -E make_directory ${dir} - COMMAND ${CMAKE_C_COMPILER} - ARGS -Wl,--whole-archive - ${link_lib} - -Wl,--no-whole-archive -lm - -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} - ${export} - DEPENDS ${target} wrapper.def wrapper) - list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) - set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) -endfunction() - -function(find_soname lib) - cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) - - string(TOLOWER ${lib} liblow) - if(${lib}_LDFLAGS) - set(link_lib "${${lib}_LDFLAGS}") - else() - if(IS_ABSOLUTE "${${lib}_LIBRARIES}") - set(link_lib "${${lib}_LIBRARIES}") - else() - set(link_lib -l${${lib}_LIBRARIES}) - endif() - endif() - execute_process(COMMAND ${CMAKE_C_COMPILER} -nostdlib -o /dev/null -Wl,-M ${link_lib} - COMMAND grep LOAD.*${liblow} - ERROR_QUIET - OUTPUT_VARIABLE ${lib}_FILENAME) - string(REPLACE "LOAD " "" ${lib}_FILENAME "${${lib}_FILENAME}") - string(STRIP "${${lib}_FILENAME}" ${lib}_FILENAME) - if(NOT ${lib}_FILENAME) - execute_process(COMMAND ${CMAKE_C_COMPILER} -nostdlib -o /dev/null -Wl,-t ${link_lib} - OUTPUT_QUIET - ERROR_VARIABLE _TMP_FILENAME) - string(REGEX MATCH ".*lib${liblow}.so" ${lib}_FILENAME ${_TMP_FILENAME}) - endif() - if(${lib}_FILENAME) - execute_process(COMMAND objdump -p ${${lib}_FILENAME} - COMMAND grep SONAME.*${liblow} - ERROR_QUIET - OUTPUT_VARIABLE ${lib}_SONAME) - string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME}) - string(STRIP ${${lib}_SONAME} ${lib}_SONAME) - message(STATUS "${lib} soname: ${${lib}_SONAME}") - set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) - endif() - if(arg_REQUIRED AND NOT ${lib}_SONAME) - message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") - endif() -endfunction() diff --git a/project/cmake/scripts/linux/pathsetup.cmake b/project/cmake/scripts/linux/pathsetup.cmake deleted file mode 100644 index 8550616..0000000 --- a/project/cmake/scripts/linux/pathsetup.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT prefix) - set(prefix ${CMAKE_INSTALL_PREFIX}) -else() - set(CMAKE_INSTALL_PREFIX ${prefix}) -endif() -if(NOT exec_prefix) - set(exec_prefix ${prefix}) -endif() -if(NOT libdir) - set(libdir ${prefix}/lib) -endif() -if(NOT bindir) - set(bindir ${prefix}/bin) -endif() -if(NOT includedir) - set(includedir ${prefix}/include) -endif() -if(NOT datarootdir) - set(datarootdir ${prefix}/share) -endif() -if(NOT datadir) - set(datadir ${datarootdir}) -endif() - -list(APPEND final_message "-- PATH config --") -list(APPEND final_message "Prefix: ${prefix}") -list(APPEND final_message "Libdir: ${libdir}") -list(APPEND final_message "Bindir: ${bindir}") -list(APPEND final_message "Includedir: ${includedir}") -list(APPEND final_message "Datarootdir: ${datarootdir}") -list(APPEND final_message "Datadir: ${datadir}") - -set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" - -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/osx/ArchSetup.cmake b/project/cmake/scripts/osx/ArchSetup.cmake new file mode 100644 index 0000000..3047863 --- /dev/null +++ b/project/cmake/scripts/osx/ArchSetup.cmake @@ -0,0 +1,34 @@ +if(NOT CMAKE_TOOLCHAIN_FILE) + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for osx. See ${PROJECT_SOURCE_DIR}/README.md") +endif() + +set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp + ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm + ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) + +set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) +set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE + -D__STDC_CONSTANT_MACROS) +set(PLATFORM_DIR linux) +set(CMAKE_SYSTEM_NAME Darwin) +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL x86_64 OR CPU STREQUAL i386) + set(ARCH x86-osx) + set(NEON False) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() +endif() + +find_package(CXX11 REQUIRED) + +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) + +list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit" + "-framework IOSurface" "-framework SystemConfiguration" + "-framework ApplicationServices" "-framework AppKit" + "-framework CoreAudio" "-framework AudioToolbox" + "-framework CoreGraphics" "-framework CoreMedia" + "-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 @@ +# XBMCHelper +add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) +add_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 @@ +# OSX packaging + +set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}) + +configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/Info.plist.in + ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist @ONLY) +execute_process(COMMAND perl -p -i -e "s/r####/${APP_SCMID}/" ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist) + +add_custom_target(bundle + COMMAND ${CMAKE_COMMAND} -E copy $ ${PACKAGE_OUTPUT_DIR}/${APP_NAME} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h + ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h + COMMAND "ACTION=build" + "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" + "TARGET_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + "SRCROOT=${CMAKE_BINARY_DIR}" + ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-osx.command + COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" + "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" + "TARGET_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + "FULL_PRODUCT_NAME=${APP_NAME}.app" + "SRCROOT=${CMAKE_BINARY_DIR}" + ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) +set_target_properties(bundle PROPERTIES FOLDER "Build Utilities") +add_dependencies(bundle ${APP_NAME_LC}) + +configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh.in + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh @ONLY) + +add_custom_target(dmg + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/ + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/osx/ + ${CMAKE_BINARY_DIR}/tools/darwin/packaging/media/osx/ + COMMAND ./mkdmg-osx.sh ${CORE_BUILD_CONFIG} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) +set_target_properties(dmg PROPERTIES FOLDER "Build Utilities") +add_dependencies(dmg bundle) diff --git a/project/cmake/scripts/osx/Macros.cmake b/project/cmake/scripts/osx/Macros.cmake new file mode 100644 index 0000000..0d04439 --- /dev/null +++ b/project/cmake/scripts/osx/Macros.cmake @@ -0,0 +1,111 @@ +function(core_link_library lib wraplib) + if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja) + set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) + elseif(CMAKE_GENERATOR MATCHES "Xcode") + set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) + else() + message(FATAL_ERROR "Unsupported generator in core_link_library") + endif() + + set(export -bundle -undefined dynamic_lookup -read_only_relocs suppress + -Wl,-alias_list,${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def + ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${wrapper_obj}) + set(extension ${CMAKE_SHARED_MODULE_SUFFIX}) + set(check_arg "") + if(TARGET ${lib}) + set(target ${lib}) + set(link_lib $) + set(check_arg ${ARGV2}) + set(data_arg ${ARGV3}) + else() + set(target ${ARGV2}) + set(link_lib ${lib}) + set(check_arg ${ARGV3}) + set(data_arg ${ARGV4}) + endif() + if(check_arg STREQUAL export) + set(export ${export} + -Wl,--version-script=${ARGV3}) + elseif(check_arg STREQUAL extras) + foreach(arg ${data_arg}) + list(APPEND export ${arg}) + endforeach() + elseif(check_arg STREQUAL archives) + set(extra_libs ${data_arg}) + endif() + get_filename_component(dir ${wraplib} DIRECTORY) + + # We can't simply pass the linker flags to the args section of the custom command + # because cmake will add quotes around it (and the linker will fail due to those). + # We need to do this handstand first ... + string(REPLACE " " ";" CUSTOM_COMMAND_ARGS_LDFLAGS ${CMAKE_SHARED_LINKER_FLAGS}) + + add_custom_command(OUTPUT ${wraplib}-${ARCH}${extension} + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND ${CMAKE_C_COMPILER} + ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} ${extra_libs} + -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} + DEPENDS ${target} wrapper.def wrapper + VERBATIM) + + get_filename_component(libname ${wraplib} NAME_WE) + add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${extension}) + set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped) + add_dependencies(${APP_NAME_LC}-libraries wrap_${libname}) + + set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} CACHE STRING "" FORCE) +endfunction() + +function(find_soname lib) + cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) + + string(TOLOWER ${lib} liblow) + if(${lib}_LDFLAGS) + set(link_lib "${${lib}_LDFLAGS}") + else() + set(link_lib "${${lib}_LIBRARIES}") + endif() + + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs + COMMAND fgrep libraries: + COMMAND sed "s/[^=]*=\\(.*\\)/\\1/" + COMMAND sed "s/:/ /g" + ERROR_QUIET + OUTPUT_VARIABLE cc_lib_path + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND echo ${link_lib} + COMMAND sed "s/-L[ ]*//g" + COMMAND sed "s/-l[^ ]*//g" + ERROR_QUIET + OUTPUT_VARIABLE env_lib_path + OUTPUT_STRIP_TRAILING_WHITESPACE) + + foreach(path ${cc_lib_path} ${env_lib_path}) + if(IS_DIRECTORY ${path}) + execute_process(COMMAND ls -- ${path}/lib${liblow}.dylib + ERROR_QUIET + OUTPUT_VARIABLE lib_file + OUTPUT_STRIP_TRAILING_WHITESPACE) + else() + set(lib_file ${path}) + endif() + if(lib_file) + # we want the path/name that is embedded in the dylib + execute_process(COMMAND otool -L ${lib_file} + COMMAND grep -v lib${liblow}.dylib + COMMAND grep ${liblow} + COMMAND awk "{V=1; print $V}" + ERROR_QUIET + OUTPUT_VARIABLE filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + get_filename_component(${lib}_SONAME "${filename}" NAME) + if(VERBOSE) + message(STATUS "${lib} soname: ${${lib}_SONAME}") + endif() + endif() + endforeach() + if(arg_REQUIRED AND NOT ${lib}_SONAME) + message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") + endif() + set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) +endfunction() diff --git a/project/cmake/scripts/osx/PathSetup.cmake b/project/cmake/scripts/osx/PathSetup.cmake new file mode 100644 index 0000000..071dfd4 --- /dev/null +++ b/project/cmake/scripts/osx/PathSetup.cmake @@ -0,0 +1,32 @@ +if(NOT prefix) + set(prefix ${DEPENDS_PATH}) +endif() +if(NOT exec_prefix) + set(exec_prefix ${prefix}) +endif() +if(NOT libdir) + set(libdir ${prefix}/lib) +endif() +if(NOT bindir) + set(bindir ${prefix}/bin) +endif() +if(NOT includedir) + set(includedir ${prefix}/include) +endif() +if(NOT datarootdir) + set(datarootdir ${prefix}/share) +endif() +if(NOT datadir) + set(datadir ${datarootdir}) +endif() + +list(APPEND final_message "-- PATH config --") +list(APPEND final_message "Prefix: ${prefix}") +list(APPEND final_message "Libdir: ${libdir}") +list(APPEND final_message "Bindir: ${bindir}") +list(APPEND final_message "Includedir: ${includedir}") +list(APPEND final_message "Datarootdir: ${datarootdir}") +list(APPEND final_message "Datadir: ${datadir}") + +set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" + -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/rbpi/ArchSetup.cmake b/project/cmake/scripts/rbpi/ArchSetup.cmake new file mode 100644 index 0000000..fa1f9f4 --- /dev/null +++ b/project/cmake/scripts/rbpi/ArchSetup.cmake @@ -0,0 +1,28 @@ +set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI + -DHAS_OMXPLAYER -DHAVE_OMXLIB) +set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) +set(PLATFORM_DIR linux) + +string(REGEX REPLACE "[ ]+" ";" SYSTEM_LDFLAGS $ENV{LDFLAGS}) +set(CMAKE_SYSTEM_NAME Linux) + +if(WITH_ARCH) + set(ARCH ${WITH_ARCH}) +else() + if(CPU STREQUAL arm1176jzf-s) + set(ARCH arm-linux-gnueabihf) + set(NEON False) + elseif(CPU MATCHES "cortex-a7" OR CPU MATCHES "cortex-a53") + set(ARCH arm-linux-gnueabihf) + set(NEON True) + else() + message(SEND_ERROR "Unknown CPU: ${CPU}") + endif() +endif() + +find_package(CXX11 REQUIRED) + +set(MMAL_FOUND 1 CACHE INTERNAL "MMAL") +set(OMX_FOUND 1 CACHE INTERNAL "OMX") +set(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/archsetup.cmake b/project/cmake/scripts/rbpi/archsetup.cmake deleted file mode 100644 index 72a610f..0000000 --- a/project/cmake/scripts/rbpi/archsetup.cmake +++ /dev/null @@ -1,32 +0,0 @@ -if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for rbpi. See ${PROJECT_SOURCE_DIR}/README.md") -endif() - -set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI - -DHAS_OMXPLAYER -DHAVE_OMXLIB) -set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED - -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) -set(PLATFORM_DIR linux) - -string(REGEX REPLACE "[ ]+" ";" SYSTEM_LDFLAGS $ENV{LDFLAGS}) -set(CMAKE_SYSTEM_NAME Linux) - -if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) -else() - if(CPU STREQUAL arm1176jzf-s) - set(ARCH arm-linux-gnueabihf) - elseif(CPU MATCHES "cortex-a7") - set(ARCH arm-linux-gnueabihf) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -endif() - -find_package(CXX11 REQUIRED) - -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") -set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE}) -set(MMAL_FOUND 1 CACHE INTERNAL "MMAL") -set(OMX_FOUND 1 CACHE INTERNAL "OMX") -set(OMXLIB_FOUND 1 CACHE INTERNAL "OMX") 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 @@ -../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 @@ -../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 @@ -../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 new file mode 100644 index 0000000..431b641 --- /dev/null +++ b/project/cmake/scripts/windows/ArchSetup.cmake @@ -0,0 +1,89 @@ +# -------- Architecture settings --------- + +set(ARCH win32) + + +# -------- Paths (mainly for find_package) --------- + +set(PLATFORM_DIR platform/win32) + +# Precompiled headers fail with per target output directory. (needs CMake 3.1) +set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) + +set(CMAKE_SYSTEM_NAME Windows) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg) +list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies) + +set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) + + +# -------- Compiler options --------- + +add_options(CXX ALL_BUILDS "/wd\"4996\"") +set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS) +set(SYSTEM_DEFINES -DNOMINMAX -D_USE_32BIT_TIME_T -DHAS_DX -D__STDC_CONSTANT_MACROS + -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING + -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" + -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" + $<$:-DD3D_DEBUG_INFO -D_ITERATOR_DEBUG_LEVEL=0>) + +# Make sure /FS is set for Visual Studio in order to prevent simultanious access to pdb files. +if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}") +endif() + +# Google Test needs to use shared version of runtime libraries +set(gtest_force_shared_crt ON CACHE STRING "" FORCE) + + +# -------- Linker options --------- + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + +# For #pragma comment(lib X) +# TODO: It would certainly be better to handle these libraries via CMake modules. +link_directories(${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin + ${PROJECT_SOURCE_DIR}/../BuildDependencies/lib) + +# Additional libraries +list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib + PowrProf.lib setupapi.lib dwmapi.lib yajl.lib dxguid.lib DelayImp.lib) + +# NODEFAULTLIB option +set(_nodefaultlibs_RELEASE libcmt) +set(_nodefaultlibs_DEBUG libcmt msvcrt) +foreach(_lib ${_nodefaultlibs_RELEASE}) + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:\"${_lib}\"") +endforeach() +foreach(_lib ${_nodefaultlibs_DEBUG}) + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:\"${_lib}\"") +endforeach() + +# DELAYLOAD option +set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll + avcodec-57.dll avfilter-6.dll avformat-57.dll avutil-55.dll + postproc-54.dll swresample-2.dll swscale-4.dll d3dcompiler_47.dll) +foreach(_lib ${_delayloadlibs}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") +endforeach() + +# Make the Release version create a PDB +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") +# Minimize the size or the resulting DLLs +set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF") + + +# -------- Visual Studio options --------- + +if(CMAKE_GENERATOR MATCHES "Visual Studio") + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + + # Generate a batch file that opens Visual Studio with the necessary env variables set. + file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat + "@echo off\n" + "set KODI_HOME=%~dp0\n" + "set PATH=%~dp0\\system\n" + "start %~dp0\\${PROJECT_NAME}.sln") +endif() diff --git a/project/cmake/scripts/windows/CFlagOverrides.cmake b/project/cmake/scripts/windows/CFlagOverrides.cmake new file mode 100644 index 0000000..3158e75 --- /dev/null +++ b/project/cmake/scripts/windows/CFlagOverrides.cmake @@ -0,0 +1,5 @@ +if(MSVC) + set(CMAKE_C_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") + set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") + set(CMAKE_C_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") +endif() diff --git a/project/cmake/scripts/windows/CXXFlagOverrides.cmake b/project/cmake/scripts/windows/CXXFlagOverrides.cmake new file mode 100644 index 0000000..0b52dc6 --- /dev/null +++ b/project/cmake/scripts/windows/CXXFlagOverrides.cmake @@ -0,0 +1,5 @@ +if(MSVC) + set(CMAKE_CXX_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") + set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") + set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") +endif() diff --git a/project/cmake/scripts/windows/Install.cmake b/project/cmake/scripts/windows/Install.cmake new file mode 100644 index 0000000..e69de29 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 @@ +function(core_link_library lib wraplib) + message(AUTHOR_WARNING "core_link_library is not compatible with windows.") +endfunction() + +function(find_soname lib) + # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h. + # Therefore the output of this function is unused. +endfunction() + +# Add precompiled header to target +# Arguments: +# target existing target that will be set up to compile with a precompiled header +# pch_header the precompiled header file +# pch_source the precompiled header source file +# Optional Arguments: +# PCH_TARGET build precompiled header as separate target with the given name +# so that the same precompiled header can be used for multiple libraries +# EXCLUDE_SOURCES if not all target sources shall use the precompiled header, +# the relevant files can be listed here +# On return: +# Compiles the pch_source into a precompiled header and adds the header to +# the given target +function(add_precompiled_header target pch_header pch_source) + cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN}) + + if(PCH_PCH_TARGET) + set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch) + else() + set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch) + endif() + + # Set compile options and dependency for sources + get_target_property(sources ${target} SOURCES) + list(REMOVE_ITEM sources ${pch_source}) + foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES) + list(REMOVE_ITEM sources ${exclude_source}) + endforeach() + set_source_files_properties(${sources} + PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\"" + OBJECT_DEPENDS "${pch_binary}") + + # Set compile options for precompiled header + if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch) + set_source_files_properties(${pch_source} + PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\"" + OBJECT_OUTPUTS "${pch_binary}") + endif() + + # Compile precompiled header + if(PCH_PCH_TARGET) + # As own target for usage in multiple libraries + if(NOT TARGET ${PCH_PCH_TARGET}_pch) + add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source}) + set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140 + COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR} + FOLDER "Build Utilities") + endif() + # From VS2012 onwards, precompiled headers have to be linked against (LNK2011). + target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch) + set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140 + COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) + else() + # As part of the target + target_sources(${target} PRIVATE ${pch_source}) + endif() +endfunction() diff --git a/project/cmake/scripts/windows/PathSetup.cmake b/project/cmake/scripts/windows/PathSetup.cmake new file mode 100644 index 0000000..8550616 --- /dev/null +++ b/project/cmake/scripts/windows/PathSetup.cmake @@ -0,0 +1,34 @@ +if(NOT prefix) + set(prefix ${CMAKE_INSTALL_PREFIX}) +else() + set(CMAKE_INSTALL_PREFIX ${prefix}) +endif() +if(NOT exec_prefix) + set(exec_prefix ${prefix}) +endif() +if(NOT libdir) + set(libdir ${prefix}/lib) +endif() +if(NOT bindir) + set(bindir ${prefix}/bin) +endif() +if(NOT includedir) + set(includedir ${prefix}/include) +endif() +if(NOT datarootdir) + set(datarootdir ${prefix}/share) +endif() +if(NOT datadir) + set(datadir ${datarootdir}) +endif() + +list(APPEND final_message "-- PATH config --") +list(APPEND final_message "Prefix: ${prefix}") +list(APPEND final_message "Libdir: ${libdir}") +list(APPEND final_message "Bindir: ${bindir}") +list(APPEND final_message "Includedir: ${includedir}") +list(APPEND final_message "Datarootdir: ${datarootdir}") +list(APPEND final_message "Datadir: ${datadir}") + +set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" + -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/project/cmake/scripts/windows/archsetup.cmake b/project/cmake/scripts/windows/archsetup.cmake deleted file mode 100644 index a54ab65..0000000 --- a/project/cmake/scripts/windows/archsetup.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -------- Architecture settings --------- - -set(ARCH win32) - - -# -------- Paths (mainly for find_package) --------- - -set(PLATFORM_DIR win32) - -# Precompiled headers fail with per target output directory. (needs CMake 3.1) -set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) - -set(CMAKE_SYSTEM_NAME Windows) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg) -list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies) - -set(JPEG_NAMES ${JPEG_NAMES} jpeg-static) -set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) - - -# -------- Compiler options --------- - -add_options(CXX ALL_BUILDS "/wd\"4996\"") -set(ARCH_DEFINES -D_WINDOWS -DTARGET_WINDOWS) -set(SYSTEM_DEFINES -DNOMINMAX -D_USE_32BIT_TIME_T -DHAS_DX -D__STDC_CONSTANT_MACROS - -DTAGLIB_STATIC -DNPT_CONFIG_ENABLE_LOGGING - -DPLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi" - -DPLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi" - -DBUILDING_WITH_CMAKE - $<$:-DD3D_DEBUG_INFO -D_ITERATOR_DEBUG_LEVEL=0>) - -# Make sure /FS is set for Visual Studio in order to prevent simultanious access to pdb files. -if(CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMAKE_CXX_FLAGS "/MP /FS ${CMAKE_CXX_FLAGS}") -endif() - - -# -------- Linker options --------- - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - -# For #pragma comment(lib X) -# TODO: It would certainly be better to handle these libraries via CMake modules. -link_directories(${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin - ${PROJECT_SOURCE_DIR}/../BuildDependencies/lib) - -# Additional libraries -list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib - PowrProf.lib setupapi.lib dwmapi.lib yajl.lib dxguid.lib DelayImp.lib) - -# NODEFAULTLIB option -set(_nodefaultlibs_RELEASE libcmt) -set(_nodefaultlibs_DEBUG libcmt msvcrt) -foreach(_lib ${_nodefaultlibs_RELEASE}) - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:\"${_lib}\"") -endforeach() -foreach(_lib ${_nodefaultlibs_DEBUG}) - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:\"${_lib}\"") -endforeach() - -# DELAYLOAD option -set(_delayloadlibs zlib.dll libmysql.dll libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll - avcodec-57.dll avfilter-6.dll avformat-57.dll avutil-55.dll - postproc-54.dll swresample-2.dll swscale-4.dll d3dcompiler_47.dll) -foreach(_lib ${_delayloadlibs}) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"") -endforeach() - -# Make the Release version create a PDB -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") -# Minimize the size or the resulting DLLs -set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF") - - -# -------- Visual Studio options --------- - -if(CMAKE_GENERATOR MATCHES "Visual Studio") - set_property(GLOBAL PROPERTY USE_FOLDERS ON) -endif() diff --git a/project/cmake/scripts/windows/c-flag-overrides.cmake b/project/cmake/scripts/windows/c-flag-overrides.cmake deleted file mode 100644 index fd85f5c..0000000 --- a/project/cmake/scripts/windows/c-flag-overrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_C_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") - set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_C_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif(MSVC) diff --git a/project/cmake/scripts/windows/cxx-flag-overrides.cmake b/project/cmake/scripts/windows/cxx-flag-overrides.cmake deleted file mode 100644 index 536b809..0000000 --- a/project/cmake/scripts/windows/cxx-flag-overrides.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(MSVC) - set(CMAKE_CXX_FLAGS_INIT "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") - set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") -endif(MSVC) diff --git a/project/cmake/scripts/windows/install.cmake b/project/cmake/scripts/windows/install.cmake deleted file mode 100644 index e69de29..0000000 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 @@ -function(core_link_library lib wraplib) -# set(export -Wl,--unresolved-symbols=ignore-all -# `cat ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def` -# ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) -# set(check_arg "") -# if(TARGET ${lib}) -# set(target ${lib}) -# set(link_lib ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${lib}/${lib}.a) -# set(check_arg ${ARGV2}) -# set(data_arg ${ARGV3}) -# else() -# set(target ${ARGV2}) -# set(link_lib ${lib}) -# set(check_arg ${ARGV3}) -# set(data_arg ${ARGV4}) -# endif() -# if(check_arg STREQUAL "export") -# set(export ${export} -# -Wl,--version-script=${ARGV3}) -# elseif(check_arg STREQUAL "nowrap") -# set(export ${data_arg}) -# elseif(check_arg STREQUAL "extras") -# foreach(arg ${data_arg}) -# list(APPEND export ${arg}) -# endforeach() -# endif() -# get_filename_component(dir ${wraplib} PATH) -# add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} -# COMMAND cmake -E make_directory ${dir} -# COMMAND ${CMAKE_C_COMPILER} -# ARGS -Wl,--whole-archive -# ${link_lib} -# -Wl,--no-whole-archive -lm -# -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} -# ${export} -# DEPENDS ${target} wrapper.def wrapper) -# list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) -# set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) -endfunction() - -function(find_soname lib) - # Windows uses hardcoded dlls in xbmc/DllPaths_win32.h. - # Therefore the output of this function is unused. -endfunction() - -# Add precompiled header to target -# Arguments: -# target existing target that will be set up to compile with a precompiled header -# pch_header the precompiled header file -# pch_source the precompiled header source file -# Optional Arguments: -# PCH_TARGET build precompiled header as separate target with the given name -# so that the same precompiled header can be used for multiple libraries -# EXCLUDE_SOURCES if not all target sources shall use the precompiled header, -# the relevant files can be listed here -# On return: -# Compiles the pch_source into a precompiled header and adds the header to -# the given target -function(add_precompiled_header target pch_header pch_source) - cmake_parse_arguments(PCH "" "PCH_TARGET" "EXCLUDE_SOURCES" ${ARGN}) - - if(PCH_PCH_TARGET) - set(pch_binary ${PRECOMPILEDHEADER_DIR}/${PCH_PCH_TARGET}.pch) - else() - set(pch_binary ${PRECOMPILEDHEADER_DIR}/${target}.pch) - endif() - - # Set compile options and dependency for sources - get_target_property(sources ${target} SOURCES) - list(REMOVE_ITEM sources ${pch_source}) - foreach(exclude_source IN LISTS PCH_EXCLUDE_SOURCES) - list(REMOVE_ITEM sources ${exclude_source}) - endforeach() - set_source_files_properties(${sources} - PROPERTIES COMPILE_FLAGS "/Yu\"${pch_header}\" /Fp\"${pch_binary}\" /FI\"${pch_header}\"" - OBJECT_DEPENDS "${pch_binary}") - - # Set compile options for precompiled header - if(NOT PCH_PCH_TARGET OR NOT TARGET ${PCH_PCH_TARGET}_pch) - set_source_files_properties(${pch_source} - PROPERTIES COMPILE_FLAGS "/Yc\"${pch_header}\" /Fp\"${pch_binary}\"" - OBJECT_OUTPUTS "${pch_binary}") - endif() - - # Compile precompiled header - if(PCH_PCH_TARGET) - # As own target for usage in multiple libraries - if(NOT TARGET ${PCH_PCH_TARGET}_pch) - add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source}) - set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140 - COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) - endif() - # From VS2012 onwards, precompiled headers have to be linked against (LNK2011). - target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch) - set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140 - COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) - else() - # As part of the target - target_sources(${target} PRIVATE ${pch_source}) - endif() -endfunction() - -# Adds an FX-compiled shader to a target -# Creates a custom command that FX-compiles the given shader and adds the -# generated header file to the given target. -# Arguments: -# target Target to add the FX-compiled shader to -# hlsl HLSL shader input file -# profile HLSL profile that specifies the shader model -# entrypoint Shader entry point -# On return: -# FXC_FILE is set to the name of the generated header file. -function(add_shader_dx target hlsl profile entrypoint) - get_filename_component(file ${hlsl} NAME_WE) - add_custom_command(OUTPUT ${file}.h - COMMAND ${FXC} /Fh ${file}.h - /E ${entrypoint} - /T ${profile} - /Vn ${file} - /Qstrip_reflect - ${hlsl} - DEPENDS ${hlsl} - COMMENT "FX compile ${hlsl}" - VERBATIM) - target_sources(${target} PRIVATE ${file}.h) - target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -endfunction() - -# Copies the main dlls to the root of the buildtree -# On return: -# files added to ${install_data}, mirror in build tree -function(copy_main_dlls_to_buildtree) - set(dir ${PROJECT_SOURCE_DIR}/../Win32BuildSetup/dependencies) - file(GLOB_RECURSE files ${dir}/*) - foreach(file ${files}) - copy_file_to_buildtree(${file} ${dir}) - endforeach() - - if(D3DCOMPILER_DLL) - get_filename_component(d3dcompiler_dir ${D3DCOMPILER_DLL} DIRECTORY) - copy_file_to_buildtree(${D3DCOMPILER_DLL} ${d3dcompiler_dir}) - endif() - - set(install_data ${install_data} PARENT_SCOPE) -endfunction() diff --git a/project/cmake/scripts/windows/pathsetup.cmake b/project/cmake/scripts/windows/pathsetup.cmake deleted file mode 100644 index 8550616..0000000 --- a/project/cmake/scripts/windows/pathsetup.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT prefix) - set(prefix ${CMAKE_INSTALL_PREFIX}) -else() - set(CMAKE_INSTALL_PREFIX ${prefix}) -endif() -if(NOT exec_prefix) - set(exec_prefix ${prefix}) -endif() -if(NOT libdir) - set(libdir ${prefix}/lib) -endif() -if(NOT bindir) - set(bindir ${prefix}/bin) -endif() -if(NOT includedir) - set(includedir ${prefix}/include) -endif() -if(NOT datarootdir) - set(datarootdir ${prefix}/share) -endif() -if(NOT datadir) - set(datadir ${datarootdir}) -endif() - -list(APPEND final_message "-- PATH config --") -list(APPEND final_message "Prefix: ${prefix}") -list(APPEND final_message "Libdir: ${libdir}") -list(APPEND final_message "Bindir: ${bindir}") -list(APPEND final_message "Includedir: ${includedir}") -list(APPEND final_message "Datarootdir: ${datarootdir}") -list(APPEND final_message "Datadir: ${datadir}") - -set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" - -DINSTALL_PATH=\"${datarootdir}/kodi\") 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 @@ xbmc/contrib/kissfft kissfft -lib/libUPnP upnp lib/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 @@ xbmc/games/controllers games/controllers +xbmc/games/controllers/dialogs games/controllers/dialogs xbmc/games/controllers/guicontrols games/controllers/guicontrols xbmc/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 @@ xbmc/network network -xbmc/network/dacp network/dacp xbmc/network/httprequesthandler network/httprequesthandler xbmc/network/httprequesthandler/python network/httprequesthandler/python -xbmc/network/upnp network/upnp xbmc/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 xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral xbmc/addons/binary/interfaces/api1/PVR api1AddonCallbacks_PVR xbmc/commons commons -xbmc/cdrip cdrip xbmc/dbwrappers dbwrappers xbmc/dialogs dialogs xbmc/epg epg xbmc/guilib guilib xbmc/input input xbmc/input/joysticks input/joysticks +xbmc/input/joysticks/dialogs input/joysticks/dialogs xbmc/input/joysticks/generic input/joysticks/generic xbmc/listproviders listproviders xbmc/media media diff --git a/project/cmake/treedata/darwin/subdirs.txt b/project/cmake/treedata/darwin/subdirs.txt deleted file mode 100644 index f0fc5c5..0000000 --- a/project/cmake/treedata/darwin/subdirs.txt +++ /dev/null @@ -1,12 +0,0 @@ -xbmc/linux linuxsupport -xbmc/network/linux network/linux -xbmc/network/osx network/osx -xbmc/peripherals/bus/osx peripherals/bus/osx -xbmc/powermanagement/osx powermanagement/osx -xbmc/storage/osx storage/osx -xbmc/platform/posix posix -xbmc/platform/darwin platform_darwin -xbmc/platform/darwin/osx platform_osx -xbmc/filesystem/posix filesystem/posix -xbmc/utils/posix utils_posix -xbmc/windowing/osx windowing/osx 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 @@ -xbmc/linux linuxsupport -xbmc/input/linux input/linux -xbmc/network/linux network/linux -xbmc/freebsd freebsdsupport +xbmc/linux linuxsupport +xbmc/linux/sse4 sse4 +xbmc/input/linux input/linux +xbmc/input/touch input/touch +xbmc/input/touch/generic input/touch/generic +xbmc/network/linux network/linux +xbmc/peripherals/bus/linux peripherals/bus/linux +xbmc/powermanagement/linux powermanagement/linux +xbmc/storage/linux storage/linux +xbmc/filesystem/posix filesystem/posix +xbmc/utils/posix utils_posix +xbmc/platform/posix posix +xbmc/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 xbmc/storage/linux storage/linux xbmc/filesystem/posix filesystem/posix xbmc/utils/posix utils_posix +xbmc/windowing/egl windowing/egl xbmc/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 @@ +lib/libUPnP upnp # UPNP +xbmc/network/upnp network/upnp # UPNP diff --git a/project/cmake/treedata/osx/subdirs.txt b/project/cmake/treedata/osx/subdirs.txt new file mode 100644 index 0000000..f0fc5c5 --- /dev/null +++ b/project/cmake/treedata/osx/subdirs.txt @@ -0,0 +1,12 @@ +xbmc/linux linuxsupport +xbmc/network/linux network/linux +xbmc/network/osx network/osx +xbmc/peripherals/bus/osx peripherals/bus/osx +xbmc/powermanagement/osx powermanagement/osx +xbmc/storage/osx storage/osx +xbmc/platform/posix posix +xbmc/platform/darwin platform_darwin +xbmc/platform/darwin/osx platform_osx +xbmc/filesystem/posix filesystem/posix +xbmc/utils/posix utils_posix +xbmc/windowing/osx windowing/osx 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 @@ -xbmc/win32 win32support +xbmc/platform/win32 platform_win32 xbmc/input/windows input/windows xbmc/input/touch input/touch xbmc/input/touch/generic input/touch/generic @@ -9,7 +9,6 @@ xbmc/powermanagement/windows powermanagement/windows xbmc/storage/windows storage/windows xbmc/filesystem/win32 filesystem/win32 xbmc/utils/win32 utils_win32 -xbmc/platform/win32 platform_win32 xbmc/rendering/dx rendering_dx xbmc/threads/platform/win threads_win xbmc/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 @@ -message(WARNING "find_package(xbmc) has been deprecated, please use find_package(kodi)") - -find_package(kodi REQUIRED) -set(XBMC_INCLUDE_DIR ${KODI_INCLUDE_DIR}) \ No newline at end of file -- cgit v1.2.3