From 1e5bdca69f7676b2dbcd64f0f44f31b12b337b7c Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 13 Dec 2016 13:45:04 +0100 Subject: sync with upstream --- project/cmake/CMakeLists.txt | 33 ++- .../depends/windows/cmake/mingw/CMakeLists.txt | 33 +++ .../windows/cmake/mingw/MinGWConfig.cmake.in | 3 + .../windows/cmake/mingw/Toolchain_mingw32.cmake.in | 17 ++ .../addons/depends/windows/cmake/mingw/mingw.txt | 1 + .../depends/windows/cmake/mingw/mingw32-cmd.bat.in | 6 + .../depends/windows/cmake/mingw/noinstall.txt | 0 .../depends/windows/cmake/msys/CMakeLists.txt | 5 + .../addons/depends/windows/cmake/msys/msys.txt | 1 + .../depends/windows/cmake/msys/noinstall.txt | 0 project/cmake/cpack/deb/copyright | 118 ---------- project/cmake/cpack/deb/packages/kodi.txt.in | 2 +- project/cmake/installdata/common/addons.txt | 3 +- project/cmake/modules/FindBluetooth.cmake | 6 +- project/cmake/modules/FindCAP.cmake | 44 ++++ project/cmake/modules/FindCpluff.cmake | 8 + project/cmake/modules/FindCrossGUID.cmake | 5 + project/cmake/modules/FindFFMPEG.cmake | 258 +++++++++++++++++---- project/cmake/modules/FindFribidi.cmake | 6 +- project/cmake/modules/FindMir.cmake | 33 +++ project/cmake/modules/FindTexturePacker.cmake | 22 +- project/cmake/modules/FindVAAPI.cmake | 15 +- project/cmake/modules/FindXSLT.cmake | 2 +- project/cmake/scripts/android/Install.cmake | 1 - project/cmake/scripts/common/ArchSetup.cmake | 5 + .../cmake/scripts/common/CheckTargetPlatform.cmake | 6 +- project/cmake/scripts/common/HandleDepends.cmake | 43 +++- project/cmake/scripts/common/Macros.cmake | 9 +- project/cmake/scripts/common/PrepareEnv.cmake | 47 +--- project/cmake/scripts/ios/ArchSetup.cmake | 21 ++ project/cmake/scripts/ios/Install.cmake | 93 ++++---- project/cmake/scripts/linux/ArchSetup.cmake | 4 + project/cmake/scripts/linux/Install.cmake | 18 +- project/cmake/scripts/osx/Macros.cmake | 9 +- project/cmake/scripts/windows/tools/patch.cmake | 37 +++ project/cmake/treedata/common/addons.txt | 3 +- project/cmake/treedata/common/cores.txt | 1 + project/cmake/treedata/common/games.txt | 8 + project/cmake/treedata/common/network.txt | 2 - project/cmake/treedata/common/subdirs.txt | 5 + project/cmake/treedata/optional/common/mir.txt | 1 + .../cmake/treedata/optional/common/webserver.txt | 2 + 42 files changed, 657 insertions(+), 279 deletions(-) create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/mingw.txt create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/msys.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/noinstall.txt create mode 100644 project/cmake/modules/FindCAP.cmake create mode 100644 project/cmake/modules/FindMir.cmake create mode 100644 project/cmake/scripts/windows/tools/patch.cmake create mode 100644 project/cmake/treedata/optional/common/mir.txt create mode 100644 project/cmake/treedata/optional/common/webserver.txt (limited to 'project/cmake') diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt index fa1156d..c70b18d 100644 --- a/project/cmake/CMakeLists.txt +++ b/project/cmake/CMakeLists.txt @@ -45,14 +45,14 @@ option(ENABLE_NONFREE "Enable non-free components?" ON) option(ENABLE_AIRTUNES "Enable AirTunes support?" ON) option(ENABLE_CEC "Enable CEC support?" ON) option(ENABLE_OPTICAL "Enable optical support?" ON) +# use ffmpeg from depends or system +option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" OFF) if(UNIX) - if(NOT APPLE) - option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" ON) - endif() option(FFMPEG_PATH "Path to external ffmpeg?" "") option(ENABLE_INTERNAL_CROSSGUID "Enable internal crossguid?" ON) option(ENABLE_OPENSSL "Enable OpenSSL?" ON) option(ENABLE_SDL "Enable SDL?" OFF) + option(ENABLE_MIR "Enable MIR?" OFF) 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) @@ -119,7 +119,7 @@ endif() # Optional dependencies set(optional_deps MicroHttpd MySqlClient SSH XSLT Alsa UDEV DBus Avahi SmbClient - PulseAudio VDPAU VAAPI) + PulseAudio VDPAU VAAPI Bluetooth CAP) # Required, dyloaded deps set(required_dyload Curl ASS) @@ -197,14 +197,24 @@ endif() if(NOT WIN32) core_optional_dep(OpenGl) if(OPENGL_FOUND) - core_optional_dep(X ENABLE_X11) - core_optional_dep(LibDRM ENABLE_X11) - core_optional_dep(XRandR ENABLE_X11) + if(ENABLE_MIR) + core_require_dep(Mir ENABLE_MIR) + core_optional_dep(LibDRM ENABLE_MIR) + else() + core_optional_dep(X ENABLE_X11) + core_optional_dep(XRandR ENABLE_X11) + core_optional_dep(LibDRM ENABLE_X11) + endif() else() core_optional_dep(OpenGLES) if(OPENGLES_FOUND) - core_optional_dep(X ENABLE_X11) - core_optional_dep(LibDRM ENABLE_X11) + if(ENABLE_MIR) + core_require_dep(Mir ENABLE_MIR) + core_optional_dep(LibDRM ENABLE_MIR) + else() + core_optional_dep(X ENABLE_X11) + core_optional_dep(LibDRM ENABLE_X11) + endif() endif() endif() if(NOT APPLE) @@ -337,9 +347,12 @@ unset(_MAIN_LIBRARIES) if(WIN32) set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC}) - target_sources(kodi PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) + target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) elseif(CORE_SYSTEM_NAME STREQUAL android) # Nothing +elseif(CORE_SYSTEM_NAME STREQUAL ios) + set_target_properties(${APP_NAME_LC} PROPERTIES OUTPUT_NAME ${APP_NAME} + MACOSX_BUNDLE_INFO_PLIST ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in) else() set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") endif() diff --git a/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt new file mode 100644 index 0000000..2c2c4b8 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(mingw) + +function(generate_mingw32_wrapper cmd) + set(CMD ${cmd}) + configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY) +endfunction() + +get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../../.. REALPATH) + +set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64") +set(MINGW_PATH "${MSYS_PATH}/mingw32") + +# configure the MinGW toolchain file +configure_file(${PROJECT_SOURCE_DIR}/Toolchain_mingw32.cmake.in ${CMAKE_INSTALL_PREFIX}/Toolchain_mingw32.cmake @ONLY) + +# configure MinGWConfig.cmake +configure_file(${PROJECT_SOURCE_DIR}/MinGWConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/MinGWConfig.cmake) + +# TODO: MinGW GCC 5.3.0-1 comes without cc.exe, Remove this once package is bumped to 5.3.0-p2 +# See https://github.com/Alexpux/MINGW-packages/pull/1034 +if(NOT EXISTS ${MINGW_PATH}/bin/cc.exe) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_PATH}/bin/gcc.exe ${MINGW_PATH}/bin/cc.exe) +endif() + +# configure the MinGW wrapper batch scripts +generate_mingw32_wrapper("make") +generate_mingw32_wrapper("gcc") +generate_mingw32_wrapper("cc") +generate_mingw32_wrapper("g++") +generate_mingw32_wrapper("ar") +generate_mingw32_wrapper("ld") +generate_mingw32_wrapper("windres") diff --git a/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in new file mode 100644 index 0000000..2d6baa7 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in @@ -0,0 +1,3 @@ +set(MINGW_INCLUDE_DIRS @MINGW_PATH@/include) +set(MINGW_MAKE @MINGW_PATH@/bin/make.bat -j$ENV{NUMBER_OF_PROCESSORS}) +set(MINGW_FOUND 1) diff --git a/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in new file mode 100644 index 0000000..01d281d --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in @@ -0,0 +1,17 @@ +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_NAME Windows) + +set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@ @CMAKE_INSTALL_PREFIX@ @MSYS_PATH@ @MINGW_PATH@) + +# specify the cross compiler +set(CMAKE_C_COMPILER @MINGW_PATH@/bin/gcc.bat) +set(CMAKE_CXX_COMPILER @MINGW_PATH@/bin/g++.bat) +set(CMAKE_AR @MINGW_PATH@/bin/ar.bat CACHE FILEPATH "Archiver") +set(CMAKE_LINKER @MINGW_PATH@/bin/ld.bat CACHE FILEPATH "Linker") +SET(CMAKE_RC_COMPILER @MINGW_PATH@/bin/windres.bat) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt new file mode 100644 index 0000000..90aa6ae --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt @@ -0,0 +1 @@ +mingw diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in new file mode 100644 index 0000000..44a0ea2 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in @@ -0,0 +1,6 @@ +@ECHO OFF +SETLOCAL + +SET PATH=@MINGW_PATH@/bin;@MSYS_PATH@/usr/bin;%PATH% +@CMD@.exe %* + diff --git a/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt b/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt new file mode 100644 index 0000000..e69de29 diff --git a/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt new file mode 100644 index 0000000..1c0536e --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.1) +project(msys LANGUAGES NONE) + +# This is an empty dummy dependency because a lot of game addons depend on it. +# After they got fixed, this can be removed. diff --git a/project/cmake/addons/depends/windows/cmake/msys/msys.txt b/project/cmake/addons/depends/windows/cmake/msys/msys.txt new file mode 100644 index 0000000..00de9c2 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/msys/msys.txt @@ -0,0 +1 @@ +msys diff --git a/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt b/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt new file mode 100644 index 0000000..e69de29 diff --git a/project/cmake/cpack/deb/copyright b/project/cmake/cpack/deb/copyright index 5616264..a79cf54 100644 --- a/project/cmake/cpack/deb/copyright +++ b/project/cmake/cpack/deb/copyright @@ -529,84 +529,6 @@ projectM - OpenGL based advanced music visualization program 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 @@ -809,28 +731,6 @@ GNU libmicrohttpd 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 @@ -2430,24 +2330,6 @@ libnfs - NFS client library 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 diff --git a/project/cmake/cpack/deb/packages/kodi.txt.in b/project/cmake/cpack/deb/packages/kodi.txt.in index 3a5cde1..4ca417b 100644 --- a/project/cmake/cpack/deb/packages/kodi.txt.in +++ b/project/cmake/cpack/deb/packages/kodi.txt.in @@ -15,7 +15,7 @@ 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_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, libass5 | libass4, libgif5 | libgif7, libssh-4 | libssh2-1, libnfs8 | libnfs4 | libnfs1, libbluray1, libshairplay0, libvorbisfile3, libaacs0, libcec4, 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 diff --git a/project/cmake/installdata/common/addons.txt b/project/cmake/installdata/common/addons.txt index 1cbe4d6..5613ba7 100644 --- a/project/cmake/installdata/common/addons.txt +++ b/project/cmake/installdata/common/addons.txt @@ -20,12 +20,11 @@ addons/xbmc.python/* addons/xbmc.webinterface/* addons/library.kodi.adsp/* addons/library.kodi.audioengine/* +addons/library.kodi.game/* addons/library.kodi.guilib/* -addons/library.kodi.inputstream/* addons/library.kodi.peripheral/* addons/library.xbmc.addon/* addons/library.xbmc.codec/* -addons/library.xbmc.pvr/* addons/repository.xbmc.org/* addons/webinterface.default/* addons/screensaver.xbmc.builtin.dim/* diff --git a/project/cmake/modules/FindBluetooth.cmake b/project/cmake/modules/FindBluetooth.cmake index 538e89c..a69980d 100644 --- a/project/cmake/modules/FindBluetooth.cmake +++ b/project/cmake/modules/FindBluetooth.cmake @@ -14,12 +14,12 @@ # Bluetooth::Bluetooth - The Bluetooth library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_BLUETOOTH bluetooth QUIET) + pkg_check_modules(PC_BLUETOOTH bluez bluetooth QUIET) endif() find_path(BLUETOOTH_INCLUDE_DIR NAMES bluetooth/bluetooth.h PATHS ${PC_BLUETOOTH_INCLUDEDIR}) -find_library(BLUETOOTH_LIBRARY NAMES bluetooth +find_library(BLUETOOTH_LIBRARY NAMES bluetooth libbluetooth PATHS ${PC_BLUETOOTH_LIBDIR}) set(BLUETOOTH_VERSION ${PC_BLUETOOTH_VERSION}) @@ -27,7 +27,7 @@ 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}) + VERSION_VAR BLUETOOTH_VERSION) if(BLUETOOTH_FOUND) set(BLUETOOTH_INCLUDE_DIRS ${BLUETOOTH_INCLUDE_DIR}) diff --git a/project/cmake/modules/FindCAP.cmake b/project/cmake/modules/FindCAP.cmake new file mode 100644 index 0000000..04e8378 --- /dev/null +++ b/project/cmake/modules/FindCAP.cmake @@ -0,0 +1,44 @@ +#.rst: +# FindCAP +# ----------- +# Finds the POSIX 1003.1e capabilities library +# +# This will define the following variables:: +# +# CAP_FOUND - system has LibCap +# CAP_INCLUDE_DIRS - the LibCap include directory +# CAP_LIBRARIES - the LibCap libraries +# +# and the following imported targets:: +# +# CAP::CAP - The LibCap library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_CAP libcap QUIET) +endif() + +find_path(CAP_INCLUDE_DIR NAMES sys/capability.h + PATHS ${PC_CAP_INCLUDEDIR}) +find_library(CAP_LIBRARY NAMES cap libcap + PATHS ${PC_CAP_LIBDIR}) + +set(CAP_VERSION ${PC_CAP_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CAP + REQUIRED_VARS CAP_LIBRARY CAP_INCLUDE_DIR + VERSION_VAR CAP_VERSION) + +if(CAP_FOUND) + set(CAP_LIBRARIES ${CAP_LIBRARY}) + set(CAP_INCLUDE_DIRS ${CAP_INCLUDE_DIR}) + + if(NOT TARGET CAP::CAP) + add_library(CAP::CAP UNKNOWN IMPORTED) + set_target_properties(CAP::CAP PROPERTIES + IMPORTED_LOCATION "${CAP_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${CAP_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(CAP_INCLUDE_DIR CAP_LIBRARY) diff --git a/project/cmake/modules/FindCpluff.cmake b/project/cmake/modules/FindCpluff.cmake index fb2bb25..ce6c127 100644 --- a/project/cmake/modules/FindCpluff.cmake +++ b/project/cmake/modules/FindCpluff.cmake @@ -10,6 +10,13 @@ if(NOT WIN32) string(REPLACE ";" " " defines "${CMAKE_C_FLAGS} ${SYSTEM_DEFINES} -I${EXPAT_INCLUDE_DIR}") get_filename_component(expat_dir ${EXPAT_LIBRARY} DIRECTORY) set(ldflags "-L${expat_dir}") + + # iOS: Without specifying -arch, configure tries to use /bin/cpp as C-preprocessor + # http://stackoverflow.com/questions/38836754/cant-cross-compile-c-library-for-arm-ios + if(CORE_SYSTEM_NAME STREQUAL ios) + set(cppflags "-arch ${CPU}") + endif() + ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff BUILD_IN_SOURCE 1 PREFIX ${CORE_BUILD_DIR}/cpluff @@ -22,6 +29,7 @@ if(NOT WIN32) --libdir=/lib --host=${ARCH} CFLAGS=${defines} + CPPFLAGS=${cppflags} LDFLAGS=${ldflags}) ExternalProject_Add_Step(libcpluff autoreconf DEPENDEES download update patch diff --git a/project/cmake/modules/FindCrossGUID.cmake b/project/cmake/modules/FindCrossGUID.cmake index bcae3d3..ba2823a 100644 --- a/project/cmake/modules/FindCrossGUID.cmake +++ b/project/cmake/modules/FindCrossGUID.cmake @@ -16,6 +16,10 @@ if(ENABLE_INTERNAL_CROSSGUID) message(STATUS "CROSSGUID_URL: ${CROSSGUID_URL}") endif() + if(APPLE) + set(EXTRA_ARGS "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}") + 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 @@ -24,6 +28,7 @@ if(ENABLE_INTERNAL_CROSSGUID) PREFIX ${CORE_BUILD_DIR}/crossguid CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + "${EXTRA_ARGS}" PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt && diff --git a/project/cmake/modules/FindFFMPEG.cmake b/project/cmake/modules/FindFFMPEG.cmake index a9f88fb..2b3f47b 100644 --- a/project/cmake/modules/FindFFMPEG.cmake +++ b/project/cmake/modules/FindFFMPEG.cmake @@ -1,18 +1,224 @@ -include(ExternalProject) -file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) -string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}") -list(GET FFMPEG_VER 0 FFMPEG_VER) -string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER) -string(REGEX MATCH "BASE_URL=([^ ]*)" FFMPEG_BASE_URL "${VER}") -list(GET FFMPEG_BASE_URL 0 FFMPEG_BASE_URL) -string(SUBSTRING "${FFMPEG_BASE_URL}" 9 -1 FFMPEG_BASE_URL) +# FindFFMPEG +# -------- +# Finds FFmpeg libraries +# +# This module will first look for the required library versions on the system. +# If they are not found, it will fall back to downloading and building kodi's own version +# +# -------- +# the following variables influence behaviour: +# ENABLE_INTERNAL_FFMPEG - if enabled, kodi's own version will always be built +# +# FFMPEG_PATH - use external ffmpeg not found in system paths +# usage: -DFFMPEG_PATH=/path/to/ffmpeg_install_prefix +# +# WITH_FFMPEG - use external ffmpeg not found in system paths +# WARNING: this option is for developers as it will _disable ffmpeg version checks_! +# Consider using FFMPEG_PATH instead, which _does_ check library versions +# usage: -DWITH_FFMPEG=/path/to/ffmpeg_install_prefix +# +# -------- +# This module will will define the following variables: +# +# FFMPEG_FOUND - system has FFmpeg +# FFMPEG_INCLUDE_DIRS - FFmpeg include directory +# FFMPEG_LIBRARIES - FFmpeg libraries +# FFMPEG_DEFINITIONS - pre-processor definitions +# FFMPEG_LDFLAGS - linker flags +# +# and the following imported targets:: +# +# ffmpeg - The FFmpeg libraries +# -------- +# +# required ffmpeg library versions +set(REQUIRED_FFMPEG_VERSION 3.1) +set(_avcodec_ver ">=57.48.101") +set(_avfilter_ver ">=6.47.100") +set(_avformat_ver ">=57.41.100") +set(_avutil_ver ">=55.28.100") +set(_swscale_ver ">=4.1.100") +set(_swresample_ver ">=2.1.100") +set(_postproc_ver ">=54.0.100") -if(ENABLE_INTERNAL_FFMPEG) + +# Allows building with external ffmpeg not found in system paths, +# without library version checks +if(WITH_FFMPEG) + set(FFMPEG_PATH ${WITH_FFMPEG}) + message(STATUS "Warning: FFmpeg version checking disabled") + set(REQUIRED_FFMPEG_VERSION undef) + unset(_avcodec_ver) + unset(_avfilter_ver) + unset(_avformat_ver) + unset(_avutil_ver) + unset(_swscale_ver) + unset(_swresample_ver) + unset(_postproc_ver) +endif() + +# Allows building with external ffmpeg not found in system paths, +# with library version checks +if(FFMPEG_PATH) + set(ENABLE_INTERNAL_FFMPEG OFF) +endif() + +# external FFMPEG +if(NOT ENABLE_INTERNAL_FFMPEG OR CMAKE_CROSSCOMPILING) if(FFMPEG_PATH) - message(WARNING "Internal FFmpeg enabled, but FFMPEG_PATH given, ignoring") + set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig") + list(APPEND CMAKE_PREFIX_PATH ${FFMPEG_PATH}) endif() + set(FFMPEG_PKGS libavcodec${_avcodec_ver} + libavfilter${_avfilter_ver} + libavformat${_avformat_ver} + libavutil${_avutil_ver} + libswscale${_swscale_ver} + libswresample${_swresample_ver} + libpostproc${_postproc_ver}) + + if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_FFMPEG ${FFMPEG_PKGS} QUIET) + string(REGEX REPLACE "framework;" "framework " PC_FFMPEG_LDFLAGS "${PC_FFMPEG_LDFLAGS}") + endif() + + find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h + libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h + PATH_SUFFIXES ffmpeg + PATHS ${PC_FFMPEG_INCLUDE_DIRS} + NO_DEFAULT_PATH) + find_path(FFMPEG_INCLUDE_DIRS libavcodec/avcodec.h libavfilter/avfilter.h libavformat/avformat.h + libavutil/avutil.h libswscale/swscale.h libpostproc/postprocess.h) + + find_library(FFMPEG_LIBAVCODEC + NAMES avcodec libavcodec + PATH_SUFFIXES ffmpeg/libavcodec + PATHS ${PC_FFMPEG_libavcodec_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBAVCODEC NAMES avcodec libavcodec PATH_SUFFIXES ffmpeg/libavcodec) + + find_library(FFMPEG_LIBAVFILTER + NAMES avfilter libavfilter + PATH_SUFFIXES ffmpeg/libavfilter + PATHS ${PC_FFMPEG_libavfilter_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBAVFILTER NAMES avfilter libavfilter PATH_SUFFIXES ffmpeg/libavfilter) + + find_library(FFMPEG_LIBAVFORMAT + NAMES avformat libavformat + PATH_SUFFIXES ffmpeg/libavformat + PATHS ${PC_FFMPEG_libavformat_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBAVFORMAT NAMES avformat libavformat PATH_SUFFIXES ffmpeg/libavformat) + + find_library(FFMPEG_LIBAVUTIL + NAMES avutil libavutil + PATH_SUFFIXES ffmpeg/libavutil + PATHS ${PC_FFMPEG_libavutil_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBAVUTIL NAMES avutil libavutil PATH_SUFFIXES ffmpeg/libavutil) + + find_library(FFMPEG_LIBSWSCALE + NAMES swscale libswscale + PATH_SUFFIXES ffmpeg/libswscale + PATHS ${PC_FFMPEG_libswscale_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBSWSCALE NAMES swscale libswscale PATH_SUFFIXES ffmpeg/libswscale) + + find_library(FFMPEG_LIBSWRESAMPLE + NAMES swresample libswresample + PATH_SUFFIXES ffmpeg/libswresample + PATHS ${PC_FFMPEG_libswresample_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBSWRESAMPLE NAMES NAMES swresample libswresample PATH_SUFFIXES ffmpeg/libswresample) + + find_library(FFMPEG_LIBPOSTPROC + NAMES postproc libpostproc + PATH_SUFFIXES ffmpeg/libpostproc + PATHS ${PC_FFMPEG_libpostproc_LIBDIR} + NO_DEFAULT_PATH) + find_library(FFMPEG_LIBPOSTPROC NAMES postproc libpostproc PATH_SUFFIXES ffmpeg/libpostproc) + + if((PC_FFMPEG_FOUND + AND PC_FFMPEG_libavcodec_VERSION + AND PC_FFMPEG_libavfilter_VERSION + AND PC_FFMPEG_libavformat_VERSION + AND PC_FFMPEG_libavutil_VERSION + AND PC_FFMPEG_libswscale_VERSION + AND PC_FFMPEG_libswresample_VERSION + AND PC_FFMPEG_libpostproc_VERSION) + OR WIN32) + set(FFMPEG_VERSION ${REQUIRED_FFMPEG_VERSION}) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(FFMPEG + VERSION_VAR FFMPEG_VERSION + REQUIRED_VARS FFMPEG_INCLUDE_DIRS + FFMPEG_LIBAVCODEC + FFMPEG_LIBAVFILTER + FFMPEG_LIBAVFORMAT + FFMPEG_LIBAVUTIL + FFMPEG_LIBSWSCALE + FFMPEG_LIBSWRESAMPLE + FFMPEG_LIBPOSTPROC + FFMPEG_VERSION + FAIL_MESSAGE "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, please consider using -DENABLE_INTERNAL_FFMPEG=ON") + + else() + message(STATUS "FFmpeg ${REQUIRED_FFMPEG_VERSION} not found, falling back to internal build") + unset(FFMPEG_INCLUDE_DIRS) + unset(FFMPEG_INCLUDE_DIRS CACHE) + unset(FFMPEG_LIBRARIES) + unset(FFMPEG_LIBRARIES CACHE) + unset(FFMPEG_DEFINITIONS) + unset(FFMPEG_DEFINITIONS CACHE) + endif() + + if(FFMPEG_FOUND) + set(FFMPEG_LDFLAGS ${PC_FFMPEG_LDFLAGS} CACHE STRING "ffmpeg linker flags") + + # check if ffmpeg libs are statically linked + set(FFMPEG_LIB_TYPE SHARED) + foreach(_fflib IN LISTS FFMPEG_LIBRARIES) + if(${_fflib} MATCHES ".+\.a$" AND PC_FFMPEG_STATIC_LDFLAGS) + set(FFMPEG_LDFLAGS ${PC_FFMPEG_STATIC_LDFLAGS} CACHE STRING "ffmpeg linker flags" FORCE) + set(FFMPEG_LIB_TYPE STATIC) + break() + endif() + endforeach() + + set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER} + ${FFMPEG_LIBAVFORMAT} ${FFMPEG_LIBAVUTIL} + ${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBSWRESAMPLE} + ${FFMPEG_LIBPOSTPROC} ${FFMPEG_LDFLAGS}) + list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VERSION}\") + + if(NOT TARGET ffmpeg) + add_library(ffmpeg ${FFMPEG_LIB_TYPE} IMPORTED) + set_target_properties(ffmpeg PROPERTIES + FOLDER "External Projects" + IMPORTED_LOCATION "${FFMPEG_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${FFMPEG_LDFLAGS}" + INTERFACE_COMPILE_DEFINITIONS "${FFMPEG_DEFINITIONS}") + endif() + endif() +endif() + +# Internal FFMPEG +if(NOT FFMPEG_FOUND) + include(ExternalProject) + file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) + string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}") + list(GET FFMPEG_VER 0 FFMPEG_VER) + string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER) + string(REGEX MATCH "BASE_URL=([^ ]*)" FFMPEG_BASE_URL "${VER}") + list(GET FFMPEG_BASE_URL 0 FFMPEG_BASE_URL) + string(SUBSTRING "${FFMPEG_BASE_URL}" 9 -1 FFMPEG_BASE_URL) + # allow user to override the download URL with a local tarball # needed for offline build envs if(FFMPEG_URL) @@ -80,35 +286,7 @@ fi") list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" -DUSE_STATIC_FFMPEG=1) set(FFMPEG_FOUND 1) -else() - if(FFMPEG_PATH) - set(ENV{PKG_CONFIG_PATH} "${FFMPEG_PATH}/lib/pkgconfig") - 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 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) - find_library(FFMPEG_LIBAVFILTER NAMES avfilter libavfilter PATH_SUFFIXES ffmpeg/libavfilter) - find_library(FFMPEG_LIBAVFORMAT NAMES avformat libavformat PATH_SUFFIXES ffmpeg/libavformat) - find_library(FFMPEG_LIBAVUTIL NAMES avutil libavutil PATH_SUFFIXES ffmpeg/libavutil) - find_library(FFMPEG_LIBSWSCALE NAMES swscale libswscale PATH_SUFFIXES ffmpeg/libswscale) - find_library(FFMPEG_LIBPOSTPROC NAMES postproc libpostproc PATH_SUFFIXES ffmpeg/libpostproc) - set(FFMPEG_LIBRARIES ${FFMPEG_LIBAVCODEC} ${FFMPEG_LIBAVFILTER} ${FFMPEG_LIBAVFORMAT} - ${FFMPEG_LIBAVUTIL} ${FFMPEG_LIBSWSCALE} ${FFMPEG_LIBPOSTPROC}) - add_custom_target(ffmpeg DEPENDS ${FFMPEG_LIBRARIES}) - endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(FFMPEG DEFAULT_MSG FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES) - set(FFMPEG_FOUND 1) - list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\") + set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects") endif() -set_target_properties(ffmpeg PROPERTIES FOLDER "External Projects") -mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS FFMPEG_FOUND) +mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_LDFLAGS FFMPEG_DEFINITIONS FFMPEG_FOUND) diff --git a/project/cmake/modules/FindFribidi.cmake b/project/cmake/modules/FindFribidi.cmake index 03c2f53..dcaeb48 100644 --- a/project/cmake/modules/FindFribidi.cmake +++ b/project/cmake/modules/FindFribidi.cmake @@ -32,12 +32,16 @@ find_package_handle_standard_args(FriBidi if(FRIBIDI_FOUND) set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY}) set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR}) + if(PC_FRIBIDI_CFLAGS) + set(FRIBIDI_DEFINITIONS ${PC_FRIBIDI_CFLAGS}) + endif() 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}") + INTERFACE_INCLUDE_DIRECTORIES "${FRIBIDI_INCLUDE_DIR}" + INTERFACE_COMPILE_OPTIONS "${FRIBIDI_DEFINITIONS}") endif() endif() diff --git a/project/cmake/modules/FindMir.cmake b/project/cmake/modules/FindMir.cmake new file mode 100644 index 0000000..8847a61 --- /dev/null +++ b/project/cmake/modules/FindMir.cmake @@ -0,0 +1,33 @@ +# FindMir +# ------- +# Finds the Mir library +# +# This will will define the following variables:: +# +# MIR_FOUND - the system has Mir +# MIR_INCLUDE_DIRS - the Mir include directory +# MIR_LIBRARIES - the Mir libraries +# MIR_DEFINITIONS - the Mir definitions + + +if(PKG_CONFIG_FOUND) + pkg_check_modules (PC_MIR mirclient QUIET) +endif() + +find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h + PATHS ${PC_MIR_INCLUDE_DIRS}) + +find_library(MIR_LIBRARY NAMES mirclient + PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) + +include (FindPackageHandleStandardArgs) +find_package_handle_standard_args (MIR + REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) + +if (MIR_FOUND) + set(MIR_LIBRARIES ${MIR_LIBRARY}) + set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) + set(MIR_DEFINITIONS -DHAVE_MIR=1) +endif() + +mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) diff --git a/project/cmake/modules/FindTexturePacker.cmake b/project/cmake/modules/FindTexturePacker.cmake index 2229ff7..f9e4c75 100644 --- a/project/cmake/modules/FindTexturePacker.cmake +++ b/project/cmake/modules/FindTexturePacker.cmake @@ -3,6 +3,10 @@ # ----------------- # Finds the TexturePacker # +# If WITH_TEXTUREPACKER is defined and points to a directory, +# this path will be used to search for the Texturepacker binary +# +# # This will define the following (imported) targets:: # # TexturePacker::TexturePacker - The TexturePacker executable @@ -17,7 +21,21 @@ if(NOT TARGET TexturePacker::TexturePacker) set_target_properties(TexturePacker::TexturePacker PROPERTIES IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") else() - add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) - add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) + if(WITH_TEXTUREPACKER) + get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE) + find_program(TEXTUREPACKER_EXECUTABLE TexturePacker PATHS ${_tppath}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(TexturePacker DEFAULT_MSG TEXTUREPACKER_EXECUTABLE) + if(TEXTUREPACKER_FOUND) + add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) + set_target_properties(TexturePacker::TexturePacker PROPERTIES + IMPORTED_LOCATION "${TEXTUREPACKER_EXECUTABLE}") + endif() + mark_as_advanced(TEXTUREPACKER) + else() + add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) + add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) + endif() endif() endif() diff --git a/project/cmake/modules/FindVAAPI.cmake b/project/cmake/modules/FindVAAPI.cmake index ce3fe1a..ea9a3c9 100644 --- a/project/cmake/modules/FindVAAPI.cmake +++ b/project/cmake/modules/FindVAAPI.cmake @@ -24,6 +24,8 @@ find_library(VAAPI_libva_LIBRARY NAMES va PATHS ${PC_VAAPI_libva_LIBDIR}) find_library(VAAPI_libva-x11_LIBRARY NAMES va-x11 PATHS ${PC_VAAPI_libva_LIBDIR}) +find_library(VAAPI_libva-drm_LIBRARY NAMES va-drm + PATHS ${PC_VAAPI_libva_LIBDIR}) if(PC_VAAPI_libva_VERSION) set(VAAPI_VERSION_STRING ${PC_VAAPI_libva_VERSION}) @@ -39,12 +41,12 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VAAPI - REQUIRED_VARS VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_INCLUDE_DIR + REQUIRED_VARS VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY VAAPI_INCLUDE_DIR VERSION_VAR VAAPI_VERSION_STRING) if(VAAPI_FOUND) set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) - set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY}) + set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY} ${VAAPI_libva-drm_LIBRARY}) set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) if(NOT TARGET VAAPI::VAAPI_X11) @@ -52,14 +54,19 @@ if(VAAPI_FOUND) set_target_properties(VAAPI::VAAPI_X11 PROPERTIES IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}") endif() + if (NOT TARGET VAAPI::VAAPI_DRM) + add_library(VAAPI::VAAPI_DRM UNKNOWN IMPORTED) + set_target_properties(VAAPI::VAAPI_DRM PROPERTIES + IMPORTED_LOCATION "${VAAPI_libva-drm_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) + INTERFACE_LINK_LIBRARIES "VAAPI::VAAPI_X11 VAAPI::VAAPI_DRM") endif() endif() -mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY) +mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY VAAPI_libva-drm_LIBRARY) diff --git a/project/cmake/modules/FindXSLT.cmake b/project/cmake/modules/FindXSLT.cmake index 9be51d3..f7fea9e 100644 --- a/project/cmake/modules/FindXSLT.cmake +++ b/project/cmake/modules/FindXSLT.cmake @@ -43,7 +43,7 @@ if(XSLT_FOUND) IMPORTED_LOCATION "${XSLT_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${XSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}" INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXSLT=1 - ITERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}") + INTERFACE_LINK_LIBRARIES "${LIBXML2_LIBRARIES}") endif() endif() diff --git a/project/cmake/scripts/android/Install.cmake b/project/cmake/scripts/android/Install.cmake index 5c66f41..025f194 100644 --- a/project/cmake/scripts/android/Install.cmake +++ b/project/cmake/scripts/android/Install.cmake @@ -91,7 +91,6 @@ foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay) 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) diff --git a/project/cmake/scripts/common/ArchSetup.cmake b/project/cmake/scripts/common/ArchSetup.cmake index 438e3bd..538fcaf 100644 --- a/project/cmake/scripts/common/ArchSetup.cmake +++ b/project/cmake/scripts/common/ArchSetup.cmake @@ -14,6 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckSymbolExists) include(CheckFunctionExists) +include(CheckIncludeFile) # Macro to check if a given type exists in a given header # Arguments: @@ -109,6 +110,10 @@ 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) +check_include_file(sys/inotify.h HAVE_INOTIFY) +if(HAVE_INOTIFY) + list(APPEND SYSTEM_DEFINES -DHAVE_INOTIFY=1) +endif() if(HAVE_POSIX_FADVISE) list(APPEND SYSTEM_DEFINES -DHAVE_POSIX_FADVISE=1) endif() diff --git a/project/cmake/scripts/common/CheckTargetPlatform.cmake b/project/cmake/scripts/common/CheckTargetPlatform.cmake index 5b5d9a1..82ee668 100644 --- a/project/cmake/scripts/common/CheckTargetPlatform.cmake +++ b/project/cmake/scripts/common/CheckTargetPlatform.cmake @@ -9,7 +9,11 @@ function(check_target_platform dir target_platform build) if(EXISTS ${dir} AND EXISTS ${dir}/platforms.txt) # get all the specified platforms file(STRINGS ${dir}/platforms.txt platforms) - string(REPLACE " " ";" platforms ${platforms}) + + list( LENGTH platforms listlen ) + if(${listlen} EQUAL 1) + string(REPLACE " " ";" platforms ${platforms}) + endif() # check if the addon/dependency should be built for the current platform foreach(platform ${platforms}) diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake index 880ccdf..adc105b 100644 --- a/project/cmake/scripts/common/HandleDepends.cmake +++ b/project/cmake/scripts/common/HandleDepends.cmake @@ -17,6 +17,7 @@ function(add_addon_depends addon searchpath) file MATCHES noinstall.txt OR file MATCHES flags.txt OR file MATCHES deps.txt OR + file MATCHES "[a-z]+-deps[.]txt" OR file MATCHES platforms.txt)) message(STATUS "Processing ${file}") file(STRINGS ${file} def) @@ -49,7 +50,11 @@ function(add_addon_depends addon searchpath) if(EXISTS ${dir}/flags.txt) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) file(STRINGS ${dir}/flags.txt extraflags) + + # replace some custom placeholders + string(REPLACE "@MINGW_TOOLCHAIN_FILE@" "${OUTPUT_DIR}/Toolchain_mingw32.cmake" extraflags "${extraflags}") string(REPLACE " " ";" extraflags ${extraflags}) + message(STATUS "${id} extraflags: ${extraflags}") endif() @@ -103,11 +108,18 @@ function(add_addon_depends addon searchpath) 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}) + + # On Windows "patch.exe" can only handle CR-LF line-endings. + # Our patches have LF-only line endings - except when they + # have been checked out as part of a dependency hosted on Git + # and core.autocrlf=true. if(WIN32) - set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") + file(READ ${patch} patch_content_hex HEX) + # Force handle LF-only line endings + if(NOT patch_content_hex MATCHES "0d0a") + set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") + endif() endif() endif() @@ -131,8 +143,11 @@ function(add_addon_depends addon searchpath) set(INSTALL_COMMAND INSTALL_COMMAND "") endif() - # check if there's a deps.txt containing dependencies on other libraries - if(EXISTS ${dir}/deps.txt) + # check if there's a platform-specific or generic deps.txt containing dependencies on other libraries + if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) + file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) + message(STATUS "${id} depends: ${deps}") + elseif(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}") @@ -161,6 +176,10 @@ function(add_addon_depends addon searchpath) PATCH_COMMAND ${PATCH_COMMAND} "${INSTALL_COMMAND}") + if(CMAKE_VERSION VERSION_GREATER 3.5.9) + list(APPEND EXTERNALPROJECT_SETUP GIT_SHALLOW 1) + endif() + # 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 @@ -172,6 +191,20 @@ function(add_addon_depends addon searchpath) GIT_REPOSITORY ${url} GIT_TAG ${revision} "${EXTERNALPROJECT_SETUP}") + + # For patchfiles to work, disable (users globally set) autocrlf=true + if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER 3.7) + message(AUTHOR_WARNING "Make use of GIT_CONFIG") + endif() + if(WIN32 AND patches) + externalproject_add_step(${id} gitconfig + COMMAND git config core.autocrlf false + COMMAND git rm -rf --cached . + COMMAND git reset --hard HEAD + COMMENT "Performing gitconfig step: Disabling autocrlf to enable patching for '${id}'" + DEPENDERS patch + WORKING_DIRECTORY ) + endif() else() set(CONFIGURE_COMMAND "") if(NOT WIN32) diff --git a/project/cmake/scripts/common/Macros.cmake b/project/cmake/scripts/common/Macros.cmake index 71c39ef..cce3245 100644 --- a/project/cmake/scripts/common/Macros.cmake +++ b/project/cmake/scripts/common/Macros.cmake @@ -155,9 +155,12 @@ function(core_add_shared_library name) 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 "") + foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}) + endforeach() 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}) @@ -595,9 +598,9 @@ macro(core_find_versions) set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) if(APP_VERSION_TAG) set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) + string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) 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 (.*)$") diff --git a/project/cmake/scripts/common/PrepareEnv.cmake b/project/cmake/scripts/common/PrepareEnv.cmake index 8e02382..51be739 100644 --- a/project/cmake/scripts/common/PrepareEnv.cmake +++ b/project/cmake/scripts/common/PrepareEnv.cmake @@ -51,43 +51,14 @@ foreach(binding ${bindings}) 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}) +### processing additional tools required by the platform +if(EXISTS ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) + file(GLOB platform_tools ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/*.cmake) + foreach(platform_tool ${platform_tools}) + get_filename_component(platform_tool_name ${platform_tool} NAME_WE) + message(STATUS "Processing ${CORE_SYSTEM_NAME} specific tool: ${platform_tool_name}") - # 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() + # include the file + include(${platform_tool}) + endforeach() endif() diff --git a/project/cmake/scripts/ios/ArchSetup.cmake b/project/cmake/scripts/ios/ArchSetup.cmake index 56661e2..f3e8590 100644 --- a/project/cmake/scripts/ios/ArchSetup.cmake +++ b/project/cmake/scripts/ios/ArchSetup.cmake @@ -13,6 +13,7 @@ if(WITH_ARCH) set(ARCH ${WITH_ARCH}) else() if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) + set(CMAKE_OSX_ARCHITECTURES ${CPU}) set(ARCH arm-osx) set(NEON False) else() @@ -34,3 +35,23 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) + +set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "5.1") +set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") + +set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) +set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF) +set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF) + +# Xcode strips dead code by default which breaks wrapping +set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF) + +# Unify output directories for iOS packaging scripts +if(NOT CMAKE_GENERATOR MATCHES Xcode) + set(CORE_BUILD_CONFIG "${CORE_BUILD_CONFIG}-iphoneos") +endif() +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) +foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) +endforeach() diff --git a/project/cmake/scripts/ios/Install.cmake b/project/cmake/scripts/ios/Install.cmake index 052565f..c49fcd5 100644 --- a/project/cmake/scripts/ios/Install.cmake +++ b/project/cmake/scripts/ios/Install.cmake @@ -1,42 +1,54 @@ # IOS packaging -set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}-iphoneos) +set(BUNDLE_RESOURCES ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png + ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png + ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png + ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png + ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) -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) +if(CMAKE_GENERATOR STREQUAL Xcode) + set(RESOURCE_LOCATION ${APP_NAME}.app) +else() + set(RESOURCE_LOCATION ".") +endif() -foreach(resource IN LISTS BUNDLE_RESOURCES) - configure_file(${CORE_SOURCE_DIR}/${resource} ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app COPYONLY) +target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES}) +foreach(file IN LISTS BUNDLE_RESOURCES) + set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION ${RESOURCE_LOCATION}) 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) +target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) +set_source_files_properties(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj") + +# Options for code signing propagated as env vars to Codesign.command via Xcode +set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity") +if(IOS_CODE_SIGN_IDENTITY) + set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED TRUE + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${IOS_CODE_SIGN_IDENTITY}) +endif() + +add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD + # TODO: Remove in sync with CopyRootFiles-ios expecting the ".bin" file + COMMAND ${CMAKE_COMMAND} -E copy $ + $/${APP_NAME}.bin -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_BUILD_DIR=$/.." "TARGET_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" "PRODUCT_NAME=${APP_NAME}" @@ -44,15 +56,22 @@ add_custom_target(bundle "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_BUILD_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}) + ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command + COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.." + "PLATFORM_NAME=${PLATFORM}" + "CODESIGNING_FOLDER_PATH=$" + "BUILT_PRODUCTS_DIR=$/.." + "WRAPPER_NAME=${APP_NAME}.app" + "APP_NAME=${APP_NAME}" + ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command +) set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in @@ -61,14 +80,6 @@ configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh. ${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) +add_dependencies(deb ${APP_NAME_LC}) diff --git a/project/cmake/scripts/linux/ArchSetup.cmake b/project/cmake/scripts/linux/ArchSetup.cmake index cae0bb8..bcd70df 100644 --- a/project/cmake/scripts/linux/ArchSetup.cmake +++ b/project/cmake/scripts/linux/ArchSetup.cmake @@ -39,3 +39,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Coverage) set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) endif() + +if(ENABLE_MIR) + set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU since no Mir support" FORCE) +endif() diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake index 5458707..43e2e5e 100644 --- a/project/cmake/scripts/linux/Install.cmake +++ b/project/cmake/scripts/linux/Install.cmake @@ -137,9 +137,11 @@ install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt COMPONENT kodi) # Install kodi-tools-texturepacker -install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker - DESTINATION ${bindir} - COMPONENT kodi-tools-texturepacker) +if(NOT WITH_TEXTUREPACKER) + install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker + DESTINATION ${bindir} + COMPONENT kodi-tools-texturepacker) +endif() # Install kodi-addon-dev headers install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h @@ -152,12 +154,14 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod ${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/libKODI_game.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 + ${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-addon-dev) @@ -310,6 +314,14 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-peripheral-dev) +# Install kodi-game-dev +install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h + ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h + DESTINATION ${includedir}/${APP_NAME_LC} + COMPONENT kodi-game-dev) + + # Install XBT skin files foreach(texture ${XBT_FILES}) string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) diff --git a/project/cmake/scripts/osx/Macros.cmake b/project/cmake/scripts/osx/Macros.cmake index 0d04439..52f87d1 100644 --- a/project/cmake/scripts/osx/Macros.cmake +++ b/project/cmake/scripts/osx/Macros.cmake @@ -2,7 +2,7 @@ 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) + set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) else() message(FATAL_ERROR "Unsupported generator in core_link_library") endif() @@ -17,6 +17,13 @@ function(core_link_library lib wraplib) set(link_lib $) set(check_arg ${ARGV2}) set(data_arg ${ARGV3}) + + # iOS: EFFECTIVE_PLATFORM_NAME is not resolved + # http://public.kitware.com/pipermail/cmake/2016-March/063049.html + if(CORE_SYSTEM_NAME STREQUAL ios AND CMAKE_GENERATOR STREQUAL Xcode) + get_target_property(dir ${lib} BINARY_DIR) + set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) + endif() else() set(target ${ARGV2}) set(link_lib ${lib}) diff --git a/project/cmake/scripts/windows/tools/patch.cmake b/project/cmake/scripts/windows/tools/patch.cmake new file mode 100644 index 0000000..0ef2952 --- /dev/null +++ b/project/cmake/scripts/windows/tools/patch.cmake @@ -0,0 +1,37 @@ +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-1") + 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_PATH}") + 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() diff --git a/project/cmake/treedata/common/addons.txt b/project/cmake/treedata/common/addons.txt index 76410b7..f29e086 100644 --- a/project/cmake/treedata/common/addons.txt +++ b/project/cmake/treedata/common/addons.txt @@ -1,8 +1,7 @@ lib/addons/library.kodi.adsp KODI_adsp lib/addons/library.kodi.audioengine KODI_audioengine +lib/addons/library.kodi.game KODI_game lib/addons/library.kodi.guilib KODI_guilib -lib/addons/library.kodi.inputstream KODI_inputstream lib/addons/library.kodi.peripheral KODI_peripheral lib/addons/library.xbmc.addon XBMC_addon lib/addons/library.xbmc.codec XBMC_codec -lib/addons/library.xbmc.pvr XBMC_pvr diff --git a/project/cmake/treedata/common/cores.txt b/project/cmake/treedata/common/cores.txt index d23939d..8d79dd1 100644 --- a/project/cmake/treedata/common/cores.txt +++ b/project/cmake/treedata/common/cores.txt @@ -6,3 +6,4 @@ xbmc/cores/DllLoader/exports/util cores/dll-loader/exports/util xbmc/cores/ExternalPlayer cores/externalplayer xbmc/cores/paplayer cores/paplayer xbmc/cores/playercorefactory cores/playercorefactory +xbmc/cores/RetroPlayer cores/RetroPlayer diff --git a/project/cmake/treedata/common/games.txt b/project/cmake/treedata/common/games.txt index b622f5a..03d42bc 100644 --- a/project/cmake/treedata/common/games.txt +++ b/project/cmake/treedata/common/games.txt @@ -1,4 +1,12 @@ +xbmc/games games +xbmc/games/addons games/addons +xbmc/games/addons/playback games/addons/playback +xbmc/games/addons/savestates games/addons/savestates 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 +xbmc/games/dialogs games/dialogs +xbmc/games/ports games/ports +xbmc/games/tags games/tags +xbmc/games/windows games/windows diff --git a/project/cmake/treedata/common/network.txt b/project/cmake/treedata/common/network.txt index 6331b2d..46da314 100644 --- a/project/cmake/treedata/common/network.txt +++ b/project/cmake/treedata/common/network.txt @@ -1,4 +1,2 @@ xbmc/network network -xbmc/network/httprequesthandler network/httprequesthandler -xbmc/network/httprequesthandler/python network/httprequesthandler/python xbmc/network/websocket network/websocket diff --git a/project/cmake/treedata/common/subdirs.txt b/project/cmake/treedata/common/subdirs.txt index e2bca7e..af91611 100644 --- a/project/cmake/treedata/common/subdirs.txt +++ b/project/cmake/treedata/common/subdirs.txt @@ -5,6 +5,7 @@ xbmc/addons/binary/interfaces/api1/Addon api1AddonCallbacks_Addon xbmc/addons/binary/interfaces/api1/AudioDSP api1AddonCallbacks_AudioDSP xbmc/addons/binary/interfaces/api1/AudioEngine api1AddonCallbacks_AudioEngine xbmc/addons/binary/interfaces/api1/Codec api1AddonCallbacks_Codec +xbmc/addons/binary/interfaces/api1/Game api1AddonCallbacks_Game xbmc/addons/binary/interfaces/api1/GUI api1AddonCallbacks_GUI xbmc/addons/binary/interfaces/api1/InputStream api1AddonCallbacks_InputStream xbmc/addons/binary/interfaces/api1/Peripheral api1AddonCallbacks_Peripheral @@ -18,6 +19,10 @@ xbmc/input input xbmc/input/joysticks input/joysticks xbmc/input/joysticks/dialogs input/joysticks/dialogs xbmc/input/joysticks/generic input/joysticks/generic +xbmc/input/keyboard input/keyboard +xbmc/input/keyboard/generic input/keyboard/generic +xbmc/input/mouse input/mouse +xbmc/input/mouse/generic input/mouse/generic xbmc/listproviders listproviders xbmc/media media xbmc/messaging messaging diff --git a/project/cmake/treedata/optional/common/mir.txt b/project/cmake/treedata/optional/common/mir.txt new file mode 100644 index 0000000..d681e8b --- /dev/null +++ b/project/cmake/treedata/optional/common/mir.txt @@ -0,0 +1 @@ +xbmc/windowing/mir windowing/mir # MIR diff --git a/project/cmake/treedata/optional/common/webserver.txt b/project/cmake/treedata/optional/common/webserver.txt new file mode 100644 index 0000000..b492006 --- /dev/null +++ b/project/cmake/treedata/optional/common/webserver.txt @@ -0,0 +1,2 @@ +xbmc/network/httprequesthandler network/httprequesthandler # MICROHTTPD +xbmc/network/httprequesthandler/python network/httprequesthandler/python # MICROHTTPD -- cgit v1.2.3