From 601c840973e91987c492f4b312215ff17a95e837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 28 Mar 2019 08:29:53 +0100 Subject: [PATCH] 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 --- util/cmake/pro2cmake.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 676ed4b406..60fd6297fb 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -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):