summaryrefslogtreecommitdiffstats
path: root/project/cmake/addons/bootstrap/bootstrap.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
committermanuel <manuel@mausz.at>2016-03-08 21:02:53 +0100
commit9fc8b732737f139d3e466510d75668ab45578960 (patch)
tree76db9bf5cb8cc869be908a5ed3d6f4cca3e3608a /project/cmake/addons/bootstrap/bootstrap.cmake
parentb75e2659df11c23aa921d2eed83c23adc282ed27 (diff)
downloadkodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.gz
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.bz2
kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.zip
sync with upstream
Diffstat (limited to 'project/cmake/addons/bootstrap/bootstrap.cmake')
-rw-r--r--project/cmake/addons/bootstrap/bootstrap.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/project/cmake/addons/bootstrap/bootstrap.cmake b/project/cmake/addons/bootstrap/bootstrap.cmake
new file mode 100644
index 0000000..c78910c
--- /dev/null
+++ b/project/cmake/addons/bootstrap/bootstrap.cmake
@@ -0,0 +1,38 @@
1list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
2
3# make sure that the installation location has been specified
4if(NOT CMAKE_INSTALL_PREFIX)
5 message(FATAL_ERROR "CMAKE_INSTALL_PREFIX has not been specified")
6endif()
7
8# figure out which addons to bootstrap (defaults to all)
9if(NOT ADDONS_TO_BUILD)
10 set(ADDONS_TO_BUILD "all")
11else()
12 separate_arguments(ADDONS_TO_BUILD)
13endif()
14
15# find all addon definitions and go through them
16file(GLOB_RECURSE ADDON_DEFINITIONS ${PROJECT_SOURCE_DIR}/*.txt)
17foreach(ADDON_DEFINITION_FILE ${ADDON_DEFINITIONS})
18 # ignore platforms.txt
19 if(NOT (ADDON_DEFINITION_FILE MATCHES platforms.txt))
20 # read the addon definition file
21 file(STRINGS ${ADDON_DEFINITION_FILE} ADDON_DEFINITION)
22 separate_arguments(ADDON_DEFINITION)
23
24 # extract the addon definition's identifier
25 list(GET ADDON_DEFINITION 0 ADDON_ID)
26
27 # check if the addon definition should be built
28 list(FIND ADDONS_TO_BUILD ${ADDON_ID} ADDONS_TO_BUILD_IDX)
29 if(ADDONS_TO_BUILD_IDX GREATER -1 OR "${ADDONS_TO_BUILD}" STREQUAL "all")
30 # get the path to the addon definition directory
31 get_filename_component(ADDON_DEFINITION_DIR ${ADDON_DEFINITION_FILE} PATH)
32
33 # install the addon definition
34 message(STATUS "Bootstrapping ${ADDON_ID} addon...")
35 file(INSTALL ${ADDON_DEFINITION_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})
36 endif()
37 endif()
38endforeach()