Skip to content

Commit

Permalink
Do not validate file existence if path contains variables
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nierob committed Mar 28, 2019
1 parent 89f34ee commit 601c840
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions util/cmake/pro2cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 601c840

Please sign in to comment.