serach and insert rtps path if there is no {FASTRTPSGEN_DIR}

This commit is contained in:
stmoon 2019-12-31 13:24:48 +00:00 committed by Nuno Marques
parent a08b54b8e1
commit e19e0bd616
1 changed files with 10 additions and 2 deletions

View File

@ -235,10 +235,18 @@ else:
if args.fastrtpsgen is None or args.fastrtpsgen == '':
# Assume fastrtpsgen is in PATH
fastrtpsgen_path = 'fastrtpsgen'
for dirname in os.environ['PATH'].split(':') :
candidate = os.path.join(dirname, 'fastrtpsgen')
if os.path.isfile(candidate) :
fastrtpsgen_path = candidate
else:
# Path to fastrtpsgen is explicitly specified
fastrtpsgen_path = os.path.join(
os.path.abspath(args.fastrtpsgen), 'fastrtpsgen')
if os.path.isdir(args.fastrtpsgen) :
fastrtpsgen_path = os.path.join(
os.path.abspath(args.fastrtpsgen), 'fastrtpsgen')
else :
fastrtpsgen_path = args.fastrtpsgen
fastrtpsgen_include = args.fastrtpsgen_include
if fastrtpsgen_include is not None and fastrtpsgen_include != '':
fastrtpsgen_include = "-I " + \