Do not validate file existence if path contains variables

We do not need to validate everything, while converting project
files. Some checks can be left to building step.

It fixes some false positive NOTFOUND errors.

Change-Id: I81ff2421fdea13add0bfc03086152a47bce39908
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jędrzej Nowacki 2019-03-28 08:29:53 +01:00
parent 89f34ee42a
commit 601c840973

View File

@ -166,6 +166,13 @@ def map_source_to_cmake(source: str, base_dir: str,
if os.path.exists(os.path.join(base_dir, source)):
return source
variable_pattern = re.compile(r'\$\{[A-Za-z0-9_]+\}')
match = re.match(variable_pattern, source)
if match:
# a complex, variable based path, skipping validation
# or resolving
return source
for v in vpath:
fullpath = os.path.join(v, source)
if os.path.exists(fullpath):