From fbf27595984f79787588bf4c59217ae6707313a3 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 9 Oct 2019 15:18:56 +0200 Subject: [PATCH] cmake scripts: add mapping for mkspec conditions Improves for example tests/auto/tools/moc/moc.pro conversion. Change-Id: I80f82be75299a0407be510824df35f0ea101c0c5 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- util/cmake/pro2cmake.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 52b2c93d3e..6e9f53aa3f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1571,6 +1571,13 @@ def map_condition(condition: str) -> str: condition = re.sub(r"\s*==\s*", "___STREQUAL___", condition) condition = re.sub(r"\bexists\s*\((.*?)\)", r"EXISTS \1", condition) + # checking mkspec, predating gcc scope in qmake, will then be replaced by platform_mapping in helper.py + condition = condition.replace("*-g++*", "GCC") + condition = condition.replace("*-icc*", "ICC") + condition = condition.replace("*-clang*", "CLANG") + condition = condition.replace("*-llvm", "CLANG") + condition = condition.replace("win32-*", "WIN32") + pattern = r"CONFIG\((debug|release),debug\|release\)" match_result = re.match(pattern, condition) if match_result: