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/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 ++++++++ 13 files changed, 268 insertions(+) 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/depends') diff --git a/project/cmake/addons/depends/CMakeLists.txt b/project/cmake/addons/depends/CMakeLists.txt new file mode 100644 index 0000000..760acf4 --- /dev/null +++ b/project/cmake/addons/depends/CMakeLists.txt @@ -0,0 +1,42 @@ +project(kodi-addons-depends) + +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) + +if(NOT DEPENDS_PATH) + set(DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) +else() + file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) +endif() +get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) +list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_PATH}) + +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) + +## use add_addon_depends to handle the cmake based dependencies +include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) +add_addon_depends(depends "${PROJECT_SOURCE_DIR}") + +## if there's a platform-specific sub-directory containing a CMakeLists.txt, add it to the build as well +if(EXISTS ${PROJECT_SOURCE_DIR}/${CORE_SYSTEM_NAME}/CMakeLists.txt) + message(STATUS "Processing ${CORE_SYSTEM_NAME}") + add_subdirectory(${CORE_SYSTEM_NAME}) +else() + message(STATUS "No platform specific file ${PROJECT_SOURCE_DIR}/${CORE_SYSTEM_NAME}/CMakeLists.txt found") +endif() diff --git a/project/cmake/addons/depends/README b/project/cmake/addons/depends/README new file mode 100644 index 0000000..66e924a --- /dev/null +++ b/project/cmake/addons/depends/README @@ -0,0 +1,61 @@ +KODI ADDON DEPENDENCIES +======================= +This directory contains the cmake-based buildsystem for addon dependencies. It +looks into the "common" and the "/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