mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 23:43:34 +08:00
cmake improve git submodule dependencies
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
import argparse
|
||||
|
||||
p = argparse.ArgumentParser('finds major minor patch version from git tag')
|
||||
p.add_argument('--root', help="root of git repo", default=".")
|
||||
args = p.parse_args()
|
||||
os.chdir(args.root)
|
||||
p= subprocess.Popen(
|
||||
'git describe --always --tags'.split(),
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
# Python3 needs this decode step.
|
||||
stdout = stdout.decode('ascii')
|
||||
res = stdout.split('-')[0].split('.')
|
||||
major = res[0].replace('v','')
|
||||
minor = res[1]
|
||||
patch = res[2]
|
||||
print("{:s}.{:s}.{:s}".format(major, minor, patch))
|
||||
Reference in New Issue
Block a user