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/bootstrap/Bootstrap.cmake | 39 +++++++++++++++++++++++++ project/cmake/addons/bootstrap/CMakeLists.txt | 7 ++--- project/cmake/addons/bootstrap/bootstrap.cmake | 40 -------------------------- 3 files changed, 42 insertions(+), 44 deletions(-) create mode 100644 project/cmake/addons/bootstrap/Bootstrap.cmake delete mode 100644 project/cmake/addons/bootstrap/bootstrap.cmake (limited to 'project/cmake/addons/bootstrap') diff --git a/project/cmake/addons/bootstrap/Bootstrap.cmake b/project/cmake/addons/bootstrap/Bootstrap.cmake new file mode 100644 index 0000000..5d20302 --- /dev/null +++ b/project/cmake/addons/bootstrap/Bootstrap.cmake @@ -0,0 +1,39 @@ +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}") + string(REPLACE " " ";" ADDONS_TO_BUILD ${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) + string(REPLACE " " ";" ADDON_DEFINITION ${ADDON_DEFINITION}) + + # extract the addon definition's identifier + list(GET ADDON_DEFINITION 0 ADDON_ID) + + # check if the addon definition should be built + if(ADDON_ID MATCHES "^${ADDONS_TO_BUILD}" OR ADDONS_TO_BUILD STREQUAL all) + # get the path to the addon definition directory + get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} DIRECTORY) + + # 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/bootstrap/CMakeLists.txt b/project/cmake/addons/bootstrap/CMakeLists.txt index 86950b8..c20b97e 100644 --- a/project/cmake/addons/bootstrap/CMakeLists.txt +++ b/project/cmake/addons/bootstrap/CMakeLists.txt @@ -1,7 +1,6 @@ +cmake_minimum_required(VERSION 3.1) project(kodi-addons-bootstrap) -cmake_minimum_required(VERSION 2.8) - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) # make sure CMAKE_INSTALL_PREFIX is properly set @@ -52,7 +51,7 @@ function(bootstrap_repo repo_id repo_url repo_revision) -DPROJECT_SOURCE_DIR= -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() -- cgit v1.2.3