From 5823b05feb29a59510c32a9c28ca18b50b9b6399 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 1 May 2016 18:06:14 +0200 Subject: sync with upstream --- project/cmake/CMakeLists.txt | 38 +++++++-- project/cmake/README.md | 4 +- project/cmake/addons/CMakeLists.txt | 6 +- project/cmake/addons/README | 94 --------------------- project/cmake/addons/README.md | 61 ++++++++++++++ project/cmake/addons/bootstrap/bootstrap.cmake | 2 + project/cmake/installdata/addon-bindings.txt | 14 ++-- project/cmake/installdata/cmake-files.txt | 13 +++ project/cmake/installdata/common/addons.txt | 18 +++- project/cmake/modules/FindCpluff.cmake | 7 +- project/cmake/modules/FindCrossGUID.cmake | 6 +- project/cmake/modules/FindD3DX11Effects.cmake | 4 +- project/cmake/modules/FindFFMPEG.cmake | 5 +- project/cmake/modules/FindMySqlClient.cmake | 8 +- project/cmake/modules/FindPCRE.cmake | 4 - project/cmake/modules/FindTagLib.cmake | 4 +- project/cmake/modules/FindTinyXML.cmake | 6 +- .../scripts/common/generateversionedfiles.cmake | 2 - project/cmake/scripts/common/macros.cmake | 98 ++++++++++++---------- project/cmake/scripts/common/prepare-env.cmake | 2 +- project/cmake/scripts/common/projectmacros.cmake | 11 ++- project/cmake/scripts/darwin/pathsetup.cmake | 8 +- project/cmake/scripts/freebsd/archsetup.cmake | 2 +- project/cmake/scripts/freebsd/install.cmake | 4 +- project/cmake/scripts/linux/archsetup.cmake | 2 +- project/cmake/scripts/linux/install.cmake | 69 +++++++++++++-- project/cmake/scripts/linux/pathsetup.cmake | 8 +- project/cmake/scripts/rbpi/archsetup.cmake | 2 +- project/cmake/scripts/windows/archsetup.cmake | 24 ++---- .../cmake/scripts/windows/c-flag-overrides.cmake | 4 +- .../cmake/scripts/windows/cxx-flag-overrides.cmake | 4 +- project/cmake/scripts/windows/macros.cmake | 6 +- project/cmake/scripts/windows/pathsetup.cmake | 8 +- .../include/kodi/kodi_inputstream_dll.h | 6 ++ .../include/kodi/kodi_inputstream_types.h | 2 + .../include/kodi/libXBMC_addon.h | 15 ++++ .../kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | 4 +- .../include/kodi/xbmc_addon_dll.h | 1 - .../kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | 13 +++ .../include/kodi/xbmc_pvr_types.h | 10 ++- .../cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | 2 + xbmc/filesystem/IFileTypes.h | 13 +-- 42 files changed, 367 insertions(+), 247 deletions(-) delete mode 100644 project/cmake/addons/README create mode 100644 project/cmake/addons/README.md create mode 100644 project/cmake/installdata/cmake-files.txt diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt index ea0f622..de0ea20 100644 --- a/project/cmake/CMakeLists.txt +++ b/project/cmake/CMakeLists.txt @@ -57,6 +57,9 @@ 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) @@ -205,6 +208,8 @@ endif() # Compile Info add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp + ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml + ${CMAKE_BINARY_DIR}/addons/kodi.guilib/addon.xml COMMAND ${CMAKE_COMMAND} -DCORE_SOURCE_DIR=${CORE_SOURCE_DIR} -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} -DCORE_BUILD_DIR=${CORE_BUILD_DIR} @@ -218,6 +223,8 @@ add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp ${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in ${CORE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in) 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) target_compile_options(compileinfo PRIVATE "${SYSTEM_DEFINES}") @@ -245,6 +252,11 @@ 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 @@ -277,9 +289,10 @@ 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(KODI_guilib addons/library.kodi.guilib/libKODI_guilib) +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(XBMC_pvr addons/library.xbmc.pvr/libXBMC_pvr) +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) @@ -315,7 +328,7 @@ else() endif() # testing -copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/test-reference-data.txt 1) +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}) @@ -359,11 +372,22 @@ foreach(msg ${final_message}) endforeach() if(VERBOSE) - message(STATUS "\n#---- Internal Variables ----# ") + message(STATUS "\n#--------------- Internal Variables -------------#") message(STATUS "DEPLIBS: ${DEPLIBS}") - message(STATUS "SYSTEM_LDFLAGS: ${SYSTEM_LDFLAGS}") message(STATUS "core_DEPENDS: ${core_DEPENDS}") - message(STATUS "CMAKE_DL_LIBS: ${CMAKE_DL_LIBS}") + message(STATUS "#---------------------------------------------#") + message(STATUS "SYSTEM_LDFLAGS : ${SYSTEM_LDFLAGS}") + message(STATUS "CMAKE_DL_LIBS : ${CMAKE_DL_LIBS}") + message(STATUS "CMAKE_C_FLAGS : ${CMAKE_C_FLAGS}") + message(STATUS "CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}") + message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}") + message(STATUS "#---------------------------------------------#") + message(STATUS "bindir : ${bindir}") + message(STATUS "includedir : ${includedir}") + message(STATUS "libdir : ${libdir}") + message(STATUS "datarootdir: ${datarootdir}") + message(STATUS "#---------------------------------------------#") + message(STATUS "GIT_REV: ${APP_SCMID}") endif() -message(STATUS "#-----------------------#") +message(STATUS "#---------------------------------------------#") diff --git a/project/cmake/README.md b/project/cmake/README.md index c0f94d8..28af525 100644 --- a/project/cmake/README.md +++ b/project/cmake/README.md @@ -8,7 +8,7 @@ executable (but no packaging or dependency management yet) for the following platforms: - Linux (GNU Makefiles) -- Windows (NMake Makefiles, Visual Studio 12 (2013)) +- Windows (NMake Makefiles, Visual Studio 14 (2015)) - OSX (GNU Makefiles, Xcode) - Android (GNU Makefiles) @@ -107,7 +107,7 @@ kodi.exe ### Windows with Visual Studio project files ``` -cmake -G "Visual Studio 12" /project/cmake/ +cmake -G "Visual Studio 14" /project/cmake/ cmake --build . --config "Debug" # or: Build solution with Visual Studio set KODI_HOME="%CD%" && Debug\kodi.exe ``` diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index 8fc1a23..982d977 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt @@ -120,6 +120,7 @@ endif() if(NOT ADDONS_TO_BUILD) set(ADDONS_TO_BUILD "all") else() + string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") separate_arguments(ADDONS_TO_BUILD) endif() @@ -132,6 +133,7 @@ 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) message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") endif() @@ -196,12 +198,12 @@ if(NOT addons) file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) endif() + string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") # generate the bootstrap buildsystem execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} - -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} + -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR} WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) # execute the generated bootstrap buildsystem diff --git a/project/cmake/addons/README b/project/cmake/addons/README deleted file mode 100644 index a0f2c32..0000000 --- a/project/cmake/addons/README +++ /dev/null @@ -1,94 +0,0 @@ -KODI ADDONS -=========== -This directory contains the cmake-based buildsystem for addons. It looks into -the directory pointed to by the ADDONS_DEFINITION_DIR option (which defaults to -the "addons" sub-directory) and parses all *.txt files recursively. Each addon -must have its own .txt file in a separate sub-directory which must -follow one of the defined format: - - - -where - * must be identical to the addon's ID as defined in the addon's - addon.xml - * must be the URL of the git repository containing the addon - * must be a valid git tag/branch/commit in the addon's git - repository which will be used for the build. - * must be the URL to a .tar.gz tarball containing the addon - * must be a file:// based path to the directory containing the - addon - -Reserved filenames (for additional information on how to build an addon) -are: - * platforms.txt: List of platforms to build an addon for (or "all"). It is - also supported to specify negated platforms with a leading exclamation mark - (i), e.g. "!windows". - Available platforms are: linux, windows, osx, ios, android, rbpi, freebsd - -ATTENTION: If no addon definitions could be found the buildsystem assumes that - the bootstrapping of the addon definition repositories hasn't been - performed yet and automatically executes the addon bootstrapping - buildsystem located in the "bootstrap" sub-directory with the default - settings (i.e. all addons from all pre-defined addon definition - repositories are bootstrapped into the directory pointed to by the - ADDONS_DEFINITION_DIR option). - -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: - * 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 addons - * 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 addon repository location. - It must point to the locally available parent directory of the addon(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 addons 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 addons' dependencies. - * APP_ROOT 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 addons 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 addons 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 addon source tarballs - should be cached or not (defaults to ON). - -The buildsystem makes some assumptions about the environment which must be met -by whoever uses it: - * Any dependencies of the addons 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 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 \ - -DAPP_ROOT="" \ - -DARCH_DEFINES="-DTARGET_LINUX" \ - -DDEPENDS_PATH="" \ - -DCMAKE_INSTALL_PREFIX=".txt` file in a separate sub-directory that must follow one of the defined formats: + + - ` ` + - ` ` + - ` ` + +where +- `` must be identical to the add-on's ID as defined in the add-on's addon.xml +- `` must be the URL of the git repository containing the add-on +- `` must be a valid git tag/branch/commit in the add-on's git repository which will be used for the build +- `` must be the URL to a .tar.gz tarball containing the add-on +- `` must be a *file://* based path to the directory containing the add-on + +## Reserved filenames +- **platforms.txt** + +List of platforms to build an add-on for (or *all*). Negating platforms is supported using a leading exclamation mark, e.g. *!windows*. + +Available platforms are: linux, windows, osx, ios, android, rbpi and freebsd. + +#### Attention +If no add-on definitions could be found, the buildsystem assumes that the bootstrapping of the add-on definition repositories hasn't been performed yet and automatically executes the add-on bootstrapping buildsystem located in the *bootstrap* sub-directory with the default settings (i.e. *all* add-ons from all pre-defined add-on definition repositories are bootstrapped into the directory pointed to by the *ADDONS_DEFINITION_DIR* option). + +## 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: +- `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 +- `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) +- `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*) + +## 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 \ + -DAPP_ROOT="``" \ + -DARCH_DEFINES="-DTARGET_LINUX" \ + -DDEPENDS_PATH=`` \ + -DCMAKE_INSTALL_PREFIX="` ${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + message(STATUS "copy_file_to_buildtree - copying file: ${file} -> ${CMAKE_BINARY_DIR}/${outfile}") endif() - add_custom_command(TARGET export-files COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ExportFiles.cmake + "file(COPY \"${file}\" DESTINATION \"${CMAKE_BINARY_DIR}/${outdir}\")\n") endif() - if(NOT ARGN) + 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. +# 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 -# give another parameter to exclude from installation target +# Optional Arguments: +# NO_INSTALL: exclude files from installation target # Implicit arguments: # CORE_SOURCE_DIR - root of source tree # On return: -# files are added to ${install_data} and mirrored in build tree +# 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) - foreach(arg ${ARGN}) - list(APPEND pattern ${arg}) - endforeach() # 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}") @@ -107,8 +117,8 @@ function(copy_files_from_filelist_to_buildtree pattern) foreach(dir ${fstrings}) file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${dir}) foreach(file ${files}) - if(ARGN) - copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} ${CORE_SOURCE_DIR} 1) + 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() @@ -315,37 +325,37 @@ macro(today RESULT) endmacro() function(core_find_git_rev) - if(EXISTS ${CORE_SOURCE_DIR}/VERSION) - file(STRINGS ${CORE_SOURCE_DIR}/VERSION VERSION_FILE) - string(SUBSTRING "${VERSION_FILE}" 1 16 GIT_REV) - else() - find_package(Git) - if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- + 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}) - if (NOT status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --cached --ignore-submodules --quiet HEAD -- - RESULT_VARIABLE status_code + 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() - today(DATE) - execute_process(COMMAND ${GIT_EXECUTABLE} --no-pager log --abbrev=7 -n 1 - --pretty=format:"%h-dirty" HEAD - OUTPUT_VARIABLE LOG_UNFORMATTED - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - string(SUBSTRING ${LOG_UNFORMATTED} 1 7 HASH) - else() - execute_process(COMMAND ${GIT_EXECUTABLE} --no-pager log --abbrev=7 -n 1 - --pretty=format:"%h %cd" HEAD - OUTPUT_VARIABLE LOG_UNFORMATTED - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - string(SUBSTRING ${LOG_UNFORMATTED} 1 7 HASH) - string(SUBSTRING ${LOG_UNFORMATTED} 9 10 DATE) - string(REPLACE "-" "" DATE ${DATE}) - endif() - set(GIT_REV "${DATE}-${HASH}") + 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() diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake index b9a39e7..8e9bd1c 100644 --- a/project/cmake/scripts/common/prepare-env.cmake +++ b/project/cmake/scripts/common/prepare-env.cmake @@ -100,7 +100,7 @@ if(WIN32) 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_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}) diff --git a/project/cmake/scripts/common/projectmacros.cmake b/project/cmake/scripts/common/projectmacros.cmake index d0739c4..7ce4ee9 100644 --- a/project/cmake/scripts/common/projectmacros.cmake +++ b/project/cmake/scripts/common/projectmacros.cmake @@ -35,10 +35,13 @@ function(copy_skin_to_buildtree skin 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 - ${CMAKE_BINARY_DIR}) - + 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() diff --git a/project/cmake/scripts/darwin/pathsetup.cmake b/project/cmake/scripts/darwin/pathsetup.cmake index e31f66e..071dfd4 100644 --- a/project/cmake/scripts/darwin/pathsetup.cmake +++ b/project/cmake/scripts/darwin/pathsetup.cmake @@ -2,7 +2,7 @@ if(NOT prefix) set(prefix ${DEPENDS_PATH}) endif() if(NOT exec_prefix) - set(exec_prefix \${prefix}) + set(exec_prefix ${prefix}) endif() if(NOT libdir) set(libdir ${prefix}/lib) @@ -17,7 +17,7 @@ if(NOT datarootdir) set(datarootdir ${prefix}/share) endif() if(NOT datadir) - set(datadir \${datarootdir}) + set(datadir ${datarootdir}) endif() list(APPEND final_message "-- PATH config --") @@ -28,5 +28,5 @@ 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}/xbmc\" - -DINSTALL_PATH=\"${datarootdir}/xbmc\") +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 index edc77f1..b85121f 100644 --- a/project/cmake/scripts/freebsd/archsetup.cmake +++ b/project/cmake/scripts/freebsd/archsetup.cmake @@ -15,5 +15,5 @@ else() endif() endif() -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") +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 index 0c8939e..8247416 100644 --- a/project/cmake/scripts/freebsd/install.cmake +++ b/project/cmake/scripts/freebsd/install.cmake @@ -20,7 +20,9 @@ install(FILES ${CORE_SOURCE_DIR}/tools/Linux/xbmc-xsession.desktop RENAME XBMC.desktop DESTINATION share/xsessions) -install(FILES ${CORE_SOURCE_DIR}/LICENSE.GPL +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) diff --git a/project/cmake/scripts/linux/archsetup.cmake b/project/cmake/scripts/linux/archsetup.cmake index d0e149e..e193768 100644 --- a/project/cmake/scripts/linux/archsetup.cmake +++ b/project/cmake/scripts/linux/archsetup.cmake @@ -17,5 +17,5 @@ endif() find_package(CXX11 REQUIRED) -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") +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 index b887610..962a816 100644 --- a/project/cmake/scripts/linux/install.cmake +++ b/project/cmake/scripts/linux/install.cmake @@ -14,28 +14,63 @@ 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) + ${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) -install(FILES ${cmake-files} +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 + ${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}-xsession.desktop) -install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}-xsession.desktop + ${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}/LICENSE.GPL +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) @@ -83,10 +118,28 @@ foreach(subdir ${build_dirs}) endif() endforeach() -install(FILES ${CORE_SOURCE_DIR}/media/icon48x48.png +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}/media/icon256x256.png +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) diff --git a/project/cmake/scripts/linux/pathsetup.cmake b/project/cmake/scripts/linux/pathsetup.cmake index 940fb62..8550616 100644 --- a/project/cmake/scripts/linux/pathsetup.cmake +++ b/project/cmake/scripts/linux/pathsetup.cmake @@ -4,7 +4,7 @@ else() set(CMAKE_INSTALL_PREFIX ${prefix}) endif() if(NOT exec_prefix) - set(exec_prefix \${prefix}) + set(exec_prefix ${prefix}) endif() if(NOT libdir) set(libdir ${prefix}/lib) @@ -19,7 +19,7 @@ if(NOT datarootdir) set(datarootdir ${prefix}/share) endif() if(NOT datadir) - set(datadir \${datarootdir}) + set(datadir ${datarootdir}) endif() list(APPEND final_message "-- PATH config --") @@ -30,5 +30,5 @@ 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}/xbmc\" - -DINSTALL_PATH=\"${datarootdir}/xbmc\") +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 index 84f1dad..72a610f 100644 --- a/project/cmake/scripts/rbpi/archsetup.cmake +++ b/project/cmake/scripts/rbpi/archsetup.cmake @@ -25,7 +25,7 @@ endif() find_package(CXX11 REQUIRED) -set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") +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") diff --git a/project/cmake/scripts/windows/archsetup.cmake b/project/cmake/scripts/windows/archsetup.cmake index baa3624..a54ab65 100644 --- a/project/cmake/scripts/windows/archsetup.cmake +++ b/project/cmake/scripts/windows/archsetup.cmake @@ -15,9 +15,6 @@ 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(CONFIGURATION_LIBDIR lib/${CORE_BUILD_CONFIG}-vc120) -set(CONFIGURATION_LIBDIR_RELEASE lib/Release-vc120) -set(CONFIGURATION_LIBDIR_DEBUG lib/Debug-vc120) set(JPEG_NAMES ${JPEG_NAMES} jpeg-static) set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) @@ -32,13 +29,7 @@ set(SYSTEM_DEFINES -DNOMINMAX -D_USE_32BIT_TIME_T -DHAS_DX -D__STDC_CONSTANT_MAC -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_SECURE_SCL=0 -D_HAS_ITERATOR_DEBUGGING=0>) - -# Compile with /MT (to be compatible with the dependent libraries) -foreach(CompilerFlag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") -endforeach() + $<$:-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") @@ -53,16 +44,15 @@ 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 - ${PROJECT_SOURCE_DIR}/../BuildDependencies/${CONFIGURATION_LIBDIR}) + ${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 libc msvcrt libci msvcprt) -set(_nodefaultlibs_DEBUG libcpmt libc msvcrt libcmt msvcrtd msvcprtd) +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() @@ -71,9 +61,9 @@ foreach(_lib ${_nodefaultlibs_DEBUG}) endforeach() # DELAYLOAD option -set(_delayloadlibs libxslt.dll dnssd.dll dwmapi.dll ssh.dll sqlite3.dll - avcodec-56.dll avfilter-5.dll avformat-56.dll avutil-54.dll - postproc-53.dll swresample-1.dll swscale-3.dll d3dcompiler_47.dll) +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() diff --git a/project/cmake/scripts/windows/c-flag-overrides.cmake b/project/cmake/scripts/windows/c-flag-overrides.cmake index 63825a4..fd85f5c 100644 --- a/project/cmake/scripts/windows/c-flag-overrides.cmake +++ b/project/cmake/scripts/windows/c-flag-overrides.cmake @@ -1,5 +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_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") + 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) \ No newline at end of file +endif(MSVC) diff --git a/project/cmake/scripts/windows/cxx-flag-overrides.cmake b/project/cmake/scripts/windows/cxx-flag-overrides.cmake index 366def3..536b809 100644 --- a/project/cmake/scripts/windows/cxx-flag-overrides.cmake +++ b/project/cmake/scripts/windows/cxx-flag-overrides.cmake @@ -1,5 +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_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0") + 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) \ No newline at end of file +endif(MSVC) diff --git a/project/cmake/scripts/windows/macros.cmake b/project/cmake/scripts/windows/macros.cmake index 6aabf7d..2b61875 100644 --- a/project/cmake/scripts/windows/macros.cmake +++ b/project/cmake/scripts/windows/macros.cmake @@ -87,11 +87,13 @@ function(add_precompiled_header target pch_header pch_source) # 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_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) + 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_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR}) + 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}) diff --git a/project/cmake/scripts/windows/pathsetup.cmake b/project/cmake/scripts/windows/pathsetup.cmake index 940fb62..8550616 100644 --- a/project/cmake/scripts/windows/pathsetup.cmake +++ b/project/cmake/scripts/windows/pathsetup.cmake @@ -4,7 +4,7 @@ else() set(CMAKE_INSTALL_PREFIX ${prefix}) endif() if(NOT exec_prefix) - set(exec_prefix \${prefix}) + set(exec_prefix ${prefix}) endif() if(NOT libdir) set(libdir ${prefix}/lib) @@ -19,7 +19,7 @@ if(NOT datarootdir) set(datarootdir ${prefix}/share) endif() if(NOT datadir) - set(datadir \${datarootdir}) + set(datadir ${datarootdir}) endif() list(APPEND final_message "-- PATH config --") @@ -30,5 +30,5 @@ 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}/xbmc\" - -DINSTALL_PATH=\"${datarootdir}/xbmc\") +set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" + -DINSTALL_PATH=\"${datarootdir}/kodi\") diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h index 6ecf566..bb9a2d4 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h @@ -139,6 +139,11 @@ extern "C" */ void DemuxSetSpeed(int speed); + /*! + * Sets desired width / height + * @param width / hight + */ + void SetVideoResolution(int width, int height); /*! * Totel time in ms @@ -238,6 +243,7 @@ extern "C" pClient->DemuxRead = DemuxRead; pClient->DemuxSeekTime = DemuxSeekTime; pClient->DemuxSetSpeed = DemuxSetSpeed; + pClient->SetVideoResolution = SetVideoResolution; pClient->GetTotalTime = GetTotalTime; pClient->GetTime = GetTime; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h index 0560708..3a2e2da 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h @@ -69,6 +69,7 @@ extern "C" { } m_ListItemProperties[MAX_INFO_COUNT]; const char *m_libFolder; + const char *m_profileFolder; } INPUTSTREAM; /*! @@ -139,6 +140,7 @@ extern "C" { DemuxPacket* (__cdecl* DemuxRead)(void); bool (__cdecl* DemuxSeekTime)(int, bool, double*); void (__cdecl* DemuxSetSpeed)(int); + void (__cdecl* SetVideoResolution)(int, int); // IDisplayTime int (__cdecl* GetTotalTime)(void); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h index b32ad86..ddeb1db 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h @@ -179,6 +179,10 @@ namespace ADDON dlsym(m_libXBMC_addon, "XBMC_get_setting"); if (XBMC_get_setting == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + XBMC_translate_special = (char* (*)(void* HANDLE, void* CB, const char* source)) + dlsym(m_libXBMC_addon, "XBMC_translate_special"); + if (XBMC_translate_special == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + XBMC_queue_notification = (void (*)(void* HANDLE, void* CB, const queue_msg_t loglevel, const char *msg)) dlsym(m_libXBMC_addon, "XBMC_queue_notification"); if (XBMC_queue_notification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } @@ -333,6 +337,16 @@ namespace ADDON return XBMC_get_setting(m_Handle, m_Callbacks, settingName, settingValue); } + /*! + * @brief Translates a special protocol folder. + * @param source The file / folder to translate. + * @return The string translated to resolved path. Must be freed by calling FreeString() when done. + */ + char *TranslateSpecialProtocol(const char *source) + { + return XBMC_translate_special(m_Handle, m_Callbacks, source); + } + /*! * @brief Queue a notification in the GUI. * @param type The message type. @@ -671,6 +685,7 @@ namespace ADDON void (*XBMC_unregister_me)(void *HANDLE, void* CB); void (*XBMC_log)(void *HANDLE, void* CB, const addon_log_t loglevel, const char *msg); bool (*XBMC_get_setting)(void *HANDLE, void* CB, const char* settingName, void *settingValue); + char*(*XBMC_translate_special)(void *HANDLE, void* CB, const char* source); void (*XBMC_queue_notification)(void *HANDLE, void* CB, const queue_msg_t type, const char *msg); bool (*XBMC_wake_on_lan)(void *HANDLE, void* CB, const char* mac); char* (*XBMC_unknown_to_utf8)(void *HANDLE, void* CB, const char* str); diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h index 3e3d479..700f912 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h @@ -35,7 +35,9 @@ #endif #define DVD_TIME_BASE 1000000 -#define DVD_NOPTS_VALUE (-1LL<<52) // should be possible to represent in both double and __int64 + +//TODO original definition is in DVDClock.h +#define DVD_NOPTS_VALUE 0xFFF0000000000000 class CHelper_libXBMC_pvr { diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h index ff7194f..e3c8785 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h @@ -45,7 +45,6 @@ extern "C" { unsigned int __declspec(dllexport) ADDON_GetSettings(ADDON_StructSetting ***sSet); ADDON_STATUS __declspec(dllexport) ADDON_SetSetting(const char *settingName, const void *settingValue); void __declspec(dllexport) ADDON_FreeSettings(); - void __declspec(dllexport) ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data); #ifdef __cplusplus }; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h index 5cb6075..2cf558a 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h @@ -647,6 +647,14 @@ extern "C" */ PVR_ERROR SetEPGTimeFrame(int iDays); + /*! + * Notify the pvr addon for power management events + */ + void OnSystemSleep(); + void OnSystemWake(); + void OnPowerSavingActivated(); + void OnPowerSavingDeactivated(); + /*! * Called by XBMC to assign the function pointers of this add-on to pClient. * @param pClient The struct to assign the function pointers to. @@ -736,6 +744,11 @@ extern "C" pClient->IsRealTimeStream = IsRealTimeStream; pClient->SetEPGTimeFrame = SetEPGTimeFrame; + + pClient->OnSystemSleep = OnSystemSleep; + pClient->OnSystemWake = OnSystemWake; + pClient->OnPowerSavingActivated = OnPowerSavingActivated; + pClient->OnPowerSavingDeactivated = OnPowerSavingDeactivated; }; }; diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h index 8d73310..b50483d 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h @@ -32,6 +32,7 @@ #endif #include #include +#include #include "xbmc_addon_types.h" #include "xbmc_epg_types.h" @@ -77,10 +78,10 @@ struct DemuxPacket; #define PVR_STREAM_MAX_STREAMS 20 /* current PVR API version */ -#define XBMC_PVR_API_VERSION "5.1.0" +#define XBMC_PVR_API_VERSION "5.2.0" /* min. PVR API version */ -#define XBMC_PVR_MIN_API_VERSION "5.1.0" +#define XBMC_PVR_MIN_API_VERSION "5.2.0" #ifdef __cplusplus extern "C" { @@ -228,6 +229,7 @@ extern "C" { PVR_CONNECTION_STATE_ACCESS_DENIED = 4, /*!< @brief backend server is reachable, but denies client access (e.g. due to wrong credentials) */ PVR_CONNECTION_STATE_CONNECTED = 5, /*!< @brief connection to backend server is established */ PVR_CONNECTION_STATE_DISCONNECTED = 6, /*!< @brief no connection to backend server (e.g. due to network errors or client initiated disconnect)*/ + PVR_CONNECTION_STATE_CONNECTING = 7, /*!< @brief connecting to backend */ } PVR_CONNECTION_STATE; /*! @@ -601,6 +603,10 @@ extern "C" { bool (__cdecl* IsTimeshifting)(void); bool (__cdecl* IsRealTimeStream)(void); PVR_ERROR (__cdecl* SetEPGTimeFrame)(int); + void (__cdecl* OnSystemSleep)(void); + void (__cdecl* OnSystemWake)(void); + void (__cdecl* OnPowerSavingActivated)(void); + void (__cdecl* OnPowerSavingDeactivated)(void); } PVRClient; #ifdef __cplusplus diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h index dbee80a..4f47118 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h @@ -36,4 +36,6 @@ typedef struct DemuxPacket double pts; // pts in DVD_TIME_BASE double dts; // dts in DVD_TIME_BASE double duration; // duration in DVD_TIME_BASE if available + + int dispTime; } DemuxPacket; diff --git a/xbmc/filesystem/IFileTypes.h b/xbmc/filesystem/IFileTypes.h index d2d77eb..4c6dd98 100644 --- a/xbmc/filesystem/IFileTypes.h +++ b/xbmc/filesystem/IFileTypes.h @@ -60,15 +60,16 @@ struct SCacheStatus uint64_t forward; /**< number of bytes cached forward of current position */ unsigned maxrate; /**< maximum number of bytes per second cache is allowed to fill */ unsigned currate; /**< average read rate from source file since last position change */ - bool full; /**< is the cache full */ + float level; /**< cache level (0.0 - 1.0) */ }; typedef enum { - IOCTRL_NATIVE = 1, /**< SNativeIoControl structure, containing what should be passed to native ioctrl */ - IOCTRL_SEEK_POSSIBLE = 2, /**< return 0 if known not to work, 1 if it should work */ - IOCTRL_CACHE_STATUS = 3, /**< SCacheStatus structure */ - IOCTRL_CACHE_SETRATE = 4, /**< unsigned int with speed limit for caching in bytes per second */ - IOCTRL_SET_CACHE = 8, /**