From ffca21f2743a7b367fa212799c6e2fea6190dd5d Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 3 Mar 2015 16:53:59 +0100 Subject: initial commit for kodi master --- project/cmake/addons/CMakeLists.txt | 249 +++++++++++++++++++++ project/cmake/addons/README | 68 ++++++ .../addons/audioencoder.flac/audioencoder.flac.txt | 1 + .../addons/addons/audioencoder.flac/platforms.txt | 1 + .../addons/audioencoder.lame/audioencoder.lame.txt | 1 + .../addons/addons/audioencoder.lame/platforms.txt | 1 + .../audioencoder.vorbis/audioencoder.vorbis.txt | 1 + .../addons/audioencoder.vorbis/platforms.txt | 1 + .../addons/audioencoder.wav/audioencoder.wav.txt | 1 + .../addons/addons/audioencoder.wav/platforms.txt | 1 + .../cmake/addons/addons/pvr.argustv/platforms.txt | 1 + .../addons/addons/pvr.argustv/pvr.argustv.txt | 1 + project/cmake/addons/addons/pvr.demo/platforms.txt | 1 + project/cmake/addons/addons/pvr.demo/pvr.demo.txt | 1 + .../cmake/addons/addons/pvr.dvblink/platforms.txt | 1 + .../addons/addons/pvr.dvblink/pvr.dvblink.txt | 1 + .../addons/addons/pvr.dvbviewer/platforms.txt | 1 + .../addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt | 1 + project/cmake/addons/addons/pvr.hts/platforms.txt | 1 + project/cmake/addons/addons/pvr.hts/pvr.hts.txt | 1 + .../addons/addons/pvr.iptvsimple/platforms.txt | 1 + .../addons/pvr.iptvsimple/pvr.iptvsimple.txt | 1 + .../addons/pvr.mediaportal.tvserver/platforms.txt | 1 + .../pvr.mediaportal.tvserver.txt | 1 + .../cmake/addons/addons/pvr.mythtv/platforms.txt | 1 + .../cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt | 1 + .../cmake/addons/addons/pvr.nextpvr/platforms.txt | 1 + .../addons/addons/pvr.nextpvr/pvr.nextpvr.txt | 1 + project/cmake/addons/addons/pvr.njoy/platforms.txt | 1 + project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt | 1 + .../cmake/addons/addons/pvr.vdr.vnsi/platforms.txt | 1 + .../addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt | 1 + .../cmake/addons/addons/pvr.vuplus/platforms.txt | 1 + .../cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt | 1 + project/cmake/addons/addons/pvr.wmc/platforms.txt | 1 + project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt | 1 + project/cmake/addons/depends/CMakeLists.txt | 42 ++++ project/cmake/addons/depends/README | 61 +++++ .../addons/depends/common/kodi-platform/deps.txt | 2 + .../depends/common/kodi-platform/kodi-platform.txt | 1 + .../addons/depends/common/tinyxml/CMakeLists.txt | 23 ++ .../addons/depends/common/tinyxml/tinyxml.txt | 1 + .../cmake/addons/depends/windows/CMakeLists.txt | 55 +++++ .../cmake/addons/depends/windows/Find7Zip.cmake | 7 + project/cmake/addons/depends/windows/README | 19 ++ .../cmake/addons/depends/windows/extract-7z.cmake | 10 + .../addons/depends/windows/extract-direct.cmake | 2 + project/cmake/addons/depends/windows/install.cmake | 24 ++ .../cmake/addons/depends/windows/prebuilt/README | 21 ++ 49 files changed, 619 insertions(+) create mode 100644 project/cmake/addons/CMakeLists.txt create mode 100644 project/cmake/addons/README create mode 100644 project/cmake/addons/addons/audioencoder.flac/audioencoder.flac.txt create mode 100644 project/cmake/addons/addons/audioencoder.flac/platforms.txt create mode 100644 project/cmake/addons/addons/audioencoder.lame/audioencoder.lame.txt create mode 100644 project/cmake/addons/addons/audioencoder.lame/platforms.txt create mode 100644 project/cmake/addons/addons/audioencoder.vorbis/audioencoder.vorbis.txt create mode 100644 project/cmake/addons/addons/audioencoder.vorbis/platforms.txt create mode 100644 project/cmake/addons/addons/audioencoder.wav/audioencoder.wav.txt create mode 100644 project/cmake/addons/addons/audioencoder.wav/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.argustv/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.argustv/pvr.argustv.txt create mode 100644 project/cmake/addons/addons/pvr.demo/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.demo/pvr.demo.txt create mode 100644 project/cmake/addons/addons/pvr.dvblink/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.dvblink/pvr.dvblink.txt create mode 100644 project/cmake/addons/addons/pvr.dvbviewer/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.dvbviewer/pvr.dvbviewer.txt create mode 100644 project/cmake/addons/addons/pvr.hts/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.hts/pvr.hts.txt create mode 100644 project/cmake/addons/addons/pvr.iptvsimple/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.iptvsimple/pvr.iptvsimple.txt create mode 100644 project/cmake/addons/addons/pvr.mediaportal.tvserver/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.mediaportal.tvserver/pvr.mediaportal.tvserver.txt create mode 100644 project/cmake/addons/addons/pvr.mythtv/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.mythtv/pvr.mythtv.txt create mode 100644 project/cmake/addons/addons/pvr.nextpvr/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.nextpvr/pvr.nextpvr.txt create mode 100644 project/cmake/addons/addons/pvr.njoy/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.njoy/pvr.njoy.txt create mode 100644 project/cmake/addons/addons/pvr.vdr.vnsi/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.vdr.vnsi/pvr.vdr.vnsi.txt create mode 100644 project/cmake/addons/addons/pvr.vuplus/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.vuplus/pvr.vuplus.txt create mode 100644 project/cmake/addons/addons/pvr.wmc/platforms.txt create mode 100644 project/cmake/addons/addons/pvr.wmc/pvr.wmc.txt create mode 100644 project/cmake/addons/depends/CMakeLists.txt create mode 100644 project/cmake/addons/depends/README create mode 100644 project/cmake/addons/depends/common/kodi-platform/deps.txt create mode 100644 project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt create mode 100644 project/cmake/addons/depends/common/tinyxml/CMakeLists.txt create mode 100644 project/cmake/addons/depends/common/tinyxml/tinyxml.txt create mode 100644 project/cmake/addons/depends/windows/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/Find7Zip.cmake create mode 100644 project/cmake/addons/depends/windows/README create mode 100644 project/cmake/addons/depends/windows/extract-7z.cmake create mode 100644 project/cmake/addons/depends/windows/extract-direct.cmake create mode 100644 project/cmake/addons/depends/windows/install.cmake create mode 100644 project/cmake/addons/depends/windows/prebuilt/README (limited to 'project/cmake/addons') diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt new file mode 100644 index 0000000..0afc622 --- /dev/null +++ b/project/cmake/addons/CMakeLists.txt @@ -0,0 +1,249 @@ +project(kodi-addons) + +cmake_minimum_required(VERSION 2.8) + +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + +if(NOT CORE_SYSTEM_NAME) + string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) +endif() + +include(ExternalProject) + +### setup all the necessary paths +if(NOT APP_ROOT AND NOT XBMCROOT) + set(APP_ROOT ${PROJECT_SOURCE_DIR}/../../..) +elseif(NOT APP_ROOT) + file(TO_CMAKE_PATH "${XBMCROOT}" APP_ROOT) +else() + file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) +endif() +get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) + +if(NOT BUILD_DIR) + set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") +else() + file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR) +endif() +get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) + +if(NOT DEPENDS_PATH) + set(DEPENDS_PATH "${BUILD_DIR}/depends") +else() + file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) +endif() +get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) + +if(NOT PLATFORM_DIR) + set(PLATFORM_DIR ${APP_ROOT}/project/cmake/platform/${CORE_SYSTEM_NAME}) + file(TO_CMAKE_PATH "${PLATFORM_DIR}" PLATFORM_DIR) +endif() + +# make sure CMAKE_PREFIX_PATH is set +if(NOT CMAKE_PREFIX_PATH) + set(CMAKE_PREFIX_PATH "${DEPENDS_PATH}") +else() + file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) + list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}") +endif() + +# check for autoconf stuff to pass on +if(AUTOCONF_FILES) + separate_arguments(AUTOCONF_FILES) + set(CROSS_AUTOCONF "yes") +endif() + +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/output/addons") +endif() +list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}) + +set(BUILD_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_INSTALL_PREFIX:PATH= + -DPACKAGE_CONFIG_PATH=${DEPENDS_PATH}/lib/pkgconfig + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_USER_MAKE_RULES_OVERRIDE} + -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} + -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} + -DBUILD_SHARED_LIBS=1 + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} + -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}) + +if(PACKAGE_ZIP) + # needed for project installing + list(APPEND BUILD_ARGS -DPACKAGE_ZIP=1) + MESSAGE("package zip specified") +endif() + +if(CMAKE_TOOLCHAIN_FILE) + list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) + MESSAGE("toolchain specified") + MESSAGE(${BUILD_ARGS}) +endif() + +if(NOT ADDONS_TO_BUILD) + set(ADDONS_TO_BUILD "all") +else() + message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") + separate_arguments(ADDONS_TO_BUILD) +endif() + +if(NOT KODI_LIB_DIR) + set(KODI_LIB_DIR "${DEPENDS_PATH}/lib/kodi") +else() + file(TO_CMAKE_PATH "${KODI_LIB_DIR}" KODI_LIB_DIR) +endif() + +# check for platform specific stuff +if(EXISTS ${PLATFORM_DIR}/defines.txt) + file(STRINGS ${PLATFORM_DIR}/defines.txt platformdefines) + + if(NOT ARCH_DEFINES AND platformdefines) + set(ARCH_DEFINES ${platformdefines}) + endif() +endif() + +# include check_target_platform() function +include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) + +# check install permissions +set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) +check_install_permissions(${CMAKE_INSTALL_PREFIX} can_write) +if(NOT ${can_write} AND NOT WIN32) + set(NEED_SUDO TRUE) + set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) + message(STATUS "NEED_SUDO: ${NEED_SUDO}") +endif() + +### prepare the build environment for the binary addons +# copy the prepare-env.cmake script to the depends path so that we can include it +file(COPY ${APP_ROOT}/project/cmake/scripts/common/prepare-env.cmake DESTINATION ${KODI_LIB_DIR}) + +# add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found +list(APPEND CMAKE_MODULE_PATH ${KODI_LIB_DIR}) + +# include prepare-env.cmake which contains the logic to install the addon header bindings etc +include(prepare-env) + +### add the depends subdirectory for any general dependencies +add_subdirectory(depends) + +### get and build all the binary addons +# look for all the addons to be built +file(GLOB_RECURSE addons ${PROJECT_SOURCE_DIR}/addons/*.txt) +foreach(addon ${addons}) + if(NOT (addon MATCHES platforms.txt)) + file(STRINGS ${addon} def) + separate_arguments(def) + list(GET def 0 id) + + list(FIND ADDONS_TO_BUILD ${id} idx) + if(idx GREATER -1 OR ADDONS_TO_BUILD STREQUAL "all") + get_filename_component(dir ${addon} PATH) + + # check if the addon has a platforms.txt + set(platform_found FALSE) + check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) + + if (${platform_found}) + # make sure the output directory is clean + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}") + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/") + endif() + + # get the URL and revision of the addon + list(LENGTH def deflength) + list(GET def 1 url) + + set(archive_name ${id}) + + # if there is a 3rd parameter in the file, we consider it a git revision + if(deflength GREATER 2) + list(GET def 2 revision) + + # Note: downloading specific revisions via http in the format below is probably github specific + # if we ever use other repositories, this might need adapting + set(url ${url}/archive/${revision}.tar.gz) + set(archive_name ${archive_name}-${revision}) + endif() + + # download and extract the addon + if(NOT EXISTS ${BUILD_DIR}/download/${archive_name}.tar.gz) + # cleanup any of the previously downloaded archives of this addon + file(GLOB archives "${BUILD_DIR}/download/${id}*.tar.gz") + if(archives) + message(STATUS "Removing old archives of ${id}: ${archives}") + file(REMOVE ${archives}) + endif() + + # download the addon + file(DOWNLOAD "${url}" "${BUILD_DIR}/download/${archive_name}.tar.gz" STATUS dlstatus LOG dllog SHOW_PROGRESS) + list(GET dlstatus 0 retcode) + if(NOT ${retcode} EQUAL 0) + message(FATAL_ERROR "ERROR downloading ${url} - status: ${dlstatus} log: ${dllog}") + endif() + endif() + + # remove any previously extracted version of the addon + if(EXISTS "${BUILD_DIR}/${id}") + file(REMOVE_RECURSE "${BUILD_DIR}/${id}") + endif() + + # extract the addon from the archive + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz + WORKING_DIRECTORY ${BUILD_DIR}) + file(GLOB extract_dir "${BUILD_DIR}/${archive_name}*") + if(extract_dir STREQUAL "") + message(FATAL_ERROR "Error extracting ${BUILD_DIR}/download/${archive_name}.tar.gz") + else() + file(RENAME "${extract_dir}" "${BUILD_DIR}/${id}") + endif() + + list(APPEND downloaded_addons ${id}) + + endif() + endif() + endif() +endforeach() + +foreach(id ${downloaded_addons}) + externalproject_add(${id} + SOURCE_DIR ${BUILD_DIR}/${id} + INSTALL_DIR ${ADDON_INSTALL_DIR} + CMAKE_ARGS ${BUILD_ARGS}) + + # add a custom step to the external project between the configure and the build step which will always + # be executed and therefore forces a re-build of all changed files + externalproject_add_step(${id} forcebuild + COMMAND ${CMAKE_COMMAND} -E echo "Force build of ${id}" + DEPENDEES configure + DEPENDERS build + ALWAYS 1) + + # add "kodi-platform" as a dependency to every addon + add_dependencies(${id} kodi-platform) + + set(${id}_DEPENDS_DIR ${BUILD_DIR}/${id}/depends) + + if(EXISTS ${${id}_DEPENDS_DIR}) + include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) + add_addon_depends(${id} ${${id}_DEPENDS_DIR}) + if (${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "") + message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}") + add_dependencies(${id} ${${id}_DEPS}) + endif() + endif() +endforeach() + +if(NEED_SUDO) + add_custom_target(install + COMMAND ${CMAKE_COMMAND} -E echo "\n\n" + COMMAND ${CMAKE_COMMAND} -E echo "WARNING: sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}\n" + COMMAND sudo ${CMAKE_COMMAND} -E copy_directory ${ADDON_INSTALL_DIR}/ ${CMAKE_INSTALL_PREFIX}/ + COMMAND sudo ${CMAKE_COMMAND} -E remove_directory ${ADDON_INSTALL_DIR}/ + COMMAND sudo -k) +endif() diff --git a/project/cmake/addons/README b/project/cmake/addons/README new file mode 100644 index 0000000..c66e668 --- /dev/null +++ b/project/cmake/addons/README @@ -0,0 +1,68 @@ +KODI ADDONS +=========== +This directory contains the cmake-based buildsystem for addons. It looks into +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 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. + +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, darwin, ios, android, rbpi + +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 is a quoted, space delimited list of s that + you want to build (default is "all"). + * 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=1 will mean the add-ons will be 'packaged' into a common folder, + rather than being placed in /lib/kodi/addons and + /share/kodi/addons. + * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines + (defaults to empty). + +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="/cmake" sub-directories and parses +all *.txt files recursively. Each dependency must have its own .txt +file (either in the main sub-directory or in a separate subdirectory of the main +subdirectory) which must follow one of the defined formats: + * an empty file means that no extra downloads are necessary + * + * + * +where + * must be identical to the filename + * must be the URL to an archive that is downloaded and extracted. + * must be the URL of the git repository containing the + dependency. + * must be a valid git tag/branch/commit in the dependency's git + repository which will be used for the build. + +Reserved filenames (for additional information on how to build a dependency) +are: + * CMakeLists.txt: build instructions for the dependency + * install.txt: instructions on how to install the dependency's built files + * noinstall.txt: no installation step required (content is ignored) + * 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)). + * APP_ROOT points to the root directory of the project (default is the + absolute representation of ../../.. starting from this directory). + * DEPENDS_PATH points to the directory where the built dependencies + (their include and library file) will be installed to. + * ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines + (defaults to empty). + * 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 \ + -DAPP_ROOT="" \ + -DARCH_DEFINES="-DTARGET_LINUX" \ + -DCMAKE_INSTALL_PREFIX=" 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. +For win32 builds one of the "Visual Studio XX" or the "NMake Makefiles" +generators is preferred. For the "NMake Makefiles" generator to work the above +command must be called from an environment prepared for VC++ builds (see +http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx). diff --git a/project/cmake/addons/depends/windows/extract-7z.cmake b/project/cmake/addons/depends/windows/extract-7z.cmake new file mode 100644 index 0000000..95a2672 --- /dev/null +++ b/project/cmake/addons/depends/windows/extract-7z.cmake @@ -0,0 +1,10 @@ +get_filename_component(file ${URL} NAME) +file(DOWNLOAD ${URL} ${DEST}/${file}) +execute_process(COMMAND ${7ZIP_EXECUTABLE} -y x ${DEST}/${file} + WORKING_DIRECTORY ${DESTDIR}) +if(${file} MATCHES .tar) + string(REPLACE ".7z" "" tarball ${file}) + string(REPLACE ".lzma" "" tarball ${file}) + execute_process(COMMAND ${7ZIP_EXECUTABLE} -y x ${DESTDIR}/${tarball} + WORKING_DIRECTORY ${DESTDIR}) +endif() diff --git a/project/cmake/addons/depends/windows/extract-direct.cmake b/project/cmake/addons/depends/windows/extract-direct.cmake new file mode 100644 index 0000000..13cb74f --- /dev/null +++ b/project/cmake/addons/depends/windows/extract-direct.cmake @@ -0,0 +1,2 @@ +get_filename_component(file ${URL} NAME) +file(DOWNLOAD ${URL} ${DEST}/${file}) diff --git a/project/cmake/addons/depends/windows/install.cmake b/project/cmake/addons/depends/windows/install.cmake new file mode 100644 index 0000000..9a3adbb --- /dev/null +++ b/project/cmake/addons/depends/windows/install.cmake @@ -0,0 +1,24 @@ +if(EXISTS "${INPUTFILE}") + # if there's an input file we use it to determine which files to copy where + file(STRINGS ${INPUTFILE} FILES) + string(REPLACE "\n" ";" FILES "${FILES}") + foreach(file ${FILES}) + string(REPLACE " " ";" file "${file}") + list(GET file 0 dir) + list(GET file 1 dest) + list(LENGTH file deflength) + if(deflength GREATER 2) + list(GET file 2 copy) + endif() + file(GLOB files ${INPUTDIR}/${dir}) + foreach(instfile ${files}) + file(COPY ${instfile} DESTINATION ${DESTDIR}/${dest}) + if(copy) + file(COPY ${instfile} DESTINATION ${DESTDIR}/${copy}) + endif() + endforeach() + endforeach() +else() + # otherwise we assume that the content of the extracted archive is already well-formed and can just be copied + file(COPY ${INPUTDIR}/${dir} DESTINATION ${DESTDIR}) +endif() \ No newline at end of file diff --git a/project/cmake/addons/depends/windows/prebuilt/README b/project/cmake/addons/depends/windows/prebuilt/README new file mode 100644 index 0000000..a0c70d6 --- /dev/null +++ b/project/cmake/addons/depends/windows/prebuilt/README @@ -0,0 +1,21 @@ +KODI WIN32 PREBUILT ADDON DEPENDENCIES +====================================== +This directory contains a file or sub-directory for every prebuilt dependency +used by one of the addons being built. There are two different modes supported. +Both include a file named .txt which must follow the defined format + + +If the archive, which the points at, contains + * only the necessary files and in the proper directory structure (i.e. an + "include" and a "lib" directory) then the file must be put into this + directory and nothing else is needed. + * unnecessary files and/or does not follow the defined directory structure + (i.e. an "include" and a "lib" directory) then the file must be put into a + sub-directory named . Furthermore an additional file called + "install.txt" must be placed in that sub-directory. install.txt contains a + line for every path/directory/file with a destination where it must be copied + to. It must follow the defined format + [] + where must be an existing file, directory or a path containing + wildcards, and the optional must be existing + directories. -- cgit v1.2.3