diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-08-20 13:32:44 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-08-20 19:11:31 +0200 |
commit | bded6c65d59b6da9e7cd6d4787e5f707a62a8285 (patch) | |
tree | 3aceee126b9892bcd9625c1c6962c8ef87ce8bf3 /cmake/mbgl.cmake | |
parent | 1b4398f7aab99f6604f56957209551fb7372a9d6 (diff) | |
download | qtlocation-mapboxgl-bded6c65d59b6da9e7cd6d4787e5f707a62a8285.tar.gz |
[build] use plain text files for file lists to simplify integration with other build systems
Diffstat (limited to 'cmake/mbgl.cmake')
-rw-r--r-- | cmake/mbgl.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake index 2381c01205..fdb435ccca 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") |