xK/xS/xS-gen-version.awk

15 lines
350 B
Awk

# 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
}
}