From 8cdf8dec703d882b46ca50a769fabb95ffc48e2c Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 24 Nov 2016 21:27:41 +0100 Subject: sync with upstream --- project/cmake/addons/CMakeLists.txt | 122 ++++++++++++--------- project/cmake/addons/README.md | 14 ++- project/cmake/addons/bootstrap/Bootstrap.cmake | 39 +++++++ project/cmake/addons/bootstrap/CMakeLists.txt | 7 +- project/cmake/addons/bootstrap/bootstrap.cmake | 40 ------- project/cmake/addons/depends/CMakeLists.txt | 15 ++- project/cmake/addons/depends/README | 6 +- .../depends/common/kodi-platform/kodi-platform.txt | 2 +- .../addons/depends/common/tinyxml/CMakeLists.txt | 3 +- .../cmake/addons/depends/windows/CMakeLists.txt | 23 ++-- .../cmake/addons/depends/windows/Find7Zip.cmake | 7 -- project/cmake/addons/depends/windows/Install.cmake | 24 ++++ .../cmake/addons/depends/windows/extract-7z.cmake | 10 -- .../addons/depends/windows/extract-direct.cmake | 2 - project/cmake/addons/depends/windows/install.cmake | 24 ---- 15 files changed, 167 insertions(+), 171 deletions(-) create mode 100644 project/cmake/addons/bootstrap/Bootstrap.cmake delete mode 100644 project/cmake/addons/bootstrap/bootstrap.cmake delete mode 100644 project/cmake/addons/depends/windows/Find7Zip.cmake create mode 100644 project/cmake/addons/depends/windows/Install.cmake delete mode 100644 project/cmake/addons/depends/windows/extract-7z.cmake delete mode 100644 project/cmake/addons/depends/windows/extract-direct.cmake delete mode 100644 project/cmake/addons/depends/windows/install.cmake (limited to 'project/cmake/addons') diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt index 982d977..96e544b 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt @@ -1,12 +1,6 @@ +cmake_minimum_required(VERSION 3.1) project(kodi-addons) -if(WIN32) - # there seems to be a bug in the CMake generator implementation in CMake 2.8.x releases for WIN32 - cmake_minimum_required(VERSION 3.0) -else() - cmake_minimum_required(VERSION 2.8) -endif() - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) option(ADDON_TARBALL_CACHING "Cache downloaded addon source tarballs?" ON) @@ -31,14 +25,17 @@ 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) +if(APP_ROOT) + set(CORE_SOURCE_DIR ${APP_ROOT}) + unset(APP_ROOT) + message(WARNING "APP_ROOT is deprecated. Please use CORE_SOURCE_DIR instead.") +endif() +if(NOT CORE_SOURCE_DIR) + set(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../..) else() - file(TO_CMAKE_PATH "${APP_ROOT}" APP_ROOT) + file(TO_CMAKE_PATH "${CORE_SOURCE_DIR}" CORE_SOURCE_DIR) endif() -get_filename_component(APP_ROOT "${APP_ROOT}" ABSOLUTE) +get_filename_component(CORE_SOURCE_DIR "${CORE_SOURCE_DIR}" ABSOLUTE) if(NOT BUILD_DIR) set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") @@ -47,29 +44,29 @@ else() endif() get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) -if(NOT DEPENDS_PATH) - set(DEPENDS_PATH "${BUILD_DIR}/depends") +if(NOT ADDON_DEPENDS_PATH) + set(ADDON_DEPENDS_PATH "${BUILD_DIR}/depends") else() - file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) + file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH) endif() -get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) +get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) if(NOT PLATFORM_DIR) - set(PLATFORM_DIR ${APP_ROOT}/project/cmake/platform/${CORE_SYSTEM_NAME}) + set(PLATFORM_DIR ${CORE_SOURCE_DIR}/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}") + set(CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}") else() file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) - list(APPEND CMAKE_PREFIX_PATH "${DEPENDS_PATH}") + list(APPEND CMAKE_PREFIX_PATH "${ADDON_DEPENDS_PATH}") endif() # check for autoconf stuff to pass on if(AUTOCONF_FILES) - separate_arguments(AUTOCONF_FILES) + string(REPLACE " " ";" AUTOCONF_FILES ${AUTOCONF_FILES}) set(CROSS_AUTOCONF "yes") endif() @@ -80,8 +77,9 @@ 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 - -DDEPENDS_PATH=${DEPENDS_PATH} + -DPACKAGE_CONFIG_PATH=${ADDON_DEPENDS_PATH}/lib/pkgconfig + -DADDON_DEPENDS_PATH=${ADDON_DEPENDS_PATH} + -DOVERRIDE_PATHS=${OVERRIDE_PATHS} -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} @@ -108,13 +106,13 @@ if(PACKAGE_ZIP) endif() list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR}) - MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") + message(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") endif() if(CMAKE_TOOLCHAIN_FILE) list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) - MESSAGE(STATUS "Toolchain specified") - MESSAGE(STATUS ${BUILD_ARGS}) + message(STATUS "Toolchain specified") + message(STATUS ${BUILD_ARGS}) endif() if(NOT ADDONS_TO_BUILD) @@ -122,7 +120,7 @@ if(NOT ADDONS_TO_BUILD) else() string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) message(STATUS "Building following addons: ${ADDONS_TO_BUILD}") - separate_arguments(ADDONS_TO_BUILD) + string(REPLACE " " ";" ADDONS_TO_BUILD ${ADDONS_TO_BUILD}) endif() if(NOT ADDONS_DEFINITION_DIR) @@ -133,12 +131,14 @@ 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) + if(NOT IS_ABSOLUTE ${ADDON_SRC_PREFIX}) + get_filename_component(ADDON_SRC_PREFIX "${CMAKE_BINARY_DIR}/${ADDON_SRC_PREFIX}" ABSOLUTE) + endif() message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}") endif() if(NOT APP_LIB_DIR) - set(APP_LIB_DIR "${DEPENDS_PATH}/lib/kodi") + set(APP_LIB_DIR "${ADDON_DEPENDS_PATH}/lib/kodi") else() file(TO_CMAKE_PATH "${APP_LIB_DIR}" APP_LIB_DIR) endif() @@ -155,7 +155,7 @@ if(EXISTS ${PLATFORM_DIR}/defines.txt) endif() # include check_target_platform() function -include(${APP_ROOT}/project/cmake/scripts/common/check_target_platform.cmake) +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake) set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) if(NOT WIN32) @@ -164,21 +164,23 @@ if(NOT WIN32) if(NOT ${can_write} AND CMAKE_SYSTEM_NAME STREQUAL "Linux") set(NEED_SUDO TRUE) set(ADDON_INSTALL_DIR ${CMAKE_BINARY_DIR}/.install) - message(STATUS "NEED_SUDO: ${NEED_SUDO}") + list(APPEND BUILD_ARGS -DOVERRIDE_PATHS=ON) + message(STATUS "NEED_SUDO: ${NEED_SUDO} (no write permission for ${CMAKE_INSTALL_PREFIX})") endif() 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 ${APP_LIB_DIR}) +# copy the PrepareEnv.cmake script to the depends path so that we can include it +file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake DESTINATION ${APP_LIB_DIR}) -# add the location of prepare-env.cmake to CMAKE_MODULE_PATH so that it is found +# add the location of PrepareEnv.cmake to CMAKE_MODULE_PATH so that it is found list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR}) -# include prepare-env.cmake which contains the logic to install the addon header bindings etc -include(prepare-env) +# include PrepareEnv.cmake which contains the logic to install the addon header bindings etc +include(PrepareEnv) ### add the depends subdirectory for any general dependencies +message(STATUS "\n-- ---- Preparing general dependencies ----") add_subdirectory(depends) # add a custom target "package-addons" which will package and install all addons @@ -198,12 +200,13 @@ if(NOT addons) file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) endif() - string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") + string(REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") # generate the bootstrap buildsystem execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} -DBUILD_DIR:PATH=${BOOTSTRAP_BUILD_DIR} -DADDONS_TO_BUILD:STRING=${ADDONS_TO_BUILD_STR} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} WORKING_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) # execute the generated bootstrap buildsystem @@ -218,10 +221,14 @@ if(NOT addons) endif() endif() +# Track if at least one addon has been found. Everything else is likely an +# error either in ADDONS_TO_BUILD or in the directory configuration. +set(SUPPORTED_ADDON_FOUND FALSE) + foreach(addon ${addons}) if(NOT (addon MATCHES platforms.txt)) file(STRINGS ${addon} def) - separate_arguments(def) + string(REPLACE " " ";" def ${def}) list(GET def 0 id) set(ADDON_FOUND FALSE) @@ -236,17 +243,18 @@ foreach(addon ${addons}) endif() if(ADDON_FOUND) - get_filename_component(dir ${addon} PATH) + message(STATUS "\n-- ---- Configuring addon ${addon} ----") + set(SUPPORTED_ADDON_FOUND TRUE) + + get_filename_component(dir ${addon} DIRECTORY) # check if the addon has a platforms.txt set(platform_found FALSE) check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) - if (${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() + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/") # get the URL and revision of the addon list(LENGTH def deflength) @@ -324,9 +332,7 @@ foreach(addon ${addons}) endif() # remove any previously extracted version of the addon - if(EXISTS "${BUILD_DIR}/${id}") - file(REMOVE_RECURSE "${BUILD_DIR}/${id}") - endif() + file(REMOVE_RECURSE "${BUILD_DIR}/${id}") # extract the addon from the archive execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz @@ -365,7 +371,7 @@ foreach(addon ${addons}) set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) if(EXISTS ${${id}_DEPENDS_DIR}) - include(${APP_ROOT}/project/cmake/scripts/common/handle-depends.cmake) + include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake) add_addon_depends(${id} ${${id}_DEPENDS_DIR}) if(${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "") message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}") @@ -401,16 +407,28 @@ foreach(addon ${addons}) endif() endif() endforeach() +message(STATUS "") 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" + add_custom_target(sudo-install + COMMAND ${CMAKE_COMMAND} -E echo "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) + + foreach(_id ${ALL_ADDONS_BUILDING}) + add_dependencies(sudo-install ${_id}) + endforeach() + message(WARNING "sudo rights needed to install to ${CMAKE_INSTALL_PREFIX}") + message(STATUS "\nplease type \"make sudo-install\"\n\n") +endif() + +if(NOT SUPPORTED_ADDON_FOUND) + message(FATAL_ERROR "${ADDONS_TO_BUILD} did not match any of the supported addons. \ + A list of supported addons can be viewed by building the 'supported_addons' target. \ + Addon definitions are loaded from ADDONS_DEFINITION_DIR (${ADDONS_DEFINITION_DIR}).") endif() # add custom target "supported_addons" that returns all addons that are supported on this platform string(REPLACE ";" " " ALL_ADDONS_BUILDING "${ALL_ADDONS_BUILDING}") -add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) \ No newline at end of file +add_custom_target(supported_addons COMMAND ${CMAKE_COMMAND} -E echo "ALL_ADDONS_BUILDING: ${ALL_ADDONS_BUILDING}" VERBATIM) +add_custom_target(need-sudo COMMAND ${CMAKE_COMMAND} -E echo ${NEED_SUDO} VERBATIM) diff --git a/project/cmake/addons/README.md b/project/cmake/addons/README.md index c75ead7..6470ee1 100644 --- a/project/cmake/addons/README.md +++ b/project/cmake/addons/README.md @@ -31,16 +31,20 @@ The buildsystem uses the following variables (which can be passed into it when e - `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_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) +- `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 +Buildsystem will print a warning if you use any of the below-listed variables. For now they still work but you should adapt your workflow to the new variables. +- `APP_ROOT` - Use `CORE_SOURCE_DIR` instead + ## 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) @@ -55,7 +59,7 @@ In case of additional options the call might look like this: cmake `` [-G ``] \ -DCMAKE_BUILD_TYPE=Release \ - -DAPP_ROOT="``" \ + -DCORE_SOURCE_DIR="``" \ -DARCH_DEFINES="-DTARGET_LINUX" \ - -DDEPENDS_PATH=`` \ + -DADDON_DEPENDS_PATH=`` \ -DCMAKE_INSTALL_PREFIX="` -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DADDONS_TO_BUILD=${ADDONS_TO_BUILD} - -P ${PROJECT_SOURCE_DIR}/bootstrap.cmake + -P ${PROJECT_SOURCE_DIR}/Bootstrap.cmake ) endfunction() @@ -61,7 +60,7 @@ set(REPOSITORY_TO_BUILD_FOUND OFF) file(GLOB repos repositories/*.txt) foreach(repo ${repos}) file(STRINGS ${repo} repo_definition) - separate_arguments(repo_definition) + string(REPLACE " " ";" repo_definition ${repo_definition}) list(GET repo_definition 0 repo_id) list(FIND REPOSITORY_TO_BUILD ${repo_id} idx) diff --git a/project/cmake/addons/bootstrap/bootstrap.cmake b/project/cmake/addons/bootstrap/bootstrap.cmake deleted file mode 100644 index 25e8aa2..0000000 --- a/project/cmake/addons/bootstrap/bootstrap.cmake +++ /dev/null @@ -1,40 +0,0 @@ -list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) - -# make sure that the installation location has been specified -if(NOT CMAKE_INSTALL_PREFIX) - message(FATAL_ERROR "CMAKE_INSTALL_PREFIX has not been specified") -endif() - -# figure out which addons to bootstrap (defaults to all) -if(NOT ADDONS_TO_BUILD) - set(ADDONS_TO_BUILD "all") -else() - string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) - message(STATUS "Bootstrapping following addons: ${ADDONS_TO_BUILD}") - separate_arguments(ADDONS_TO_BUILD) -endif() - -# find all addon definitions and go through them -file(GLOB_RECURSE ADDON_DEFINITIONS ${PROJECT_SOURCE_DIR}/*.txt) -foreach(ADDON_DEFINITION_FILE ${ADDON_DEFINITIONS}) - # ignore platforms.txt - if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt)) - # read the addon definition file - file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION) - separate_arguments(ADDON_DEFINITION) - - # extract the addon definition's identifier - list(GET ADDON_DEFINITION 0 ADDON_ID) - - # check if the addon definition should be built - list(FIND ADDONS_TO_BUILD ${ADDON_ID} ADDONS_TO_BUILD_IDX) - if(ADDONS_TO_BUILD_IDX GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all") - # get the path to the addon definition directory - get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} PATH) - - # install the addon definition - message(STATUS "Bootstrapping ${ADDON_ID} addon...") - file(INSTALL ${ADDON_DEFINITION_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}) - endif() - endif() -endforeach() diff --git a/project/cmake/addons/depends/CMakeLists.txt b/project/cmake/addons/depends/CMakeLists.txt index 760acf4..622701d 100644 --- a/project/cmake/addons/depends/CMakeLists.txt +++ b/project/cmake/addons/depends/CMakeLists.txt @@ -1,7 +1,6 @@ +cmake_minimum_required(VERSION 3.1) project(kodi-addons-depends) -cmake_minimum_required(VERSION 2.8) - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) if(NOT CMAKE_BUILD_TYPE) @@ -14,13 +13,13 @@ endif() include(ExternalProject) -if(NOT DEPENDS_PATH) - set(DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) +if(NOT ADDON_DEPENDS_PATH) + set(ADDON_DEPENDS_PATH ${PROJECT_SOURCE_DIR}/../build/depends) else() - file(TO_CMAKE_PATH "${DEPENDS_PATH}" DEPENDS_PATH) + file(TO_CMAKE_PATH "${ADDON_DEPENDS_PATH}" ADDON_DEPENDS_PATH) endif() -get_filename_component(DEPENDS_PATH "${DEPENDS_PATH}" ABSOLUTE) -list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_PATH}) +get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) +list(APPEND CMAKE_PREFIX_PATH ${ADDON_DEPENDS_PATH}) if(NOT BUILD_DIR) set(BUILD_DIR "${CMAKE_BINARY_DIR}/build") @@ -30,7 +29,7 @@ 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) +include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.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 diff --git a/project/cmake/addons/depends/README b/project/cmake/addons/depends/README index 66e924a..584a167 100644 --- a/project/cmake/addons/depends/README +++ b/project/cmake/addons/depends/README @@ -34,9 +34,9 @@ specific paths: 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 + * CORE_SOURCE_DIR 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 + * 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). @@ -56,6 +56,6 @@ In case of additional options the call might look like this cmake [-G ] \ -DCMAKE_BUILD_TYPE=Release \ - -DAPP_ROOT="" \ + -DCORE_SOURCE_DIR="" \ -DARCH_DEFINES="-DTARGET_LINUX" \ -DCMAKE_INSTALL_PREFIX="