summaryrefslogtreecommitdiff
path: root/scripts/generate-cmake-files.js
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 19:11:31 +0200
commitbded6c65d59b6da9e7cd6d4787e5f707a62a8285 (patch)
tree3aceee126b9892bcd9625c1c6962c8ef87ce8bf3 /scripts/generate-cmake-files.js
parent1b4398f7aab99f6604f56957209551fb7372a9d6 (diff)
downloadqtlocation-mapboxgl-bded6c65d59b6da9e7cd6d4787e5f707a62a8285.tar.gz
[build] use plain text files for file lists to simplify integration with other build systems
Diffstat (limited to 'scripts/generate-cmake-files.js')
-rwxr-xr-xscripts/generate-cmake-files.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/generate-cmake-files.js b/scripts/generate-cmake-files.js
index 4b6a8b8672..bbbb9accec 100755
--- a/scripts/generate-cmake-files.js
+++ b/scripts/generate-cmake-files.js
@@ -6,7 +6,7 @@ const ejs = require('ejs');
require('./style-code');
-function generateCMakeListFile(name, regex, patterns) {
+function generateFileList(name, regex, patterns) {
const files = child_process.execSync(`git ls-files ${patterns.map((p) => '"' + p + '"').join(' ')}`).toString().trim().split('\n');
var groups = {};
for (const file of files) {
@@ -18,15 +18,15 @@ function generateCMakeListFile(name, regex, patterns) {
groups[group].push(file);
}
- const fileListCmake = ejs.compile(fs.readFileSync('cmake/files.cmake.ejs', 'utf8'), {strict: true});
- writeIfModified(`cmake/${name}-files.cmake`, fileListCmake({ name: name, groups: groups }));
+ const fileListCmake = ejs.compile(fs.readFileSync('cmake/files.txt.ejs', 'utf8'), {strict: true});
+ writeIfModified(`cmake/${name}-files.txt`, fileListCmake({ groups: groups }));
}
-generateCMakeListFile('core', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/,
+generateFileList('core', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/,
[ 'include/*.hpp', 'include/*.h', 'src/*.hpp', 'src/*.cpp', 'src/*.h', 'src/*.c' ]);
-generateCMakeListFile('benchmark', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
+generateFileList('benchmark', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
[ 'benchmark/*.hpp', 'benchmark/*.cpp', 'benchmark/*.h', 'benchmark/*.c' ]);
-generateCMakeListFile('test', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
+generateFileList('test', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
[ 'test/*.hpp', 'test/*.cpp', 'test/*.h', 'test/*.c' ]);