summaryrefslogtreecommitdiff
path: root/cmake/mbgl.cmake
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-08-20 13:32:44 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-08-20 13:32:44 +0200
commitc9ab6ce58d95edab20b5c8e4e8a33b4f82335787 (patch)
tree019fbea3b3c1580fe2593aa50ac18f769134aec5 /cmake/mbgl.cmake
parent112bbc7ab289298094d6e6593437a71ec8029caa (diff)
downloadqtlocation-mapboxgl-c9ab6ce58d95edab20b5c8e4e8a33b4f82335787.tar.gz
[build] use plain text files for file lists to simplify integration with other build systemsupstream/cmake-file-lists
Diffstat (limited to 'cmake/mbgl.cmake')
-rw-r--r--cmake/mbgl.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake
index 9dd29375ef..55a36079a7 100644
--- a/cmake/mbgl.cmake
+++ b/cmake/mbgl.cmake
@@ -119,6 +119,24 @@ function(create_source_groups target)
endforeach()
endfunction()
+function(load_sources_list VAR FILELIST)
+ set(_FILES)
+ file(STRINGS "${FILELIST}" _LINES)
+ foreach(_LINE IN LISTS _LINES)
+ string(STRIP "${_LINE}" _LINE)
+ string(REGEX MATCH "^([^;#]+)" _FILE "${_LINE}")
+ if (_FILE)
+ list(APPEND _FILES "${_FILE}")
+ endif()
+ endforeach()
+ set(${VAR} "${_FILES}" PARENT_SCOPE)
+endfunction()
+
+function(target_sources_from_file TARGET TYPE FILELIST)
+ load_sources_list(_FILELIST "${FILELIST}")
+ target_sources(${TARGET} ${TYPE} "${_FILELIST}")
+endfunction()
+
# Creates a library target for a vendored dependency
function(add_vendor_target NAME TYPE)
set(INCLUDE_TYPE "INTERFACE")