From 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 14 Nov 2019 11:23:18 +0100 Subject: Add more special condition conversions Handle conversions for QT_NO_CURSOR, QT_NO_TRANSLATION and qtConfig(opengles.). Change-Id: Idd930f77e78f235b7997a5083ac7faf630ed9801 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index d8753a7e2c..1d241efc8e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1396,6 +1396,9 @@ def unwrap_if(input_string): def map_condition(condition: str) -> str: # Some hardcoded cases that are too bothersome to generalize. + condition = re.sub(r"qtConfig\(opengles\.\)", + r"(QT_FEATURE_opengles2 OR QT_FEATURE_opengles3 OR QT_FEATURE_opengles31 OR QT_FEATURE_opengles32)", + condition) condition = re.sub( r"qtConfig\(opengl\(es1\|es2\)\?\)", r"QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3", @@ -1506,6 +1509,14 @@ def map_condition(condition: str) -> str: condition = re.sub(r"(^| )arm64-v8a", "TEST_architecture_arch STREQUAL arm64", condition) condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition) + # some defines replacements + condition = re.sub(r"DEFINES___contains___QT_NO_CURSOR", + r"(NOT QT_FEATURE_cursor)", + condition) + condition = re.sub(r"DEFINES___contains___QT_NO_TRANSLATION", + r"(NOT QT_FEATURE_translation)", + condition) + cmake_condition = "" for part in condition.split(): # some features contain e.g. linux, that should not be -- cgit v1.2.1