From 5424c72ab6e95a94ea6bc9e0ad80cae734bd3199 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 8 Aug 2019 14:34:56 +0200 Subject: [PATCH] Extend handling of special condtions Extend the hanlding of special condtions outside single line statements. Conditions such as 'qtHaveModule(gui):qtConfig(opengl(es1|es2)?)' would not be handled properly. Change-Id: I992f75311b82d84c574c9cb4ef6d7d648f425d81 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 8e5e8307830..589ac1d568d 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -978,10 +978,10 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: # Some hardcoded cases that are too bothersome to generalize. - condition = re.sub(r'^qtConfig\(opengl\(es1\|es2\)\?\)$', + condition = re.sub(r'qtConfig\(opengl\(es1\|es2\)\?\)', r'QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3', condition) - condition = re.sub(r'^qtConfig\(opengl\.\*\)$', r'QT_FEATURE_opengl', condition) + condition = re.sub(r'qtConfig\(opengl\.\*\)', r'QT_FEATURE_opengl', condition) condition = re.sub(r'^win\*$', r'win', condition) def gcc_version_handler(match_obj: re.Match):