mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 07:33:33 +08:00
use CmakeLists scope to generate te XML file
- the only difference really is, that scope (the configuration.cmake) is already passed to px_process_params via the argument --scope. The Paths in --scope are evaluated w.r.t the path to src provided via the -s /--src-path argument. - if no --scope is proveided. the Old scheme by simply walking the full --src-path directory is applied
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
class Scope(object):
|
||||
"""
|
||||
Single parameter group
|
||||
"""
|
||||
re_deep_lines = re.compile(r'.*\/.*\/')
|
||||
def __init__(self,):
|
||||
self.scope = set()
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.scope.__str__()
|
||||
|
||||
def Add(self, scope):
|
||||
"""
|
||||
Add Scope to set
|
||||
"""
|
||||
self.scope.add(scope)
|
||||
|
||||
def Has(self, scope):
|
||||
"""
|
||||
Check for existance
|
||||
"""
|
||||
if len(self.scope) == 0:
|
||||
return True
|
||||
# Anything in the form xxxxx/yyyyy/zzzzz....
|
||||
# is treated as xxxxx/yyyyy
|
||||
while (self.re_deep_lines.match(scope)):
|
||||
scope = os.path.dirname(scope)
|
||||
return scope in self.scope
|
||||
Reference in New Issue
Block a user