File: CheckSpdVersion.cmake

package info (click to toggle)
rhvoice 1.14.0-3
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 803,312 kB
  • sloc: cpp: 50,834; ansic: 6,748; python: 5,886; perl: 2,411; xml: 1,908; makefile: 304; sh: 265; lisp: 141; awk: 65
file content (14 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def CheckSpdVersion(ctx):
    ctx.Message("Checking Speech Dispatcher version ... ")
    ver=ctx.env.get("spd_version",None)
    if ver is not None:
        ctx.Result(ver)
        return ver
    src='#include <stdio.h>\n#include <speech-dispatcher/libspeechd_version.h>\nint main() {\nint major=LIBSPEECHD_MAJOR_VERSION;\nint minor=LIBSPEECHD_MINOR_VERSION;\nprintf("%d.%d",major,minor);\nreturn 0;}'
    res,ver=ctx.TryRun(src,".c")
    if not res:
        ctx.Result(res)
        return res
    ctx.env["spd_version"]=ver
    ctx.Result(ver)
    return ver