From 483c0b88bfc1b798396c31a4dd2f5239399ce59e Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 15 Oct 2018 01:14:02 +0200 Subject: sync with upstream --- cmake/KodiConfig.cmake.in | 10 +++---- cmake/README.md | 20 ++++++++++++++ cmake/addons/README.md | 22 ++------------- cmake/addons/depends/README | 35 +++--------------------- cmake/installdata/common/addons.txt | 1 + cmake/modules/FindNFS.cmake | 19 +++++-------- cmake/scripts/android/Install.cmake | 1 + cmake/scripts/common/AddonHelpers.cmake | 30 ++++++++++++--------- cmake/scripts/common/PrepareEnv.cmake | 47 +++++++++++++++++++++++++++++++++ cmake/scripts/ios/ArchSetup.cmake | 9 ++++--- cmake/treedata/common/retroplayer.txt | 1 + 11 files changed, 107 insertions(+), 88 deletions(-) (limited to 'cmake') diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in index 2a572e7..560374d 100644 --- a/cmake/KodiConfig.cmake.in +++ b/cmake/KodiConfig.cmake.in @@ -25,12 +25,8 @@ 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() +set(CORE_SYSTEM_NAME @CORE_SYSTEM_NAME@) +set(PLATFORM @CORE_SYSTEM_NAME@) +set(PLATFORM_TAG @PLATFORM_TAG@) include(AddonHelpers) diff --git a/cmake/README.md b/cmake/README.md index 8637da6..2febe48 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -21,6 +21,26 @@ cmake ... -DENABLE_VAAPI=ON -DENABLE_VDPAU=OFF ... Unfortunately, Kodi's CMake gazillion options are not fully documented yet. For more information and an updated list of options, please check the main **[CMakeLists.txt](../CMakeLists.txt)**. +## Buildsystem variables +The buildsystem uses the following variables (which can be passed into it when executing cmake with the -D`=` format) to manipulate the build process (see READMEs in sub-directories for additional variables): +- `CMAKE_BUILD_TYPE` specifies the type of the build. This can be either *Debug* or *Release* (default is *Release*) +- `CMAKE_TOOLCHAIN_FILE` can be used to pass a toolchain file +- `ARCH_DEFINES` specifies the platform-specific C/C++ preprocessor defines (defaults to empty) + +## Building +To trigger the cmake-based buildsystem the following command must be executed with `` set to this directory (absolute or relative) allowing for in-source and out-of-source builds + +`cmake -G ` + +CMake supports multiple generators. See [here] (https://cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html) for a list. + +In case of additional options the call might look like this: + +cmake `` [-G ``] \ + -DCMAKE_BUILD_TYPE=Release \ + -DARCH_DEFINES="-DTARGET_LINUX" \ + -DCMAKE_INSTALL_PREFIX="`=` format) to manipulate the build process: +The buildsystem uses the following addon-related variables (which can be passed into it when executing cmake with the -D`=` format) to manipulate the build process: - `ADDONS_TO_BUILD` has two variations, which are tested in order: - a quoted, space delimited list of `s` that you want to build (default is *all*) - a regular expression that every `` is matched against (e.g. `ADDONS_TO_BUILD="pvr.*"`) to build all pvr add-ons - `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_TOOLCHAIN_FILE` can be used to pass a toolchain file into the add-on builds - `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 @@ -47,19 +44,4 @@ Buildsystem will print a warning if you use any of the below-listed variables. F ## 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) - -To trigger the cmake-based buildsystem the following command must be executed with `` set to this directory (absolute or relative) allowing for in-source and out-of-source builds - -`cmake -G ` - -CMake supports multiple generators. See [here] (https://cmake.org/cmake/help/v3.1/manual/cmake-generators.7.html) for a list. - -In case of additional options the call might look like this: - -cmake `` [-G ``] \ - -DCMAKE_BUILD_TYPE=Release \ - -DCORE_SOURCE_DIR="``" \ - -DARCH_DEFINES="-DTARGET_LINUX" \ - -DADDON_DEPENDS_PATH=`` \ - -DCMAKE_INSTALL_PREFIX="`` (in *include* and *lib* sub-directories) \ No newline at end of file diff --git a/cmake/addons/depends/README b/cmake/addons/depends/README index 584a167..6fcec8f 100644 --- a/cmake/addons/depends/README +++ b/cmake/addons/depends/README @@ -25,37 +25,8 @@ are: * flags.txt: additional build flags * deps.txt: whitespace separated list of dependencies of this dependency -The buildsystem uses the following variables (which can be passed into it when -executing cmake with the -D= option) to e.g. access -specific paths: - * CMAKE_BUILD_TYPE specifies the type of the build. This can be either "Debug" - or "Release" (default is "Release"). - * CMAKE_TOOLCHAIN_FILE can be used to pass a toolchain file into the add-on - builds. - * CORE_SYSTEM_NAME is the name of the platform (e.g. "linux" or "android") in - lower-case (defaults to lowercase(CMAKE_SYSTEM_NAME)). - * CORE_SOURCE_DIR 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 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). +The buildsystem uses the following depends-related variables (which can be passed +into it when executing cmake with the -D= option) to e.g. +access specific paths: * DEPENDS_TO_BUILD is a quoted, space delimited list of s that you want to build (default is "all"). - -To trigger the cmake-based buildsystem the following command must be executed -with being the path to this directory (absolute or relative, allowing for -in-source and out-of-source builds). - - cmake -G - -cmake supports multiple generators, see -http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_Generators for a list. - -In case of additional options the call might look like this - - cmake [-G ] \ - -DCMAKE_BUILD_TYPE=Release \ - -DCORE_SOURCE_DIR="" \ - -DARCH_DEFINES="-DTARGET_LINUX" \ - -DCMAKE_INSTALL_PREFIX="\@PLATFORM\@" "@PLATFORM_TAG@" addon_file "${addon_file}") + string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") if(${APP_NAME_UC}_BUILD_DIR) @@ -209,7 +211,6 @@ macro (build_addon target prefix libs) # 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) @@ -234,10 +235,10 @@ macro (build_addon target prefix libs) endif() set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_IGNORE_GROUPS 1) - list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) + list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) # Pack files together to create an archive install(DIRECTORY ${target} ${CMAKE_CURRENT_BINARY_DIR}/${target} DESTINATION ./ - COMPONENT ${target}-${${prefix}_VERSION} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG} REGEX ".+\\.xml\\.in(clude)?$" EXCLUDE) if(WIN32) if(NOT CPACK_PACKAGE_DIRECTORY) @@ -256,21 +257,24 @@ macro (build_addon target prefix libs) if(${prefix}_SOURCES) # install the generated DLL file install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) # for debug builds also install the PDB file install(FILES $ DESTINATION ${target} CONFIGURATIONS Debug RelWithDebInfo - COMPONENT ${target}-${${prefix}_VERSION}) + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_CUSTOM_BINARY) - install(FILES ${LIBRARY_LOCATION} DESTINATION ${target} RENAME ${LIBRARY_FILENAME}) + install(FILES ${LIBRARY_LOCATION} DESTINATION ${target} RENAME ${LIBRARY_FILENAME} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_CUSTOM_DATA) - install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) + install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_ADDITIONAL_BINARY) - install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target}) + install(FILES ${${prefix}_ADDITIONAL_BINARY} DESTINATION ${target} + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() else() # NOT WIN32 if(NOT CPACK_PACKAGE_DIRECTORY) @@ -278,11 +282,11 @@ macro (build_addon target prefix libs) endif() if(${prefix}_SOURCES) install(TARGETS ${target} DESTINATION ${target} - COMPONENT ${target}-${${prefix}_VERSION}) + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_CUSTOM_BINARY) install(FILES ${LIBRARY_LOCATION} DESTINATION ${target} RENAME ${LIBRARY_FILENAME} - COMPONENT ${target}-${${prefix}_VERSION}) + COMPONENT ${target}-${${prefix}_VERSION}-${PLATFORM_TAG}) endif() if(${prefix}_CUSTOM_DATA) install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake index 1426148..20dbaf6 100644 --- a/cmake/scripts/common/PrepareEnv.cmake +++ b/cmake/scripts/common/PrepareEnv.cmake @@ -32,6 +32,53 @@ if(NOT WIN32) endif() endif() +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() + +set(PLATFORM_TAG ${CORE_SYSTEM_NAME}) + +if(CORE_SYSTEM_NAME STREQUAL android) + if (CPU MATCHES "v7a") + set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) + elseif (CPU MATCHES "arm64") + set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) + elseif (CPU MATCHES "i686") + set(PLATFORM_TAG ${PLATFORM_TAG}-i686) + else() + message(FATAL_ERROR "Unsupported architecture") + endif() +elseif(CORE_SYSTEM_NAME STREQUAL ios) + if (CPU MATCHES armv7) + set(PLATFORM_TAG ${PLATFORM_TAG}-armv7) + elseif (CPU MATCHES arm64) + set(PLATFORM_TAG ${PLATFORM_TAG}-aarch64) + else() + message(FATAL_ERROR "Unsupported architecture") + endif() +elseif(CORE_SYSTEM_NAME STREQUAL osx) + set(PLATFORM_TAG ${PLATFORM_TAG}-${CPU}) +elseif(CORE_SYSTEM_NAME STREQUAL windows) + include(CheckSymbolExists) + check_symbol_exists(_X86_ "Windows.h" _X86_) + check_symbol_exists(_AMD64_ "Windows.h" _AMD64_) + + if(_X86_) + set(PLATFORM_TAG ${PLATFORM_TAG}-i686) + elseif(_AMD64_) + set(PLATFORM_TAG ${PLATFORM_TAG}-x86_64) + else() + message(FATAL_ERROR "Unsupported architecture") + endif() + + unset(_X86_) + unset(_AMD64_) +endif() + # generate the proper KodiConfig.cmake file configure_file(${CORE_SOURCE_DIR}/cmake/KodiConfig.cmake.in ${APP_LIB_DIR}/KodiConfig.cmake @ONLY) diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake index bec8a7c..6b053dc 100644 --- a/cmake/scripts/ios/ArchSetup.cmake +++ b/cmake/scripts/ios/ArchSetup.cmake @@ -12,9 +12,13 @@ set(CMAKE_SYSTEM_NAME Darwin) if(WITH_ARCH) set(ARCH ${WITH_ARCH}) else() - if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) + if(CPU STREQUAL armv7) set(CMAKE_OSX_ARCHITECTURES ${CPU}) - set(ARCH arm-osx) + set(ARCH arm) + set(NEON True) + elseif(CPU STREQUAL arm64) + set(CMAKE_OSX_ARCHITECTURES ${CPU}) + set(ARCH aarch64) set(NEON True) else() message(SEND_ERROR "Unknown CPU: ${CPU}") @@ -36,7 +40,6 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" "-framework CoreMedia" "-framework AVFoundation" "-framework VideoToolbox") -set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "9.0") diff --git a/cmake/treedata/common/retroplayer.txt b/cmake/treedata/common/retroplayer.txt index cf9c9c5..97fc849 100644 --- a/cmake/treedata/common/retroplayer.txt +++ b/cmake/treedata/common/retroplayer.txt @@ -4,6 +4,7 @@ xbmc/cores/RetroPlayer/buffers cores/RetroPlaye xbmc/cores/RetroPlayer/buffers/video cores/RetroPlayer/buffers/video xbmc/cores/RetroPlayer/guibridge cores/RetroPlayer/guibridge xbmc/cores/RetroPlayer/guicontrols cores/RetroPlayer/guicontrols +xbmc/cores/RetroPlayer/guiplayback cores/RetroPlayer/guiplayback xbmc/cores/RetroPlayer/guiwindows cores/RetroPlayer/guiwindows xbmc/cores/RetroPlayer/playback cores/RetroPlayer/playback xbmc/cores/RetroPlayer/process cores/RetroPlayer/process -- cgit v1.2.3