spdlog
Loading...
Searching...
No Matches
extract_version.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
3import os
4import re
5
6base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
7config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
8data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
9reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
10
11with open(config_h, 'r') as fp:
12 for l in fp:
13 m = reg.match(l)
14 if m:
15 data[m.group(1)] = int(m.group(2))
16
17print(f"{data['MAJOR']}.{data['MINOR']}.{data['PATCH']}")
void print(std::FILE *f, const text_style &ts, const S &format_str, const Args &... args)
Definition color.h:538