diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-09-27 23:39:53 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-09-27 23:48:12 +0200 |
commit | 4d99690b89bda2814b78f01b88b7833296d47717 (patch) | |
tree | 6beac37b188564662c44feee268df73fc196ee5e /xS/xS-gen-version.awk | |
parent | 7c74e6615dcf3d1ec288028ee1e49d2556cafffe (diff) | |
download | xK-4d99690b89bda2814b78f01b88b7833296d47717.tar.gz xK-4d99690b89bda2814b78f01b88b7833296d47717.tar.xz xK-4d99690b89bda2814b78f01b88b7833296d47717.zip |
xS: parse project version from CMakeLists.txt
Diffstat (limited to 'xS/xS-gen-version.awk')
-rw-r--r-- | xS/xS-gen-version.awk | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xS/xS-gen-version.awk b/xS/xS-gen-version.awk new file mode 100644 index 0000000..1312a63 --- /dev/null +++ b/xS/xS-gen-version.awk @@ -0,0 +1,14 @@ +# xS-gen-version.awk: extract version information from the CMake script +# +# Copyright (c) 2022, Přemysl Eric Janouch <p@janouch.name> +# SPDX-License-Identifier: 0BSD + +Command == "project" { + for (i = 2; i in Args; i++) + if (Args[i] == "VERSION") { + print "package main" + print "" + print "const projectVersion = `" Args[++i] "`" + exit + } +} |